Skip to contentSkip to conversation

Man page fix for matchpatchcon

PATCH Daniel J Walsh 3 participants 3 messages Dec 6, 2007 – Dec 7, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHWDs1rlYvE4MpobMRAmDBAKC3EnBRz81RxtgLKcMSHnUvMqNJkwCcCyx+ QgfQjemToY0sD9lksoYX/wo=
=7auR
-----END PGP SIGNATURE-----

man/man8/matchpathcon.8 +6 -1
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/matchpathcon.8 libselinux-2.0.45/man/man8/matchpathcon.8
@@ -6,7 +6,12 @@
 .B matchpathcon [-V] [-N] [-n] [-f file_contexts_file ] [-p prefix ] filepath...
 .SH "DESCRIPTION"
 .B matchpathcon
-Prints the file path and the default security context associated with it.
+Queries the system and prints the default security context associated with the filepath.
+
+Note: Identical paths can have different security contexts, depending on the file type. (regular file, directory, link file, char file ...)
+
+matchpathcon will check the system default context using the file type if the file exists.  If the file does not exist, it will get the context of a regular file.
+
 .SH OPTIONS
 .B \-n
 Do not display path.
#1 lore raw

Comments inline, hopefully the mail client won't munge things too much.

- todd

diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/matchpathcon.8 libselinux-2.0.45/man/man8/matchpathcon.8
--- nsalibselinux/man/man8/matchpathcon.8 2007-08-03
16:02:56.000000000 -0400
+++ libselinux-2.0.45/man/man8/matchpathcon.8 2007-12-06
11:22:40.000000000 -0500
@@ -6,7 +6,12 @@
.B matchpathcon [-V] [-N] [-n] [-f file_contexts_file ] [-p prefix ]
filepath...
.SH "DESCRIPTION"
.B matchpathcon
-Prints the file path and the default security context associated with it.
+Queries the system and prints the default security context associated with the filepath.

This should be a lower case 'q' since it is not the start of the sentence.

+
+Note: Identical paths can have different security contexts, depending on the file type. (regular file, directory, link file, char file ...) +
+matchpathcon will check the system default context using the file type if the file exists. If
the file does not exist, it will get the context of a regular file.

Should probably use ".B matchpathcon" here.

+
.SH OPTIONS
.B \-n
Do not display path.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 29 lines · Todd Miller

Comments inline, hopefully the mail client won't munge things too much.

- todd

diff --exclude-from=exclude -N -u -r
nsalibselinux/man/man8/matchpathcon.8
libselinux-2.0.45/man/man8/matchpathcon.8
--- nsalibselinux/man/man8/matchpathcon.8 2007-08-03
16:02:56.000000000 -0400
+++ libselinux-2.0.45/man/man8/matchpathcon.8 2007-12-06
11:22:40.000000000 -0500

(quoted diff) +0 -0
@@ -6,7 +6,12 @@
 .B matchpathcon [-V] [-N] [-n] [-f file_contexts_file ] [-p prefix ]

filepath...
.SH "DESCRIPTION"
.B matchpathcon
-Prints the file path and the default security context associated with it.
+Queries the system and prints the default security context associated with the filepath.

This should be a lower case 'q' since it is not the start of the sentence.

(quoted diff) +2 -0
+
+Note: Identical paths can have different security contexts, depending

on the file type. (regular file, directory, link file, char file ...)

(quoted diff) +2 -0
+
+matchpathcon will check the system default context using the file type
Quoted 2 lines

if the file exists. If
the file does not exist, it will get the context of a regular file.

Also, this last part wasn't right - if the file doesn't exist, then matchpathcon passes a 0 mode to matchpathcon(3), which in turn does no file mode/type matching at all in that case (so any entry will match).

Applied those fixes and committed.

Quoted 7 lines

Should probably use ".B matchpathcon" here.

+
.SH OPTIONS
.B \-n
Do not display path.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.