rpms/libsepol/devel libsepol-rhat.patch, 1.3, 1.4 libsepol.spec, 1.25, 1.26

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Apr 25 19:35:37 UTC 2005


Author: dwalsh

Update of /cvs/dist/rpms/libsepol/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv18831

Modified Files:
	libsepol-rhat.patch libsepol.spec 
Log Message:
* Mon Apr 25 2005 Dan Walsh <dwalsh at redhat.com> 1.5.5-2
- Fixes found via intel compiler


libsepol-rhat.patch:
 genbools.c  |    2 +-
 hierarchy.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: libsepol-rhat.patch
===================================================================
RCS file: /cvs/dist/rpms/libsepol/devel/libsepol-rhat.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- libsepol-rhat.patch	29 Mar 2005 15:39:54 -0000	1.3
+++ libsepol-rhat.patch	25 Apr 2005 19:35:34 -0000	1.4
@@ -1,110 +1,24 @@
-diff --exclude-from=exclude -N -u -r nsalibsepol/src/genbools.c libsepol-1.5.2/src/genbools.c
---- nsalibsepol/src/genbools.c	2005-03-08 15:15:26.000000000 -0500
-+++ libsepol-1.5.2/src/genbools.c	2005-03-29 10:20:54.000000000 -0500
-@@ -24,11 +24,40 @@
- 	return dest;
- }
- 
-+static int process_boolean(char *buffer, char *name, int namesize, int *val) {
-+	char name1[BUFSIZ];
-+	char *ptr;
-+	char *tok=strtok_r(buffer,"=",&ptr);
-+	if (tok) {
-+		strncpy(name1,tok, BUFSIZ-1);
-+		strtrim(name,name1,namesize-1);
-+		if ( name[0]=='#' ) return 0;
-+		tok=strtok_r(NULL,"\0",&ptr);
-+		if (tok) {
-+			while (isspace(*tok)) tok++;
-+			*val = -1;
-+			if (isdigit(tok[0]))
-+				*val=atoi(tok);
-+			else if (!strncmp(tok, "true", sizeof("true")-1))
-+				*val = 1;
-+			else if (!strncmp(tok, "false", sizeof("false")-1))
-+				*val = 0;
-+			if (*val != 0 && *val != 1) {
-+				fprintf(stderr,"illegal value for boolean %s=%s\n", name, tok);
-+				return -1;
-+			}
-+			
-+		}
-+	}
-+	return 1;
-+}
-+
- static int load_booleans(struct policydb *policydb, char *path) {
- 	FILE *boolf;
--	char buffer[BUFSIZ];
-+	char *buffer=NULL;
-+	size_t size=0;
-+	char localbools[BUFSIZ];
- 	char name[BUFSIZ];
--	char name1[BUFSIZ];
- 	int val;
- 	int errors=0;
- 	struct cond_bool_datum *datum;
-@@ -37,28 +66,29 @@
- 	if (boolf == NULL) 
- 		return -1;
- 
--        while (fgets(buffer, sizeof(buffer), boolf)) {
--		char *tok=strtok(buffer,"=");
--		if (tok) {
--			strncpy(name1,tok, BUFSIZ-1);
--			strtrim(name,name1,BUFSIZ-1);
--			if ( name[0]=='#' ) continue;
--			tok=strtok(NULL,"\0");
--			if (tok) {
--				while (isspace(*tok)) tok++;
--				val = -1;
--				if (isdigit(tok[0]))
--					val=atoi(tok);
--				else if (!strncasecmp(tok, "true", sizeof("true")-1))
--					val = 1;
--				else if (!strncasecmp(tok, "false", sizeof("false")-1))
--					val = 0;
--				if (val != 0 && val != 1) {
--					fprintf(stderr,"illegal value for boolean %s=%s\n", name, tok);
--					errors++;
--					continue;
--				}
--
-+	while (getline(&buffer, &size, boolf) > 0) {
-+		int ret=process_boolean(buffer, name, sizeof(name), &val);
-+		if (ret==-1) 
-+			errors++;
-+		if (ret==1) {
-+			datum = hashtab_search(policydb->p_bools.table, name);
-+			if (!datum) {
-+				fprintf(stderr,"unknown boolean %s\n", name);
-+				errors++;
-+				continue;
-+			}
-+			datum->state = val;
-+		}
-+	}
-+	fclose(boolf);
-+	snprintf(localbools,sizeof(localbools), "%s.local", path);
-+	boolf = fopen(localbools,"r");
-+	if (boolf != NULL) {
-+		while (getline(&buffer, &size, boolf) > 0) {
-+			int ret=process_boolean(buffer, name, sizeof(name), &val);
-+			if (ret==-1) 
-+				errors++;
-+			if (ret==1) {
- 				datum = hashtab_search(policydb->p_bools.table, name);
- 				if (!datum) {
- 					fprintf(stderr,"unknown boolean %s\n", name);
-@@ -68,9 +98,9 @@
- 				datum->state = val;
- 			}
- 		}
-+		fclose(boolf);
+diff --exclude-from=exclude -N -u -r nsalibsepol/src/genbools.c libsepol-1.5.5/src/genbools.c
+--- nsalibsepol/src/genbools.c	2005-03-29 21:55:26.000000000 -0500
++++ libsepol-1.5.5/src/genbools.c	2005-04-25 15:25:55.000000000 -0400
+@@ -195,7 +195,7 @@
  	}
--	fclose(boolf);
--
-+	free(buffer);
- 	if (errors)
+ 
+ 	if (evaluate_conds(&policydb) < 0) {
+-		__sepol_debug_printf("%s:  Error while re-evaluating conditionals: %s\n",
++		__sepol_debug_printf("%s: Error while re-evaluating conditionals\n",
+ 				     __FUNCTION__);
  		errno = EINVAL;
+ 		goto err;
+diff --exclude-from=exclude -N -u -r nsalibsepol/src/hierarchy.c libsepol-1.5.5/src/hierarchy.c
+--- nsalibsepol/src/hierarchy.c	2005-04-14 08:28:00.000000000 -0400
++++ libsepol-1.5.5/src/hierarchy.c	2005-04-25 15:21:51.000000000 -0400
+@@ -269,7 +269,7 @@
+ 	char *parent;
+ 	hierarchy_args_t *a;
+ 	role_datum_t *r, *rp;
+-	ebitmap_t *eb;
++	ebitmap_t *eb=NULL;
  
+ 	a = (hierarchy_args_t *)args;
+ 	r = (role_datum_t *)d;


Index: libsepol.spec
===================================================================
RCS file: /cvs/dist/rpms/libsepol/devel/libsepol.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- libsepol.spec	14 Apr 2005 20:28:43 -0000	1.25
+++ libsepol.spec	25 Apr 2005 19:35:34 -0000	1.26
@@ -1,10 +1,11 @@
 Summary: SELinux binary policy manipulation library 
 Name: libsepol
 Version: 1.5.5
-Release: 1
+Release: 2
 License: GPL
 Group: System Environment/Libraries
 Source: http://www.nsa.gov/selinux/archives/libsepol-%{version}.tgz
+Patch: libsepol-rhat.patch
 Prefix: %{_prefix}
 BuildRoot: %{_tmppath}/%{name}-buildroot
 Provides: libsepol.so
@@ -36,6 +37,7 @@
 
 %prep
 %setup -q
+%Patch -p1 -b .rhat
 
 %build
 make CFLAGS="%{optflags}"
@@ -71,6 +73,9 @@
 /%{_lib}/libsepol.so.1
 
 %changelog
+* Mon Apr 25 2005 Dan Walsh <dwalsh at redhat.com> 1.5.5-2
+- Fixes found via intel compiler
+
 * Thu Apr 14 2005 Dan Walsh <dwalsh at redhat.com> 1.5.5-1
 - Update from NSA
 




More information about the fedora-cvs-commits mailing list