4ff3f08
--- /dev/null	2005-04-20 05:34:52.522685192 -0400
4ff3f08
+++ libselinux-1.23.7/man/man3/selinux_policy_root.3	2005-04-21 09:54:24.000000000 -0400
ce82f57
@@ -0,0 +1,17 @@
ce82f57
+.TH "selinux_policy_root" "3" "25 May 2004" "dwalsh@redhat.com" "SE Linux API documentation"
ce82f57
+.SH "NAME"
ce82f57
+selinux_policy_root \- return the path of the SELinux policy files for this machine.
ce82f57
+.SH "SYNOPSIS"
ce82f57
+.B #include <selinux/selinux.h>
ce82f57
+.sp
ce82f57
+.B char *selinux_policy_root();
ce82f57
+.br
ce82f57
+
ce82f57
+.SH "DESCRIPTION"
ce82f57
+.B selinux_policy_root
ce82f57
+Reads the contents of the /etc/selinux/config file to determine which policy files should be used for this machine.
ce82f57
+.SH "RETURN VALUE"
ce82f57
+On success, returns a directory path containing the SELinux policy files.
ce82f57
+On failure, NULL is returned.
ce82f57
+
ce82f57
+
4ff3f08
--- libselinux-1.23.7/man/man8/matchpathcon.8.rhat	2005-04-21 10:05:45.000000000 -0400
4ff3f08
+++ libselinux-1.23.7/man/man8/matchpathcon.8	2005-04-21 10:12:24.000000000 -0400
4ff3f08
@@ -0,0 +1,20 @@
4ff3f08
+.TH "matchpathcon" "8" "21 April 2005" "dwalsh@redhat.com" "SE Linux Command Line documentation"
4ff3f08
+.SH "NAME"
4ff3f08
+matchpathcon \- get the default security context for the specified path from the file contexts configuration.
4ff3f08
+
4ff3f08
+.SH "SYNOPSIS"
4ff3f08
+.B matchpathcon [-n] filepath...
4ff3f08
+
4ff3f08
+.SH "DESCRIPTION"
4ff3f08
+.B matchpathcon
4ff3f08
+Prints the file path and the default security context associated with it.
4ff3f08
+.br
4ff3f08
+If the -n option is given, do not display path.
4ff3f08
+
4ff3f08
+.SH AUTHOR	
4ff3f08
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
4ff3f08
+.br
4ff3f08
+The program was written by NSA
4ff3f08
+
4ff3f08
+.SH "SEE ALSO"
4ff3f08
+.BR mathpathcon "(3), " 
4ff3f08
--- libselinux-1.23.7/utils/matchpathcon.c.rhat	2005-04-13 11:34:19.000000000 -0400
4ff3f08
+++ libselinux-1.23.7/utils/matchpathcon.c	2005-04-21 10:02:04.000000000 -0400
4ff3f08
@@ -1,25 +1,43 @@
4ff3f08
 #include <unistd.h>
4ff3f08
 #include <stdio.h>
4ff3f08
 #include <stdlib.h>
4ff3f08
+#include <getopt.h>
4ff3f08
 #include <selinux/selinux.h>
4ff3f08
 
4ff3f08
+void usage(const char *progname) 
4ff3f08
+{
4ff3f08
+	fprintf(stderr, "usage:  %s [-n] path...\n", progname);
4ff3f08
+	exit(1);
4ff3f08
+}
4ff3f08
+
4ff3f08
 int main(int argc, char **argv) 
4ff3f08
 {
4ff3f08
 	char *buf;
4ff3f08
 	int rc, i;
4ff3f08
+	int header=1, opt;
4ff3f08
 
4ff3f08
-	if (argc < 2) {
4ff3f08
-		fprintf(stderr, "usage:  %s path...\n", argv[0]);
4ff3f08
-		return 1;
4ff3f08
-	}
4ff3f08
+	if (argc < 2) usage(argv[0]);
4ff3f08
 
4ff3f08
-	for (i = 1; i < argc; i++) {
4ff3f08
+	while ((opt = getopt(argc, argv, "n")) > 0) {
4ff3f08
+		switch (opt) {
4ff3f08
+		case 'n':
4ff3f08
+			header=0;
4ff3f08
+			break;
4ff3f08
+		default:
4ff3f08
+			usage(argv[0]);
4ff3f08
+		}
4ff3f08
+	}
4ff3f08
+	for (i = optind; i < argc; i++) {
4ff3f08
 		rc = matchpathcon(argv[i], 0, &buf;;
4ff3f08
 		if (rc < 0) {
4ff3f08
 			fprintf(stderr, "%s:  matchpathcon(%s) failed\n", argv[0], argv[i]);
4ff3f08
 			return 2;
4ff3f08
 		}
4ff3f08
-		printf("%s\t%s\n", argv[i], buf);
4ff3f08
+		if (header)
4ff3f08
+			printf("%s\t%s\n", argv[i], buf);
4ff3f08
+		else
4ff3f08
+			printf("%s\n", buf);
4ff3f08
+
4ff3f08
 		freecon(buf);
4ff3f08
 	}
4ff3f08
 	return 0;