selinux/policycoreutils/setfiles
Stephen Smalley 37c5c30998 setfiles: only call realpath() on user-supplied pathnames
Change setfiles/restorecon to only call realpath() on the user-supplied
pathnames prior to invoking fts_open().  This ensures that commands such
as restorecon -R /etc/init.d and (cd /etc && restorecon shadow gshadow)
will work as expected while avoiding the overhead of calling realpath()
on each file during a file tree walk.

Since we are now only acting on user-supplied pathnames, drop the
special case handling of symlinks (when a user invokes restorecon
-R /etc/init.d he truly wants it to descend /etc/rc.d/init.d).  We can
also defer allocation of the pathname buffer to libc by passing NULL
(freeing on the out path) and we can drop the redundant exclude() check
as it will now get handled on the normal path.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-08-04 15:58:38 -04:00
..
Makefile setfiles converted to fts 2009-07-07 08:21:34 -04:00
restorecon.8 initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
setfiles.8 initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
setfiles.c setfiles: only call realpath() on user-supplied pathnames 2009-08-04 15:58:38 -04:00