rpms/libselinux/devel libselinux-rhat.patch, 1.148, 1.149 libselinux.spec, 1.317, 1.318

Daniel J Walsh (dwalsh) fedora-extras-commits at redhat.com
Thu Feb 28 16:58:07 UTC 2008


Author: dwalsh

Update of /cvs/extras/rpms/libselinux/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25924

Modified Files:
	libselinux-rhat.patch libselinux.spec 
Log Message:
* Thu Feb 28 2008 Dan Walsh <dwalsh at redhat.com> - 2.0.57-2
- Reload library on loading of policy to handle chroot


libselinux-rhat.patch:

Index: libselinux-rhat.patch
===================================================================
RCS file: /cvs/extras/rpms/libselinux/devel/libselinux-rhat.patch,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -r1.148 -r1.149
--- libselinux-rhat.patch	22 Feb 2008 17:41:12 -0000	1.148
+++ libselinux-rhat.patch	28 Feb 2008 16:58:02 -0000	1.149
@@ -1,6 +1,23 @@
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.49/src/matchpathcon.c
+diff --exclude-from=exclude -N -u -r nsalibselinux/src/load_policy.c libselinux-2.0.57/src/load_policy.c
+--- nsalibselinux/src/load_policy.c	2008-02-13 11:16:14.000000000 -0500
++++ libselinux-2.0.57/src/load_policy.c	2008-02-28 11:11:20.000000000 -0500
+@@ -308,6 +308,13 @@
+ 	FILE *cfg;
+ 	char *buf;
+ 
++
++	/*
++	  Reinitialize the library, so chroot will work correctly.
++	 */
++	fini_selinux_policyroot();
++	init_selinux_config();
++
+ 	/*
+ 	 * Get desired mode (disabled, permissive, enforcing) from 
+ 	 * /etc/selinux/config. 
+diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.57/src/matchpathcon.c
 --- nsalibselinux/src/matchpathcon.c	2007-09-28 09:48:58.000000000 -0400
-+++ libselinux-2.0.49/src/matchpathcon.c	2008-01-25 10:31:28.000000000 -0500
++++ libselinux-2.0.57/src/matchpathcon.c	2008-02-28 10:50:12.000000000 -0500
 @@ -2,6 +2,7 @@
  #include <string.h>
  #include <errno.h>
@@ -18,3 +35,57 @@
  	va_end(ap);
  }
  
+diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_config.c libselinux-2.0.57/src/selinux_config.c
+--- nsalibselinux/src/selinux_config.c	2007-08-03 16:02:56.000000000 -0400
++++ libselinux-2.0.57/src/selinux_config.c	2008-02-28 11:10:01.000000000 -0500
+@@ -127,9 +127,9 @@
+ static char *selinux_policyroot = NULL;
+ static char *selinux_rootpath = NULL;
+ 
+-static void init_selinux_config(void) __attribute__ ((constructor));
++void init_selinux_config(void) __attribute__ ((constructor));
+ 
+-static void init_selinux_config(void)
++void init_selinux_config(void)
+ {
+ 	int i, *intptr;
+ 	size_t line_len;
+@@ -207,10 +207,11 @@
+ 		    == -1)
+ 			return;
+ }
++hidden_def(init_selinux_config)
+ 
+-static void fini_selinux_policyroot(void) __attribute__ ((destructor));
++void fini_selinux_policyroot(void) __attribute__ ((destructor));
+ 
+-static void fini_selinux_policyroot(void)
++void fini_selinux_policyroot(void)
+ {
+ 	int i;
+ 	free(selinux_policyroot);
+@@ -222,6 +223,7 @@
+ 	free(selinux_policytype);
+ 	selinux_policytype = NULL;
+ }
++hidden_def(fini_selinux_policyroot)
+ 
+ static const char *get_path(int idx)
+ {
+diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_internal.h libselinux-2.0.57/src/selinux_internal.h
+--- nsalibselinux/src/selinux_internal.h	2007-08-03 16:02:56.000000000 -0400
++++ libselinux-2.0.57/src/selinux_internal.h	2008-02-28 11:11:04.000000000 -0500
+@@ -80,6 +80,13 @@
+ hidden_proto(security_get_initial_context);
+ hidden_proto(security_get_initial_context_raw);
+ 
++extern void init_selinux_config(void) hidden;
++extern void fini_selinux_policyroot(void) hidden;
++
++hidden_proto(init_selinux_config);
++hidden_proto(fini_selinux_policyroot);
++
+ extern int load_setlocaldefs hidden;
+ extern int require_seusers hidden;
+ extern int selinux_page_size hidden;
++


Index: libselinux.spec
===================================================================
RCS file: /cvs/extras/rpms/libselinux/devel/libselinux.spec,v
retrieving revision 1.317
retrieving revision 1.318
diff -u -r1.317 -r1.318
--- libselinux.spec	25 Feb 2008 20:51:42 -0000	1.317
+++ libselinux.spec	28 Feb 2008 16:58:02 -0000	1.318
@@ -4,7 +4,7 @@
 Summary: SELinux library and simple utilities
 Name: libselinux
 Version: 2.0.57
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: Public Domain
 Group: System Environment/Libraries
 Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
@@ -137,6 +137,9 @@
 %{python_sitearch}/selinux/*
 
 %changelog
+* Thu Feb 28 2008 Dan Walsh <dwalsh at redhat.com> - 2.0.57-2
+- Reload library on loading of policy to handle chroot
+
 * Mon Feb 25 2008 Dan Walsh <dwalsh at redhat.com> - 2.0.57-1
 - Update to Upstream
 	* Merged avc_has_perm() errno fix from Eamon Walsh.




More information about the fedora-extras-commits mailing list