diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 45ed4e4..36f2589 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,6 +1,5 @@ -diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_policy_root.3 libselinux-1.23.7/man/man3/selinux_policy_root.3 ---- nsalibselinux/man/man3/selinux_policy_root.3 1969-12-31 19:00:00.000000000 -0500 -+++ libselinux-1.23.7/man/man3/selinux_policy_root.3 2005-04-13 15:02:22.000000000 -0400 +--- /dev/null 2005-04-20 05:34:52.522685192 -0400 ++++ libselinux-1.23.7/man/man3/selinux_policy_root.3 2005-04-21 09:54:24.000000000 -0400 @@ -0,0 +1,17 @@ +.TH "selinux_policy_root" "3" "25 May 2004" "dwalsh@redhat.com" "SE Linux API documentation" +.SH "NAME" @@ -19,24 +18,78 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_policy_root. +On failure, NULL is returned. + + -diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_policyroot.3 libselinux-1.23.7/man/man3/selinux_policyroot.3 ---- nsalibselinux/man/man3/selinux_policyroot.3 2004-10-20 16:31:36.000000000 -0400 -+++ libselinux-1.23.7/man/man3/selinux_policyroot.3 1969-12-31 19:00:00.000000000 -0500 -@@ -1,17 +0,0 @@ --.TH "selinux_policyroot" "3" "25 May 2004" "dwalsh@redhat.com" "SE Linux API documentation" --.SH "NAME" --selinux_policyroot \- return the path of the SELinux policy files for this machine. --.SH "SYNOPSIS" --.B #include --.sp --.B char *selinux_policyroot(); --.br -- --.SH "DESCRIPTION" --.B selinux_policyroot --Reads the contents of the /etc/selinux/config file to determine which policy files should be used for this machine. --.SH "RETURN VALUE" --On success, returns a directory path containing the SELinux policy files. --On failure, NULL is returned. -- -- +--- libselinux-1.23.7/man/man8/matchpathcon.8.rhat 2005-04-21 10:05:45.000000000 -0400 ++++ libselinux-1.23.7/man/man8/matchpathcon.8 2005-04-21 10:12:24.000000000 -0400 +@@ -0,0 +1,20 @@ ++.TH "matchpathcon" "8" "21 April 2005" "dwalsh@redhat.com" "SE Linux Command Line documentation" ++.SH "NAME" ++matchpathcon \- get the default security context for the specified path from the file contexts configuration. ++ ++.SH "SYNOPSIS" ++.B matchpathcon [-n] filepath... ++ ++.SH "DESCRIPTION" ++.B matchpathcon ++Prints the file path and the default security context associated with it. ++.br ++If the -n option is given, do not display path. ++ ++.SH AUTHOR ++This manual page was written by Dan Walsh . ++.br ++The program was written by NSA ++ ++.SH "SEE ALSO" ++.BR mathpathcon "(3), " +--- libselinux-1.23.7/utils/matchpathcon.c.rhat 2005-04-13 11:34:19.000000000 -0400 ++++ libselinux-1.23.7/utils/matchpathcon.c 2005-04-21 10:02:04.000000000 -0400 +@@ -1,25 +1,43 @@ + #include + #include + #include ++#include + #include + ++void usage(const char *progname) ++{ ++ fprintf(stderr, "usage: %s [-n] path...\n", progname); ++ exit(1); ++} ++ + int main(int argc, char **argv) + { + char *buf; + int rc, i; ++ int header=1, opt; + +- if (argc < 2) { +- fprintf(stderr, "usage: %s path...\n", argv[0]); +- return 1; +- } ++ if (argc < 2) usage(argv[0]); + +- for (i = 1; i < argc; i++) { ++ while ((opt = getopt(argc, argv, "n")) > 0) { ++ switch (opt) { ++ case 'n': ++ header=0; ++ break; ++ default: ++ usage(argv[0]); ++ } ++ } ++ for (i = optind; i < argc; i++) { + rc = matchpathcon(argv[i], 0, &buf); + if (rc < 0) { + fprintf(stderr, "%s: matchpathcon(%s) failed\n", argv[0], argv[i]); + return 2; + } +- printf("%s\t%s\n", argv[i], buf); ++ if (header) ++ printf("%s\t%s\n", argv[i], buf); ++ else ++ printf("%s\n", buf); ++ + freecon(buf); + } + return 0; diff --git a/libselinux.spec b/libselinux.spec index 17646de..6414d56 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -1,7 +1,7 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 1.23.7 -Release: 2 +Release: 3 License: Public domain (uncopyrighted) Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz @@ -57,7 +57,6 @@ rm -f ${RPM_BUILD_ROOT}%{_sbindir}/getconlist rm -f ${RPM_BUILD_ROOT}%{_sbindir}/getenforcemode rm -f ${RPM_BUILD_ROOT}%{_sbindir}/getfilecon rm -f ${RPM_BUILD_ROOT}%{_sbindir}/getpidcon -rm -f ${RPM_BUILD_ROOT}%{_sbindir}/matchpathcon rm -f ${RPM_BUILD_ROOT}%{_sbindir}/mkdircon rm -f ${RPM_BUILD_ROOT}%{_sbindir}/policyvers rm -f ${RPM_BUILD_ROOT}%{_sbindir}/setfilecon @@ -86,6 +85,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man8/* %changelog +* Thu Apr 21 2005 Dan Walsh 1.23.7-3 +- Add backin matchpathcon + * Wed Apr 13 2005 Dan Walsh 1.23.7-2 - Fix selinux_policy_root man page