selinux/libselinux
Eric Paris 4ad1896954 libselinux: resolv symlinks and dot directories before matching paths
matchpathcon cannot handle ./ or ../ in pathnames and doesn't do well
with symlinks.  This patch uses the glibc function realpath() to try to
determine a real path with resolved symlinks and dot directories.  For
example before this pach we would see:

$ matchpathcon /tmp/../eric
/tmp/../eric	<<none>>
$ matchpathcon /eric
/eric	system_u:object_r:default_t:s0

Whereas after the path we get the same results.  The one quirk with the
patch is that we need special code to make sure that realpath() does not
follow a symlink if it is the final component.  aka if we have a symlink
from /eric to /tmp/eric we do not want to resolv to /tmp/eric.  We want
to just resolv to the actual symlink /eric.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-11 23:35:48 -04:00
..
include This patch adds a new subs_dist file. 2011-04-08 10:28:02 -04:00
man libselinux: new setexecon utility 2011-08-02 13:33:35 -04:00
src audit2allow: do not print statistics 2011-08-03 18:02:32 -04:00
utils libselinux: resolv symlinks and dot directories before matching paths 2011-08-11 23:35:48 -04:00
ChangeLog update repo for 2011-08-03 with version and changelog updates 2011-08-03 18:09:02 -04:00
LICENSE initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
VERSION update repo for 2011-08-03 with version and changelog updates 2011-08-03 18:09:02 -04:00