Personal tools
You are here: Home Archive 2009 June 06 SELinux may make two "identical" files be different
Document Actions

SELinux may make two "identical" files be different

...insofar as you can't tell them apart with ls -l or even diff. I scratched my head recently when upgrading and moving a legacy PHP system, when two identical files behaved quite differently, eventhough diff and ls -l reported no differences whatsoever. But one had different SELinux attributes on it that you can't see with ls -l. It got them because it had been unpacked in a user's home directory (which easily happens when you do an scp and unpack before move), and this made SELinux tag it in a special way. Check the below link for the full(er) story of how to check for these kinds of things:

You can confirm that SELinux is causing the problem by turning SELinux off temporarily (run the command setenforce 0 as root) and try the operation. If it succeeds, likely SELinux is the culprit. (I'm assuming that this is a development setup, not a production machine



Läs mer: SELinux may cause mysterious permission problems | drupal.org

Posted by jorgen on 2009-06-06 21:10

cmp

Posted by Mikael Ståldal at 2009-06-07 07:47
cmp is a suitable command for comparing the content of two files that may be binary and you are not interested in <em>what</em> the differences are, only <em>if</em> there are any differences.

Does cmp know about selinux?

Posted by jorgen at 2009-06-07 08:44
In this case it was two text files. If cmp also hooks into selinux and knows about its attributes, then yes it would be applicable in this case, but I do not think it can do this.

ads
 

This site conforms to the following standards: