- Fix handling of seusers and users_map file

This commit is contained in:
Daniel J Walsh 2006-02-10 16:42:07 +00:00
parent b40694835e
commit 437a1672f8
2 changed files with 57 additions and 37 deletions

View File

@ -1,42 +1,57 @@
diff --exclude-from=exclude -N -u -r nsalibsemanage/Makefile libsemanage-1.5.14/Makefile diff -Naurp --exclude-from excludes old/libsemanage/src/direct_api.c new/libsemanage/src/direct_api.c
--- nsalibsemanage/Makefile 2006-01-05 10:33:10.000000000 -0500 --- old/libsemanage/src/direct_api.c 2006-02-08 03:20:08.000000000 -0500
+++ libsemanage-1.5.14/Makefile 2006-01-13 23:46:32.000000000 -0500 +++ new/libsemanage/src/direct_api.c 2006-02-09 19:14:15.000000000 -0500
@@ -1,11 +1,17 @@ @@ -475,7 +475,7 @@ static int semanage_direct_commit(semana
all:
$(MAKE) -C src all
+pywrap: /* ==================== File-backed ================== */
+ $(MAKE) -C src pywrap
- /* 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: + pfcontexts->dtable->drop_cache(pfcontexts->dbase);
$(MAKE) -C include install
$(MAKE) -C src install
$(MAKE) -C man install
+install-pywrap:
+ $(MAKE) -C src install-pywrap
+ +
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: + /* Users_extra */
diff --exclude-from=exclude -N -u -r nsalibsemanage/src/Makefile libsemanage-1.5.14/src/Makefile if (sepol_module_package_get_user_extra_len(base)) {
--- nsalibsemanage/src/Makefile 2005-11-29 10:54:15.000000000 -0500 if ((ofilename = semanage_path(SEMANAGE_TMP, SEMANAGE_USER_EXTRA)) == NULL ||
+++ libsemanage-1.5.14/src/Makefile 2006-01-13 23:46:17.000000000 -0500 write_file(sh, ofilename, sepol_module_package_get_user_extra(base),
@@ -37,7 +37,7 @@ 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) /* ==================== Policydb-backed ================ */
+all: $(LIBA) $(LIBSO)
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)

View File

@ -3,10 +3,11 @@
Summary: SELinux binary policy manipulation library Summary: SELinux binary policy manipulation library
Name: libsemanage Name: libsemanage
Version: 1.5.21 Version: 1.5.21
Release: 1 Release: 2
License: GPL License: GPL
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/libsemanage-%{version}.tgz Source: http://www.nsa.gov/selinux/archives/libsemanage-%{version}.tgz
Patch: libsemanage-rhat.patch
BuildRoot: %{_tmppath}/%{name}-buildroot BuildRoot: %{_tmppath}/%{name}-buildroot
BuildRequires: libselinux-devel >= %{libselinuxver} BuildRequires: libselinux-devel >= %{libselinuxver}
@ -39,6 +40,7 @@ needed for developing applications that manipulate binary policies.
%prep %prep
%setup -q %setup -q
%patch -p2 -b .rhat
%build %build
make clean make clean
@ -75,7 +77,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.5.21-1 * Fri Feb 10 2006 Dan Walsh <dwalsh@redhat.com> - 1.5.21-2
- Fix handling of seusers and users_map file
* Tue Feb 07 2006 Dan Walsh <dwalsh@redhat.com> - 1.5.21-1
- Upgrade to latest from NSA - Upgrade to latest from NSA
* Merged seuser/user_extra support patch from Joshua Brindle. * Merged seuser/user_extra support patch from Joshua Brindle.
* Merged remote system dbase patch from Ivan Gyurdiev. * Merged remote system dbase patch from Ivan Gyurdiev.