[libsemanage] Create symlink from policy.kern to active kernel.

Daniel J Walsh dwalsh at fedoraproject.org
Mon Sep 9 13:34:43 UTC 2013


commit a70e6a436c407336da0f4b332eac78e4f9c2d064
Author: Dan Walsh <dwalsh at redhat.com>
Date:   Mon Sep 9 09:34:32 2013 -0400

    Create symlink from policy.kern to active kernel.

 libsemanage-rhat.patch |   15 +++++++++++++++
 libsemanage.spec       |    8 +++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/libsemanage-rhat.patch b/libsemanage-rhat.patch
index d3bcee6..5fb78d9 100644
--- a/libsemanage-rhat.patch
+++ b/libsemanage-rhat.patch
@@ -183,6 +183,21 @@ index 3c81d7a..f3b9b5c 100644
  			} else {
  				if (semanage_list_push(&homedir_list, path))
  					goto fail;
+diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c
+index 57ef49f..4b040c3 100644
+--- a/libsemanage/src/semanage_store.c
++++ b/libsemanage/src/semanage_store.c
+@@ -1234,6 +1234,10 @@ static int semanage_install_active(semanage_handle_t * sh)
+ 
+ 	retval = 0;
+       cleanup:
++	(void) unlink(active_kernel);
++	if (symlink(store_pol, active_kernel) < 0) {
++		ERR(sh, "Unable to create sybolic link from %s to %s error code %d.", active_kernel, store_pol, r);
++	}
+ 	free(storepath);
+ 	return retval;
+ }
 diff --git a/libsemanage/src/seusers_local.c b/libsemanage/src/seusers_local.c
 index e7cf12c..ed0af21 100644
 --- a/libsemanage/src/seusers_local.c
diff --git a/libsemanage.spec b/libsemanage.spec
index b3af7d2..97a5096 100644
--- a/libsemanage.spec
+++ b/libsemanage.spec
@@ -7,7 +7,7 @@
 Summary: SELinux binary policy manipulation library 
 Name: libsemanage
 Version: 2.1.10
-Release: 7%{?dist}
+Release: 9%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: libsemanage-%{version}.tgz
@@ -179,6 +179,12 @@ rm -rf ${RPM_BUILD_ROOT}
 %endif # if with_python3
 
 %changelog
+* Mon Sep 9 2013 Dan Walsh <dwalsh at redhat.com> - 2.1.10-9
+- Create symlink from policy.kern to active kernel.
+
+* Fri Sep 6 2013 Dan Walsh <dwalsh at redhat.com> - 2.1.10-8
+- Unlink policy.kern when done to save space.
+
 * Fri Jul 26 2013 Dan Walsh <dwalsh at redhat.com> - 2.1.10-7
 - Move handling of role audit records into the library
 - Patch stops semanage from removing user record while in use


More information about the scm-commits mailing list