Skip to content

Commit

Permalink
setfiles: clarify documented path resolution behaviour
Browse files Browse the repository at this point in the history
One thing that confused me when investigating
SELinuxProject/selinux#248 (i.e.
coreos/fedora-coreos-tracker#512) was that the
manual page for `setfiles` seemed to imply that paths were fully
resolved. This was consistent with the issues above where `setfiles` was
failing because the target of the symbolic link didn't exist.

But in fact, the wording around symbolic links in
`setfiles`/`restorecon` refers actually to whether the parent
directories are canonicalized via `realpath(3)` before labeling.

Clarify the man pages to explain this.

Signed-off-by: Jonathan Lebon <jlebon@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
  • Loading branch information
jlebon authored and stephensmalley committed Jun 25, 2020
1 parent da3bbc3 commit 5f844b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions policycoreutils/setfiles/restorecon.8
Expand Up @@ -166,8 +166,10 @@ The pathname for the file(s) to be relabeled.
.SH "NOTES"
.IP "1." 4
.B restorecon
does not follow symbolic links and by default it does not
operate recursively on directories.
by default does not operate recursively on directories. Paths leading up the
final component of the file(s) are canonicalized using
.BR realpath (3)
before labeling.
.IP "2." 4
If the
.I pathname
Expand Down
3 changes: 2 additions & 1 deletion policycoreutils/setfiles/setfiles.8
Expand Up @@ -214,7 +214,8 @@ option is used.
.SH "NOTES"
.IP "1." 4
.B setfiles
follows symbolic links and operates recursively on directories.
operates recursively on directories. Paths leading up the final
component of the file(s) are not canonicalized before labeling.
.IP "2." 4
If the
.I pathname
Expand Down

0 comments on commit 5f844b6

Please sign in to comment.