From 437a1672f8212571851faeabca929f39057e2985 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 10 Feb 2006 16:42:07 +0000 Subject: [PATCH] - Fix handling of seusers and users_map file --- libsemanage-rhat.patch | 85 +++++++++++++++++++++++++----------------- libsemanage.spec | 9 ++++- 2 files changed, 57 insertions(+), 37 deletions(-) diff --git a/libsemanage-rhat.patch b/libsemanage-rhat.patch index 54cc00a..a72d1f4 100644 --- a/libsemanage-rhat.patch +++ b/libsemanage-rhat.patch @@ -1,42 +1,57 @@ -diff --exclude-from=exclude -N -u -r nsalibsemanage/Makefile libsemanage-1.5.14/Makefile ---- nsalibsemanage/Makefile 2006-01-05 10:33:10.000000000 -0500 -+++ libsemanage-1.5.14/Makefile 2006-01-13 23:46:32.000000000 -0500 -@@ -1,11 +1,17 @@ - all: - $(MAKE) -C src all +diff -Naurp --exclude-from excludes old/libsemanage/src/direct_api.c new/libsemanage/src/direct_api.c +--- old/libsemanage/src/direct_api.c 2006-02-08 03:20:08.000000000 -0500 ++++ new/libsemanage/src/direct_api.c 2006-02-09 19:14:15.000000000 -0500 +@@ -475,7 +475,7 @@ static int semanage_direct_commit(semana -+pywrap: -+ $(MAKE) -C src pywrap + /* ==================== File-backed ================== */ + +- /* write the linked file contexts template */ ++ /* File Contexts */ + if ((ofilename = semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL)) == NULL || + write_file(sh, ofilename, sepol_module_package_get_file_contexts(base), + sepol_module_package_get_file_contexts_len(base)) == -1) { +@@ -484,29 +484,36 @@ static int semanage_direct_commit(semana + + if (semanage_split_fc(sh)) + goto cleanup; +- + - install: - $(MAKE) -C include install - $(MAKE) -C src install - $(MAKE) -C man install - -+install-pywrap: -+ $(MAKE) -C src install-pywrap ++ pfcontexts->dtable->drop_cache(pfcontexts->dbase); + - relabel: ++ /* Seusers */ + if (sepol_module_package_get_seusers_len(base)) { + if ((ofilename = semanage_path(SEMANAGE_TMP, SEMANAGE_SEUSERS)) == NULL || + write_file(sh, ofilename, sepol_module_package_get_seusers(base), + sepol_module_package_get_seusers_len(base)) == -1) { + goto cleanup; + } ++ pseusers->dtable->drop_cache(pseusers->dbase); ++ ++ } else { ++ if (pseusers->dtable->clear(sh, pseusers->dbase) < 0) ++ goto cleanup; + } - clean: -diff --exclude-from=exclude -N -u -r nsalibsemanage/src/Makefile libsemanage-1.5.14/src/Makefile ---- nsalibsemanage/src/Makefile 2005-11-29 10:54:15.000000000 -0500 -+++ libsemanage-1.5.14/src/Makefile 2006-01-13 23:46:17.000000000 -0500 -@@ -37,7 +37,7 @@ ++ /* Users_extra */ + if (sepol_module_package_get_user_extra_len(base)) { + if ((ofilename = semanage_path(SEMANAGE_TMP, SEMANAGE_USER_EXTRA)) == NULL || + write_file(sh, ofilename, sepol_module_package_get_user_extra(base), + sepol_module_package_get_user_extra_len(base)) == -1) { + goto cleanup; + } +- } ++ pusers_extra->dtable->drop_cache(pusers_extra->dbase); - SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ +- /* Drop any cached content for file_contexts, seusers, or users_extra, +- * since it is now superceded by the files just written, and needs to be +- * re-cached */ +- pfcontexts->dtable->drop_cache(pfcontexts->dbase); +- pseusers->dtable->drop_cache(pseusers->dbase); +- pusers_extra->dtable->drop_cache(pusers_extra->dbase); ++ } else { ++ if (pusers_extra->dtable->clear(sh, pusers_extra->dbase) < 0) ++ goto cleanup; ++ } --all: $(LIBA) $(LIBSO) $(SWIGSO) -+all: $(LIBA) $(LIBSO) + /* ==================== Policydb-backed ================ */ - pywrap: all $(SWIGLOBJ) $(SWIGSO) - -@@ -75,7 +75,7 @@ - swigify: $(SWIGIF) - $(SWIG) $^ - --install: all install-pywrap -+install: all - test -d $(LIBDIR) || install -m 755 -d $(LIBDIR) - install -m 644 $(LIBA) $(LIBDIR) - test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR) diff --git a/libsemanage.spec b/libsemanage.spec index 81507d4..d0a1836 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -3,10 +3,11 @@ Summary: SELinux binary policy manipulation library Name: libsemanage Version: 1.5.21 -Release: 1 +Release: 2 License: GPL Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/libsemanage-%{version}.tgz +Patch: libsemanage-rhat.patch BuildRoot: %{_tmppath}/%{name}-buildroot BuildRequires: libselinux-devel >= %{libselinuxver} @@ -39,6 +40,7 @@ needed for developing applications that manipulate binary policies. %prep %setup -q +%patch -p2 -b .rhat %build make clean @@ -75,7 +77,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man3/* %changelog -* Tue Feb 07 2006 Jesse Keating - 1.5.21-1 +* Fri Feb 10 2006 Dan Walsh - 1.5.21-2 +- Fix handling of seusers and users_map file + +* Tue Feb 07 2006 Dan Walsh - 1.5.21-1 - Upgrade to latest from NSA * Merged seuser/user_extra support patch from Joshua Brindle. * Merged remote system dbase patch from Ivan Gyurdiev.