rpms/libselinux/FC-5 libselinux-rhat.patch, 1.77, 1.78 libselinux.spec, 1.188, 1.189
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Thu Jun 22 15:52:04 UTC 2006
Author: dwalsh
Update of /cvs/dist/rpms/libselinux/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv3762
Modified Files:
libselinux-rhat.patch libselinux.spec
Log Message:
* Thu Jun 22 2006 Dan Walsh <dwalsh at redhat.com> 1.30.3-4.fc5
- Return proper error number on selinux_mnt being undefined
libselinux-rhat.patch:
include/selinux/selinux.h | 3
man/man3/getfscreatecon.3 | 4
man/man3/matchpathcon.3 | 11 ++
man/man8/booleans.8 | 24 +----
src/booleans.c | 2
src/canonicalize_context.c | 8 +
src/check_context.c | 5 +
src/compute_av.c | 8 +
src/compute_create.c | 8 +
src/compute_member.c | 8 +
src/compute_relabel.c | 8 +
src/compute_user.c | 8 +
src/context.c | 8 -
src/disable.c | 5 +
src/enabled.c | 8 +
src/getcon.c | 3
src/getenforce.c | 5 +
src/getexeccon.c | 3
src/getfscreatecon.c | 3
src/getpidcon.c | 3
src/getprevcon.c | 3
src/init.c | 6 -
src/load_policy.c | 5 +
src/matchmediacon.c | 2
src/matchpathcon.c | 27 +++++
src/policyvers.c | 5 +
src/selinux_internal.h | 1
src/selinuxswig.i | 13 ++
src/selinuxswig_wrap.c | 206 ++++++++++++++++++++-------------------------
src/setenforce.c | 5 +
utils/avcstat.c | 18 +--
utils/matchpathcon.c | 1
32 files changed, 253 insertions(+), 174 deletions(-)
Index: libselinux-rhat.patch
===================================================================
RCS file: /cvs/dist/rpms/libselinux/FC-5/libselinux-rhat.patch,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- libselinux-rhat.patch 12 Jun 2006 14:06:05 -0000 1.77
+++ libselinux-rhat.patch 22 Jun 2006 15:52:02 -0000 1.78
@@ -1,244 +1,19 @@
-diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h libselinux-1.30.3/include/selinux/selinux.h
---- nsalibselinux/include/selinux/selinux.h 2006-04-14 07:21:54.000000000 -0400
-+++ libselinux-1.30.3/include/selinux/selinux.h 2006-06-06 13:39:58.000000000 -0400
-@@ -310,6 +310,9 @@
- regexes that have stems that are prefixes of 'prefix'. */
- extern int matchpathcon_init_prefix(const char *path, const char *prefix);
-
-+/* Free the memory allocated by matchpathcon_init. */
-+extern void matchpathcon_fini(void);
-+
- /* Match the specified pathname and mode against the file contexts
- configuration and set *con to refer to the resulting context.
- 'mode' can be 0 to disable mode matching.
-diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/getfscreatecon.3 libselinux-1.30.3/man/man3/getfscreatecon.3
---- nsalibselinux/man/man3/getfscreatecon.3 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/man/man3/getfscreatecon.3 2006-06-06 13:40:32.000000000 -0400
-@@ -32,9 +32,7 @@
- save, reset, and restore the fscreate context to avoid unexpected behaviors.
- .SH "RETURN VALUE"
- On error -1 is returned.
--
--On success getfscreatecon returns the length of the context (not including
--the trailing zero byte). On success setfscreatecon returns 0.
-+On success 0 is returned.
-
- .SH "SEE ALSO"
- .BR freecon "(3), " getcon "(3), " getexeccon "(3)"
-diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/matchpathcon.3 libselinux-1.30.3/man/man3/matchpathcon.3
---- nsalibselinux/man/man3/matchpathcon.3 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/man/man3/matchpathcon.3 2006-06-06 13:40:32.000000000 -0400
-@@ -7,6 +7,8 @@
- .sp
- .BI "int matchpathcon_init(const char *" path ");"
- .br
-+.BI "int matchpathcon_fini(void);"
-+.br
- .BI "int matchpathcon(const char *" path ", mode_t " mode ", security_context_t *" con);
- .sp
- .br
-@@ -40,6 +42,15 @@
- customizations.
- .br
- .sp
-+.B matchpathcon_fini
-+frees the memory allocated by a prior call to
-+.B matchpathcon_init.
-+This function can be used to free and reset the internal state between multiple
-+.B matchpathcon_init
-+calls, or to free memory when finished using
-+.B matchpathcon.
-+.br
-+.sp
- .B matchpathcon
- matches the specified pathname and mode against the file contexts
- configuration and sets the security context
-diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/booleans.8 libselinux-1.30.3/man/man8/booleans.8
---- nsalibselinux/man/man8/booleans.8 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/man/man8/booleans.8 2006-06-06 13:40:45.000000000 -0400
-@@ -17,17 +17,13 @@
- value.
-
- The policy defines a default value for each boolean, typically false.
--These default values can be overridden at boot-time based on the
--settings in the
--.I /etc/selinux/SELINUXTYPE/booleans
--file, where
--SELINUXTYPE is the type of policy currently being run on the system as
--defined in the
--.I /etc/selinux/config
--file. The
-+These default values can be overridden via local settings created via the
-+.B setsebool(8)
-+utility, using -P to make the setting persistent across reboots.
-+The
- .B system-config-securitylevel
--tool provides an interface for altering
--the settings in this file. The
-+tool provides a graphical interface for altering
-+the settings. The
- .B load_policy(8)
- program will preserve
- current boolean settings upon a policy reload by default, or can
-@@ -41,8 +37,9 @@
- .B setsebool(8)
- utility or the
- .B togglesebool
--utility. These utilities only change the
--current boolean value and do not affect the boot-time settings.
-+utility. By default, these utilities only change the
-+current boolean value and do not affect the persistent settings,
-+unless the -P option is used to setsebool.
-
- .SH AUTHOR
- This manual page was written by Dan Walsh <dwalsh at redhat.com>.
-@@ -50,6 +47,3 @@
-
- .SH "SEE ALSO"
- getsebool(8), setsebool(8), selinux(8), togglesebool(8)
--
--.SH FILES
--/etc/selinux/SELINUXTYPE/booleans, /etc/selinux/config
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/booleans.c libselinux-1.30.3/src/booleans.c
---- nsalibselinux/src/booleans.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/booleans.c 2006-06-06 13:41:21.000000000 -0400
-@@ -309,7 +309,7 @@
- int val;
- char boolname[BUFSIZ];
- char *buffer;
-- char *inbuf=NULL;
-+ inbuf=NULL;
- __fsetlocking(boolf, FSETLOCKING_BYCALLER);
- while ((len=getline(&inbuf, &size, boolf)) > 0) {
- buffer=strdup(inbuf);
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/canonicalize_context.c libselinux-1.30.3/src/canonicalize_context.c
---- nsalibselinux/src/canonicalize_context.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/canonicalize_context.c 2006-06-06 13:57:26.000000000 -0400
-@@ -5,7 +5,6 @@
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
- #include <limits.h>
-@@ -18,12 +17,15 @@
- size_t size;
- int fd, ret;
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/context", selinux_mnt);
- fd = open(path, O_RDWR);
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/check_context.c libselinux-1.30.3/src/check_context.c
---- nsalibselinux/src/check_context.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/check_context.c 2006-06-06 13:44:45.000000000 -0400
-@@ -14,6 +14,9 @@
+--- libselinux-1.30.3/src/check_context.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/check_context.c 2006-06-22 11:47:35.000000000 -0400
+@@ -14,6 +14,11 @@
char path[PATH_MAX];
int fd, ret;
-+ if (!selinux_mnt)
++ if (!selinux_mnt) {
++ errno = ENOENT;
+ return -1;
++ }
+
snprintf(path, sizeof path, "%s/context", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/compute_av.c libselinux-1.30.3/src/compute_av.c
---- nsalibselinux/src/compute_av.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/compute_av.c 2006-06-06 13:57:38.000000000 -0400
-@@ -5,7 +5,6 @@
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
- #include <limits.h>
-@@ -21,12 +20,15 @@
- size_t len;
- int fd, ret;
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/access", selinux_mnt);
- fd = open(path, O_RDWR);
- if (fd < 0)
- return -1;
-
-- len = PAGE_SIZE;
-+ len = selinux_page_size;
- buf = malloc(len);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/compute_create.c libselinux-1.30.3/src/compute_create.c
---- nsalibselinux/src/compute_create.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/compute_create.c 2006-06-06 13:57:40.000000000 -0400
-@@ -5,7 +5,6 @@
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
- #include <limits.h>
-@@ -20,12 +19,15 @@
- size_t size;
- int fd, ret;
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/create", selinux_mnt);
- fd = open(path, O_RDWR);
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/compute_member.c libselinux-1.30.3/src/compute_member.c
---- nsalibselinux/src/compute_member.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/compute_member.c 2006-06-06 13:57:44.000000000 -0400
-@@ -5,7 +5,6 @@
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
- #include <limits.h>
-@@ -20,12 +19,15 @@
- size_t size;
- int fd, ret;
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/member", selinux_mnt);
- fd = open(path, O_RDWR);
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/compute_relabel.c libselinux-1.30.3/src/compute_relabel.c
---- nsalibselinux/src/compute_relabel.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/compute_relabel.c 2006-06-06 13:57:46.000000000 -0400
+--- libselinux-1.30.3/src/canonicalize_context.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/canonicalize_context.c 2006-06-22 11:48:08.000000000 -0400
@@ -5,7 +5,6 @@
#include <stdio.h>
#include <errno.h>
@@ -247,42 +22,16 @@
#include "selinux_internal.h"
#include "policy.h"
#include <limits.h>
-@@ -20,12 +19,15 @@
+@@ -18,12 +17,17 @@
size_t size;
int fd, ret;
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/relabel", selinux_mnt);
- fd = open(path, O_RDWR);
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/compute_user.c libselinux-1.30.3/src/compute_user.c
---- nsalibselinux/src/compute_user.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/compute_user.c 2006-06-06 13:57:49.000000000 -0400
-@@ -5,7 +5,6 @@
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
- #include <limits.h>
-@@ -21,12 +20,15 @@
- int fd, ret;
- unsigned int i, nel;
-
-+ if (!selinux_mnt)
++ if (!selinux_mnt) {
++ errno = ENOENT;
+ return -1;
++ }
+
- snprintf(path, sizeof path, "%s/user", selinux_mnt);
+ snprintf(path, sizeof path, "%s/context", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
return -1;
@@ -292,340 +41,8 @@
buf = malloc(size);
if (!buf) {
ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/context.c libselinux-1.30.3/src/context.c
---- nsalibselinux/src/context.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/context.c 2006-06-06 14:14:18.000000000 -0400
-@@ -137,7 +137,7 @@
-
- /* Returns nonzero iff failed */
-
--static int set_comp(context_private_t* n,int index, const char *str)
-+static int set_comp(context_private_t* n,int idx, const char *str)
- {
- char *t = NULL;
- const char *p;
-@@ -146,15 +146,15 @@
- if ( !t ) { return 1; }
- for ( p = str; *p; p++ ) {
- if ( *p == '\t' || *p == '\n' || *p == '\r' ||
-- ((*p == ':' || *p == ' ') && index != COMP_RANGE) ) {
-+ ((*p == ':' || *p == ' ') && idx != COMP_RANGE) ) {
- free(t);
- return 1;
- }
- }
- strcpy(t,str);
- }
-- conditional_free(&n->component[index]);
-- n->component[index] = t;
-+ conditional_free(&n->component[idx]);
-+ n->component[idx] = t;
- return 0;
- }
-
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/disable.c libselinux-1.30.3/src/disable.c
---- nsalibselinux/src/disable.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/disable.c 2006-06-06 13:46:48.000000000 -0400
-@@ -15,6 +15,9 @@
- char path[PATH_MAX];
- char buf[20];
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/disable", selinux_mnt);
- fd = open(path, O_WRONLY);
- if (fd < 0)
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/enabled.c libselinux-1.30.3/src/enabled.c
---- nsalibselinux/src/enabled.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/enabled.c 2006-06-06 13:57:51.000000000 -0400
-@@ -5,7 +5,6 @@
- #include <stdlib.h>
- #include <errno.h>
- #include <limits.h>
--#include <asm/page.h>
- #include <stdio.h>
- #include "policy.h"
-
-@@ -22,7 +21,7 @@
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- enabled = -1;
-@@ -65,6 +64,9 @@
- char buf[20], path[PATH_MAX];
- int fd, ret, enabled = 0;
-
-+ if (!selinux_mnt)
-+ return enabled;
-+
- snprintf(path, sizeof path, "%s/mls", selinux_mnt);
- fd = open(path, O_RDONLY);
- if (fd < 0)
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/getcon.c libselinux-1.30.3/src/getcon.c
---- nsalibselinux/src/getcon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/getcon.c 2006-06-06 13:57:53.000000000 -0400
-@@ -4,7 +4,6 @@
- #include "selinux_internal.h"
- #include <stdlib.h>
- #include <errno.h>
--#include <asm/page.h>
- #include "policy.h"
-
- int getcon_raw(security_context_t *context)
-@@ -18,7 +17,7 @@
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/getenforce.c libselinux-1.30.3/src/getenforce.c
---- nsalibselinux/src/getenforce.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/getenforce.c 2006-06-06 13:47:41.000000000 -0400
-@@ -15,6 +15,9 @@
- char path[PATH_MAX];
- char buf[20];
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/enforce", selinux_mnt);
- fd = open(path, O_RDONLY);
- if (fd < 0)
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/getexeccon.c libselinux-1.30.3/src/getexeccon.c
---- nsalibselinux/src/getexeccon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/getexeccon.c 2006-06-06 13:57:55.000000000 -0400
-@@ -3,7 +3,6 @@
- #include <string.h>
- #include <stdlib.h>
- #include <errno.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
-
-@@ -18,7 +17,7 @@
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/getfscreatecon.c libselinux-1.30.3/src/getfscreatecon.c
---- nsalibselinux/src/getfscreatecon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/getfscreatecon.c 2006-06-06 13:57:58.000000000 -0400
-@@ -3,7 +3,6 @@
- #include <string.h>
- #include <stdlib.h>
- #include <errno.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
-
-@@ -18,7 +17,7 @@
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/getpidcon.c libselinux-1.30.3/src/getpidcon.c
---- nsalibselinux/src/getpidcon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/getpidcon.c 2006-06-06 13:58:00.000000000 -0400
-@@ -4,7 +4,6 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <errno.h>
--#include <asm/page.h>
- #include "selinux_internal.h"
- #include "policy.h"
-
-@@ -22,7 +21,7 @@
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/getprevcon.c libselinux-1.30.3/src/getprevcon.c
---- nsalibselinux/src/getprevcon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/getprevcon.c 2006-06-06 13:58:02.000000000 -0400
-@@ -4,7 +4,6 @@
- #include "selinux_internal.h"
- #include <stdlib.h>
- #include <errno.h>
--#include <asm/page.h>
- #include "policy.h"
-
- int getprevcon_raw(security_context_t *context)
-@@ -18,7 +17,7 @@
- if (fd < 0)
- return -1;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
- buf = malloc(size);
- if (!buf) {
- ret = -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/init.c libselinux-1.30.3/src/init.c
---- nsalibselinux/src/init.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/init.c 2006-06-06 13:58:04.000000000 -0400
-@@ -4,7 +4,6 @@
- #include <stdlib.h>
- #include <errno.h>
- #include <ctype.h>
--#include <asm/page.h>
- #include <stdio.h>
- #include <dlfcn.h>
-
-@@ -13,6 +12,7 @@
- #include "selinux_internal.h"
-
- char *selinux_mnt = NULL;
-+int selinux_page_size=0;
-
- static void init_selinuxmnt(void)
- {
-@@ -27,7 +27,8 @@
- if (!fp)
- return;
-
-- size = PAGE_SIZE;
-+ size = selinux_page_size;
-+
- buf = malloc(size);
- if (!buf)
- goto out;
-@@ -134,6 +135,7 @@
- static void init_lib(void) __attribute__ ((constructor));
- static void init_lib(void)
- {
-+ selinux_page_size = sysconf(_SC_PAGE_SIZE);
- init_selinuxmnt();
- init_translations();
- }
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/load_policy.c libselinux-1.30.3/src/load_policy.c
---- nsalibselinux/src/load_policy.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/load_policy.c 2006-06-06 13:48:12.000000000 -0400
-@@ -20,6 +20,9 @@
- char path[PATH_MAX];
- int fd, ret;
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/load", selinux_mnt);
- fd = open(path, O_RDWR);
- if (fd < 0)
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchmediacon.c libselinux-1.30.3/src/matchmediacon.c
---- nsalibselinux/src/matchmediacon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/matchmediacon.c 2006-06-06 14:16:22.000000000 -0400
-@@ -17,7 +17,7 @@
- const char *path = selinux_media_context_path();
- FILE *infile;
- char *ptr, *ptr2=NULL;
-- int found=-1;
-+ int found=0;
- char current_line[PATH_MAX];
- if ((infile = fopen(path, "r")) == NULL)
- return -1;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-1.30.3/src/matchpathcon.c
---- nsalibselinux/src/matchpathcon.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/matchpathcon.c 2006-06-06 14:18:47.000000000 -0400
-@@ -758,6 +758,33 @@
- return matchpathcon_init_prefix(path, NULL);
- }
-
-+void matchpathcon_fini(void)
-+{
-+ struct spec *spec;
-+ struct stem *stem;
-+ unsigned int i;
-+
-+ for (i = 0; i < nspec; i++) {
-+ spec = &spec_arr[i];
-+ free(spec->regex_str);
-+ free(spec->type_str);
-+ free(spec->context);
-+ regfree(&spec->regex);
-+ }
-+ free(spec_arr);
-+ spec_arr = NULL;
-+ nspec = 0;
-+
-+ for (i = 0; i < (unsigned int)num_stems; i++) {
-+ stem = &stem_arr[i];
-+ free(stem->buf);
-+ }
-+ free(stem_arr);
-+ stem_arr = NULL;
-+ num_stems = 0;
-+ alloc_stems = 0;
-+}
-+
- static int matchpathcon_common(const char *name,
- mode_t mode)
- {
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/policyvers.c libselinux-1.30.3/src/policyvers.c
---- nsalibselinux/src/policyvers.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/policyvers.c 2006-06-06 13:48:37.000000000 -0400
-@@ -19,6 +19,9 @@
- char buf[20];
- unsigned vers = DEFAULT_POLICY_VERSION;
-
-+ if (!selinux_mnt)
-+ return -1;
-+
- snprintf(path, sizeof path, "%s/policyvers", selinux_mnt);
- fd = open(path, O_RDONLY);
- if (fd < 0) {
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_internal.h libselinux-1.30.3/src/selinux_internal.h
---- nsalibselinux/src/selinux_internal.h 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/selinux_internal.h 2006-06-06 13:56:26.000000000 -0400
-@@ -71,3 +71,4 @@
-
- extern int load_setlocaldefs hidden;
- extern int require_seusers hidden;
-+extern int selinux_page_size hidden;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-1.30.3/src/selinuxswig.i
---- nsalibselinux/src/selinuxswig.i 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/selinuxswig.i 2006-06-06 14:19:57.000000000 -0400
-@@ -28,9 +28,18 @@
- %typemap(in, numinputs=0) security_context_t *(security_context_t temp) {
- $1 = &temp;
- }
--%typemap(argout) security_context_t * {
-- $result = SWIG_Python_AppendOutput($result, PyString_FromString(*$1));
-+%typemap(argout) security_context_t * (char *temp) {
-+ if (*$1)
-+ temp = *$1;
-+ else
-+ temp = "";
-+ $result = SWIG_Python_AppendOutput($result, PyString_FromString(temp));
-+}
-+
-+%typemap(in) security_context_t {
-+ $1 = (security_context_t)PyString_AsString($input);
- }
-+
- %typedef unsigned mode_t;
-
- extern int is_selinux_enabled(void);
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libselinux-1.30.3/src/selinuxswig_wrap.c
---- nsalibselinux/src/selinuxswig_wrap.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/selinuxswig_wrap.c 2006-06-06 14:20:22.000000000 -0400
+--- libselinux-1.30.3/src/selinuxswig_wrap.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/selinuxswig_wrap.c 2006-06-22 11:46:36.000000000 -0400
@@ -2832,6 +2832,7 @@
security_context_t *arg1 = (security_context_t *) 0 ;
int result;
@@ -1130,22 +547,600 @@
}
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
return resultobj;
-diff --exclude-from=exclude -N -u -r nsalibselinux/src/setenforce.c libselinux-1.30.3/src/setenforce.c
---- nsalibselinux/src/setenforce.c 2006-04-14 07:21:53.000000000 -0400
-+++ libselinux-1.30.3/src/setenforce.c 2006-06-06 13:39:20.000000000 -0400
-@@ -15,6 +15,9 @@
+--- libselinux-1.30.3/src/disable.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/disable.c 2006-06-22 11:49:00.000000000 -0400
+@@ -15,6 +15,11 @@
char path[PATH_MAX];
char buf[20];
-+ if (!selinux_mnt)
++ if (!selinux_mnt) {
++ errno = ENOENT;
+ return -1;
++ }
+
- snprintf(path, sizeof path, "%s/enforce", selinux_mnt);
- fd = open(path, O_RDWR);
+ snprintf(path, sizeof path, "%s/disable", selinux_mnt);
+ fd = open(path, O_WRONLY);
+ if (fd < 0)
+--- libselinux-1.30.3/src/getpidcon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/getpidcon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -4,7 +4,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+
+@@ -22,7 +21,7 @@
if (fd < 0)
-diff --exclude-from=exclude -N -u -r nsalibselinux/utils/avcstat.c libselinux-1.30.3/utils/avcstat.c
---- nsalibselinux/utils/avcstat.c 2006-04-14 07:21:54.000000000 -0400
-+++ libselinux-1.30.3/utils/avcstat.c 2006-06-06 13:38:42.000000000 -0400
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/booleans.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/booleans.c 2006-06-22 11:46:36.000000000 -0400
+@@ -309,7 +309,7 @@
+ int val;
+ char boolname[BUFSIZ];
+ char *buffer;
+- char *inbuf=NULL;
++ inbuf=NULL;
+ __fsetlocking(boolf, FSETLOCKING_BYCALLER);
+ while ((len=getline(&inbuf, &size, boolf)) > 0) {
+ buffer=strdup(inbuf);
+--- libselinux-1.30.3/src/context.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/context.c 2006-06-22 11:46:36.000000000 -0400
+@@ -137,7 +137,7 @@
+
+ /* Returns nonzero iff failed */
+
+-static int set_comp(context_private_t* n,int index, const char *str)
++static int set_comp(context_private_t* n,int idx, const char *str)
+ {
+ char *t = NULL;
+ const char *p;
+@@ -146,15 +146,15 @@
+ if ( !t ) { return 1; }
+ for ( p = str; *p; p++ ) {
+ if ( *p == '\t' || *p == '\n' || *p == '\r' ||
+- ((*p == ':' || *p == ' ') && index != COMP_RANGE) ) {
++ ((*p == ':' || *p == ' ') && idx != COMP_RANGE) ) {
+ free(t);
+ return 1;
+ }
+ }
+ strcpy(t,str);
+ }
+- conditional_free(&n->component[index]);
+- n->component[index] = t;
++ conditional_free(&n->component[idx]);
++ n->component[idx] = t;
+ return 0;
+ }
+
+--- libselinux-1.30.3/src/getenforce.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/getenforce.c 2006-06-22 11:49:14.000000000 -0400
+@@ -15,6 +15,11 @@
+ char path[PATH_MAX];
+ char buf[20];
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/enforce", selinux_mnt);
+ fd = open(path, O_RDONLY);
+ if (fd < 0)
+--- libselinux-1.30.3/src/selinux_internal.h.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/selinux_internal.h 2006-06-22 11:46:36.000000000 -0400
+@@ -71,3 +71,4 @@
+
+ extern int load_setlocaldefs hidden;
+ extern int require_seusers hidden;
++extern int selinux_page_size hidden;
+--- libselinux-1.30.3/src/matchmediacon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/matchmediacon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -17,7 +17,7 @@
+ const char *path = selinux_media_context_path();
+ FILE *infile;
+ char *ptr, *ptr2=NULL;
+- int found=-1;
++ int found=0;
+ char current_line[PATH_MAX];
+ if ((infile = fopen(path, "r")) == NULL)
+ return -1;
+--- libselinux-1.30.3/src/getfscreatecon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/getfscreatecon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -3,7 +3,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+
+@@ -18,7 +17,7 @@
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/init.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/init.c 2006-06-22 11:46:36.000000000 -0400
+@@ -4,7 +4,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <ctype.h>
+-#include <asm/page.h>
+ #include <stdio.h>
+ #include <dlfcn.h>
+
+@@ -13,6 +12,7 @@
+ #include "selinux_internal.h"
+
+ char *selinux_mnt = NULL;
++int selinux_page_size=0;
+
+ static void init_selinuxmnt(void)
+ {
+@@ -27,7 +27,8 @@
+ if (!fp)
+ return;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
++
+ buf = malloc(size);
+ if (!buf)
+ goto out;
+@@ -134,6 +135,7 @@
+ static void init_lib(void) __attribute__ ((constructor));
+ static void init_lib(void)
+ {
++ selinux_page_size = sysconf(_SC_PAGE_SIZE);
+ init_selinuxmnt();
+ init_translations();
+ }
+--- libselinux-1.30.3/src/setenforce.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/setenforce.c 2006-06-22 11:49:43.000000000 -0400
+@@ -15,6 +15,11 @@
+ char path[PATH_MAX];
+ char buf[20];
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/enforce", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+--- libselinux-1.30.3/src/compute_av.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/compute_av.c 2006-06-22 11:48:19.000000000 -0400
+@@ -5,7 +5,6 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+ #include <limits.h>
+@@ -21,12 +20,17 @@
+ size_t len;
+ int fd, ret;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/access", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+- len = PAGE_SIZE;
++ len = selinux_page_size;
+ buf = malloc(len);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/getcon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/getcon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -4,7 +4,6 @@
+ #include "selinux_internal.h"
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <asm/page.h>
+ #include "policy.h"
+
+ int getcon_raw(security_context_t *context)
+@@ -18,7 +17,7 @@
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/getprevcon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/getprevcon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -4,7 +4,6 @@
+ #include "selinux_internal.h"
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <asm/page.h>
+ #include "policy.h"
+
+ int getprevcon_raw(security_context_t *context)
+@@ -18,7 +17,7 @@
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/selinuxswig.i.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/selinuxswig.i 2006-06-22 11:46:36.000000000 -0400
+@@ -28,9 +28,18 @@
+ %typemap(in, numinputs=0) security_context_t *(security_context_t temp) {
+ $1 = &temp;
+ }
+-%typemap(argout) security_context_t * {
+- $result = SWIG_Python_AppendOutput($result, PyString_FromString(*$1));
++%typemap(argout) security_context_t * (char *temp) {
++ if (*$1)
++ temp = *$1;
++ else
++ temp = "";
++ $result = SWIG_Python_AppendOutput($result, PyString_FromString(temp));
++}
++
++%typemap(in) security_context_t {
++ $1 = (security_context_t)PyString_AsString($input);
+ }
++
+ %typedef unsigned mode_t;
+
+ extern int is_selinux_enabled(void);
+--- libselinux-1.30.3/src/compute_user.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/compute_user.c 2006-06-22 11:48:56.000000000 -0400
+@@ -5,7 +5,6 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+ #include <limits.h>
+@@ -21,12 +20,17 @@
+ int fd, ret;
+ unsigned int i, nel;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/user", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/policyvers.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/policyvers.c 2006-06-22 11:49:36.000000000 -0400
+@@ -19,6 +19,11 @@
+ char buf[20];
+ unsigned vers = DEFAULT_POLICY_VERSION;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/policyvers", selinux_mnt);
+ fd = open(path, O_RDONLY);
+ if (fd < 0) {
+--- libselinux-1.30.3/src/load_policy.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/load_policy.c 2006-06-22 11:49:30.000000000 -0400
+@@ -20,6 +20,11 @@
+ char path[PATH_MAX];
+ int fd, ret;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/load", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+--- libselinux-1.30.3/src/compute_member.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/compute_member.c 2006-06-22 11:48:41.000000000 -0400
+@@ -5,7 +5,6 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+ #include <limits.h>
+@@ -20,12 +19,17 @@
+ size_t size;
+ int fd, ret;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/member", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/getexeccon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/getexeccon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -3,7 +3,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+
+@@ -18,7 +17,7 @@
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/compute_create.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/compute_create.c 2006-06-22 11:48:36.000000000 -0400
+@@ -5,7 +5,6 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+ #include <limits.h>
+@@ -20,12 +19,17 @@
+ size_t size;
+ int fd, ret;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/create", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/src/enabled.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/enabled.c 2006-06-22 11:49:10.000000000 -0400
+@@ -5,7 +5,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <limits.h>
+-#include <asm/page.h>
+ #include <stdio.h>
+ #include "policy.h"
+
+@@ -22,7 +21,7 @@
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ enabled = -1;
+@@ -65,6 +64,11 @@
+ char buf[20], path[PATH_MAX];
+ int fd, ret, enabled = 0;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/mls", selinux_mnt);
+ fd = open(path, O_RDONLY);
+ if (fd < 0)
+--- libselinux-1.30.3/src/matchpathcon.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/matchpathcon.c 2006-06-22 11:46:36.000000000 -0400
+@@ -758,6 +758,33 @@
+ return matchpathcon_init_prefix(path, NULL);
+ }
+
++void matchpathcon_fini(void)
++{
++ struct spec *spec;
++ struct stem *stem;
++ unsigned int i;
++
++ for (i = 0; i < nspec; i++) {
++ spec = &spec_arr[i];
++ free(spec->regex_str);
++ free(spec->type_str);
++ free(spec->context);
++ regfree(&spec->regex);
++ }
++ free(spec_arr);
++ spec_arr = NULL;
++ nspec = 0;
++
++ for (i = 0; i < (unsigned int)num_stems; i++) {
++ stem = &stem_arr[i];
++ free(stem->buf);
++ }
++ free(stem_arr);
++ stem_arr = NULL;
++ num_stems = 0;
++ alloc_stems = 0;
++}
++
+ static int matchpathcon_common(const char *name,
+ mode_t mode)
+ {
+--- libselinux-1.30.3/src/compute_relabel.c.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/src/compute_relabel.c 2006-06-22 11:48:46.000000000 -0400
+@@ -5,7 +5,6 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <asm/page.h>
+ #include "selinux_internal.h"
+ #include "policy.h"
+ #include <limits.h>
+@@ -20,12 +19,17 @@
+ size_t size;
+ int fd, ret;
+
++ if (!selinux_mnt) {
++ errno = ENOENT;
++ return -1;
++ }
++
+ snprintf(path, sizeof path, "%s/relabel", selinux_mnt);
+ fd = open(path, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+- size = PAGE_SIZE;
++ size = selinux_page_size;
+ buf = malloc(size);
+ if (!buf) {
+ ret = -1;
+--- libselinux-1.30.3/man/man8/booleans.8.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/man/man8/booleans.8 2006-06-22 11:46:36.000000000 -0400
+@@ -17,17 +17,13 @@
+ value.
+
+ The policy defines a default value for each boolean, typically false.
+-These default values can be overridden at boot-time based on the
+-settings in the
+-.I /etc/selinux/SELINUXTYPE/booleans
+-file, where
+-SELINUXTYPE is the type of policy currently being run on the system as
+-defined in the
+-.I /etc/selinux/config
+-file. The
++These default values can be overridden via local settings created via the
++.B setsebool(8)
++utility, using -P to make the setting persistent across reboots.
++The
+ .B system-config-securitylevel
+-tool provides an interface for altering
+-the settings in this file. The
++tool provides a graphical interface for altering
++the settings. The
+ .B load_policy(8)
+ program will preserve
+ current boolean settings upon a policy reload by default, or can
+@@ -41,8 +37,9 @@
+ .B setsebool(8)
+ utility or the
+ .B togglesebool
+-utility. These utilities only change the
+-current boolean value and do not affect the boot-time settings.
++utility. By default, these utilities only change the
++current boolean value and do not affect the persistent settings,
++unless the -P option is used to setsebool.
+
+ .SH AUTHOR
+ This manual page was written by Dan Walsh <dwalsh at redhat.com>.
+@@ -50,6 +47,3 @@
+
+ .SH "SEE ALSO"
+ getsebool(8), setsebool(8), selinux(8), togglesebool(8)
+-
+-.SH FILES
+-/etc/selinux/SELINUXTYPE/booleans, /etc/selinux/config
+--- libselinux-1.30.3/man/man3/getfscreatecon.3.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/man/man3/getfscreatecon.3 2006-06-22 11:46:36.000000000 -0400
+@@ -32,9 +32,7 @@
+ save, reset, and restore the fscreate context to avoid unexpected behaviors.
+ .SH "RETURN VALUE"
+ On error -1 is returned.
+-
+-On success getfscreatecon returns the length of the context (not including
+-the trailing zero byte). On success setfscreatecon returns 0.
++On success 0 is returned.
+
+ .SH "SEE ALSO"
+ .BR freecon "(3), " getcon "(3), " getexeccon "(3)"
+--- libselinux-1.30.3/man/man3/matchpathcon.3.rhat 2006-04-14 07:21:53.000000000 -0400
++++ libselinux-1.30.3/man/man3/matchpathcon.3 2006-06-22 11:46:36.000000000 -0400
+@@ -7,6 +7,8 @@
+ .sp
+ .BI "int matchpathcon_init(const char *" path ");"
+ .br
++.BI "int matchpathcon_fini(void);"
++.br
+ .BI "int matchpathcon(const char *" path ", mode_t " mode ", security_context_t *" con);
+ .sp
+ .br
+@@ -40,6 +42,15 @@
+ customizations.
+ .br
+ .sp
++.B matchpathcon_fini
++frees the memory allocated by a prior call to
++.B matchpathcon_init.
++This function can be used to free and reset the internal state between multiple
++.B matchpathcon_init
++calls, or to free memory when finished using
++.B matchpathcon.
++.br
++.sp
+ .B matchpathcon
+ matches the specified pathname and mode against the file contexts
+ configuration and sets the security context
+--- libselinux-1.30.3/include/selinux/selinux.h.rhat 2006-04-14 07:21:54.000000000 -0400
++++ libselinux-1.30.3/include/selinux/selinux.h 2006-06-22 11:46:36.000000000 -0400
+@@ -310,6 +310,9 @@
+ regexes that have stems that are prefixes of 'prefix'. */
+ extern int matchpathcon_init_prefix(const char *path, const char *prefix);
+
++/* Free the memory allocated by matchpathcon_init. */
++extern void matchpathcon_fini(void);
++
+ /* Match the specified pathname and mode against the file contexts
+ configuration and set *con to refer to the resulting context.
+ 'mode' can be 0 to disable mode matching.
+--- libselinux-1.30.3/utils/avcstat.c.rhat 2006-04-14 07:21:54.000000000 -0400
++++ libselinux-1.30.3/utils/avcstat.c 2006-06-22 11:46:36.000000000 -0400
@@ -27,12 +27,12 @@
#define HEADERS "lookups hits misses allocations reclaims frees"
@@ -1192,9 +1187,8 @@
rel.lookups, rel.hits, rel.misses,
rel.allocations, rel.reclaims, rel.frees);
}
-diff --exclude-from=exclude -N -u -r nsalibselinux/utils/matchpathcon.c libselinux-1.30.3/utils/matchpathcon.c
---- nsalibselinux/utils/matchpathcon.c 2006-04-14 07:21:54.000000000 -0400
-+++ libselinux-1.30.3/utils/matchpathcon.c 2006-06-06 13:38:19.000000000 -0400
+--- libselinux-1.30.3/utils/matchpathcon.c.rhat 2006-04-14 07:21:54.000000000 -0400
++++ libselinux-1.30.3/utils/matchpathcon.c 2006-06-22 11:46:36.000000000 -0400
@@ -66,5 +66,6 @@
freecon(buf);
Index: libselinux.spec
===================================================================
RCS file: /cvs/dist/rpms/libselinux/FC-5/libselinux.spec,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -r1.188 -r1.189
--- libselinux.spec 8 Jun 2006 16:44:30 -0000 1.188
+++ libselinux.spec 22 Jun 2006 15:52:02 -0000 1.189
@@ -3,7 +3,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 1.30.3
-Release: 3.fc5
+Release: 4.fc5
License: Public domain (uncopyrighted)
Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
@@ -116,6 +116,9 @@
%{_libdir}/python*/site-packages/selinux.py*
%changelog
+* Thu Jun 22 2006 Dan Walsh <dwalsh at redhat.com> 1.30.3-4.fc5
+- Return proper error number on selinux_mnt being undefined
+
* Thu Jun 8 2006 Dan Walsh <dwalsh at redhat.com> 1.30.3-3.fc5
- Apply patch this time...
More information about the fedora-cvs-commits
mailing list