From 8e994c6484322e936d68f0107e3b2292a9aaaddb Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Feb 17 2005 19:27:56 +0000 Subject: - Update from NSA Merged matchpathcon patch for file_contexts.homedir from Dan Walsh. Added selinux_users_path() for path to directory containing system.users and local.users. --- diff --git a/.cvsignore b/.cvsignore index 9a46e3d..3296d56 100644 --- a/.cvsignore +++ b/.cvsignore @@ -22,3 +22,4 @@ nsadiff nsalibselinux libselinux-1.21.8.tgz libselinux-1.21.9.tgz +libselinux-1.21.10.tgz diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 8f75dc5..4becd62 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,92 +1,70 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-1.21.9/src/matchpathcon.c ---- nsalibselinux/src/matchpathcon.c 2005-01-31 13:50:18.000000000 -0500 -+++ libselinux-1.21.9/src/matchpathcon.c 2005-02-10 16:51:59.000000000 -0500 -@@ -519,10 +519,13 @@ - { - FILE *fp; - FILE *localfp; -+ FILE *homedirfp; - char local_path[PATH_MAX + 1]; -+ char homedir_path[PATH_MAX + 1]; - char line_buf[BUFSIZ + 1]; - unsigned int lineno, pass, i, j, maxnspec; - spec_t *spec_copy; -+ int status=-1; - - /* Open the specification file. */ - if (!path) -@@ -530,6 +533,9 @@ - if ((fp = fopen(path, "r")) == NULL) - return -1; - -+ snprintf(homedir_path, sizeof(homedir_path), "%s.homedirs", path); -+ homedirfp = fopen(homedir_path, "r"); -+ - snprintf(local_path, sizeof(local_path), "%s.local", path); - localfp = fopen(local_path, "r"); - -@@ -547,33 +553,41 @@ +--- nsalibselinux/src/matchpathcon.c 2005-02-17 14:22:28.000000000 -0500 ++++ libselinux-1.21.9/src/matchpathcon.c 2005-02-11 02:36:46.000000000 -0500 +@@ -553,29 +553,27 @@ nspec = 0; while (fgets_unlocked(line_buf, sizeof line_buf, fp) && nspec < maxnspec) { if (process_line(path, line_buf, pass, ++lineno) != 0) -- return -1; -+ goto finish; +- goto finish; ++ return -1; } -+ if (homedirfp) -+ while (fgets_unlocked(line_buf, sizeof line_buf, homedirfp) && nspec < maxnspec) { -+ if (process_line(homedir_path, line_buf, pass, ++lineno) != 0) -+ goto finish; -+ } -+ -+ + if (homedirfp) + while (fgets_unlocked(line_buf, sizeof line_buf, homedirfp) && nspec < maxnspec) { + if (process_line(homedir_path, line_buf, pass, ++lineno) != 0) +- goto finish; ++ return -1; + } + + if (localfp) while (fgets_unlocked(line_buf, sizeof line_buf, localfp) && nspec < maxnspec) { if (process_line(local_path, line_buf, pass, ++lineno) != 0) -- return -1; -+ goto finish; +- goto finish; ++ return -1; } if (pass == 0) { -- if (nspec == 0) -- return 0; -+ if (nspec == 0) { -+ status = 0; -+ goto finish; -+ } +- if (nspec == 0) { +- status = 0; +- goto finish; +- } ++ if (nspec == 0) ++ return 0; if ((spec_arr = malloc(sizeof(spec_t) * nspec)) == NULL) -- return -1; -+ goto finish; +- goto finish; ++ return -1; memset(spec_arr, '\0', sizeof(spec_t) * nspec); maxnspec = nspec; rewind(fp); -+ if (homedirfp) rewind(homedirfp); +@@ -583,11 +581,13 @@ if (localfp) rewind(localfp); } } -- fclose(fp); -- if (localfp) fclose(localfp); - +- ++ fclose(fp); ++ if (homedirfp) fclose(homedirfp); ++ if (localfp) fclose(localfp); /* Move exact pathname specifications to the end. */ spec_copy = malloc(sizeof(spec_t) * nspec); if (!spec_copy) -- return -1; -+ goto finish; +- goto finish; ++ return -1; j = 0; for (i = 0; i < nspec; i++) { if (spec_arr[i].hasMetaChars) -@@ -588,7 +602,13 @@ +@@ -602,13 +602,7 @@ nodups_specs(path); -- return 0; -+ status = 0; -+ finish: -+ fclose(fp); -+ if (spec_arr != spec_copy) free(spec_arr); -+ if (homedirfp) fclose(homedirfp); -+ if (localfp) fclose(localfp); -+ return status; +- status = 0; +- finish: +- fclose(fp); +- if (spec_arr != spec_copy) free(spec_arr); +- if (homedirfp) fclose(homedirfp); +- if (localfp) fclose(localfp); +- return status; ++ return 0; } hidden_def(matchpathcon_init) diff --git a/libselinux.spec b/libselinux.spec index 9f69ff7..03b0571 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -1,11 +1,10 @@ Summary: SELinux library and simple utilities Name: libselinux -Version: 1.21.9 -Release: 2 +Version: 1.21.10 +Release: 1 License: Public domain (uncopyrighted) Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz -Patch: libselinux-rhat.patch BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot @@ -35,7 +34,6 @@ needed for developing SELinux applications. %prep %setup -q -%patch -p1 -b .rhat %build make CFLAGS="-g %{optflags}" @@ -85,6 +83,12 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man8/* %changelog +* Thu Feb 17 2005 Dan Walsh 1.21.10-1 +- Update from NSA + * Merged matchpathcon patch for file_contexts.homedir from Dan Walsh. + * Added selinux_users_path() for path to directory containing + system.users and local.users. + * Thu Feb 10 2005 Dan Walsh 1.21.9-2 - Process file_context.homedir diff --git a/sources b/sources index 622b9fb..09a34e9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d949858f86b40ef974bfdf6a18c893b4 libselinux-1.21.9.tgz +0539a827b8e8c20be18d025916bf1122 libselinux-1.21.10.tgz