psss / rpms / libselinux

Forked from rpms/libselinux 5 years ago
Clone
1f46a5f
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 libselinux-2.0.90/man/man8/selinuxconlist.8
792921f
--- nsalibselinux/man/man8/selinuxconlist.8	1969-12-31 19:00:00.000000000 -0500
de078cb
+++ libselinux-2.0.90/man/man8/selinuxconlist.8	2010-01-18 16:52:28.000000000 -0500
792921f
@@ -0,0 +1,18 @@
792921f
+.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
792921f
+.SH "NAME"
792921f
+selinuxconlist \- list all SELinux context reachable for user
792921f
+.SH "SYNOPSIS"
792921f
+.B selinuxconlist [-l level] user [context]
792921f
+
792921f
+.SH "DESCRIPTION"
792921f
+.B selinuxconlist
792921f
+reports the list of context reachable for user from the current context or specified context
792921f
+
792921f
+.B \-l level
792921f
+mcs/mls level
792921f
+
792921f
+.SH AUTHOR	
792921f
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
792921f
+
792921f
+.SH "SEE ALSO"
792921f
+secon(8), selinuxdefcon(8)
1f46a5f
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libselinux-2.0.90/man/man8/selinuxdefcon.8
792921f
--- nsalibselinux/man/man8/selinuxdefcon.8	1969-12-31 19:00:00.000000000 -0500
de078cb
+++ libselinux-2.0.90/man/man8/selinuxdefcon.8	2010-01-18 16:52:28.000000000 -0500
4ed79e3
@@ -0,0 +1,24 @@
792921f
+.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
792921f
+.SH "NAME"
4ed79e3
+selinuxdefcon \- report default SELinux context for user 
792921f
+
792921f
+.SH "SYNOPSIS"
995afc0
+.B selinuxdefcon [-l level] user fromcon
792921f
+
792921f
+.SH "DESCRIPTION"
4ed79e3
+.B selinuxdefcon
995afc0
+reports the default context for the specified user from the specified context
792921f
+
792921f
+.B \-l level
792921f
+mcs/mls level
792921f
+
4ed79e3
+.SH EXAMPLE
4ed79e3
+# selinuxdefcon jsmith system_u:system_r:sshd_t:s0
4ed79e3
+.br
4ed79e3
+unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
4ed79e3
+
792921f
+.SH AUTHOR	
792921f
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
792921f
+
792921f
+.SH "SEE ALSO"
792921f
+secon(8), selinuxconlist(8)
1f46a5f
diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2.0.90/src/callbacks.c
fa62185
--- nsalibselinux/src/callbacks.c	2009-04-08 09:06:23.000000000 -0400
de078cb
+++ libselinux-2.0.90/src/callbacks.c	2010-01-18 16:52:28.000000000 -0500
d0a06b2
@@ -16,6 +16,7 @@
ee77868
 {
d0a06b2
 	int rc;
d0a06b2
 	va_list ap;
d0a06b2
+	if (is_selinux_enabled() == 0) return 0;
d0a06b2
 	va_start(ap, fmt);
d0a06b2
 	rc = vfprintf(stderr, fmt, ap);
d0a06b2
 	va_end(ap);
1f46a5f
diff --exclude-from=exclude -N -u -r nsalibselinux/src/init.c libselinux-2.0.90/src/init.c
1f46a5f
--- nsalibselinux/src/init.c	2009-07-14 11:16:03.000000000 -0400
3b1c3d5
+++ libselinux-2.0.90/src/init.c	2010-01-18 16:56:16.000000000 -0500
3b1c3d5
@@ -23,7 +23,7 @@
3b1c3d5
 static void init_selinuxmnt(void)
3b1c3d5
 {
3b1c3d5
 	char *buf=NULL, *p;
3b1c3d5
-	FILE *fp;
3b1c3d5
+	FILE *fp=NULL;
3b1c3d5
 	struct statfs sfbuf;
3b1c3d5
 	int rc;
3b1c3d5
 	size_t len;
3b1c3d5
@@ -59,14 +59,14 @@
1f46a5f
 	}
1f46a5f
 	fclose(fp);
1f46a5f
 
1f46a5f
-	if (!exists)
3b1c3d5
-		return;
3b1c3d5
+	if (!exists) 
3b1c3d5
+		goto out;
1f46a5f
 
1f46a5f
 	/* At this point, the usual spot doesn't have an selinuxfs so
1f46a5f
 	 * we look around for it */
3b1c3d5
 	fp = fopen("/proc/mounts", "r");
3b1c3d5
 	if (!fp)
3b1c3d5
-		return;
3b1c3d5
+		goto out;
3b1c3d5
 
3b1c3d5
 	__fsetlocking(fp, FSETLOCKING_BYCALLER);
3b1c3d5
 	while ((num = getline(&buf, &len, fp)) != -1) {
3b1c3d5
@@ -90,7 +90,8 @@
3b1c3d5
 
3b1c3d5
       out:
3b1c3d5
 	free(buf);
3b1c3d5
-	fclose(fp);
3b1c3d5
+	if (fp)
3b1c3d5
+		fclose(fp);
3b1c3d5
 	return;
3b1c3d5
 }
3b1c3d5
 
de078cb
diff --exclude-from=exclude -N -u -r nsalibselinux/src/label_file.c libselinux-2.0.90/src/label_file.c
de078cb
--- nsalibselinux/src/label_file.c	2009-05-18 13:53:14.000000000 -0400
de078cb
+++ libselinux-2.0.90/src/label_file.c	2010-01-18 16:53:54.000000000 -0500
de078cb
@@ -20,6 +20,9 @@
de078cb
 #include "callbacks.h"
de078cb
 #include "label_internal.h"
de078cb
 
de078cb
+#include <sys/types.h>
de078cb
+#include <sys/stat.h>
de078cb
+
de078cb
 /*
de078cb
  * Internals, mostly moved over from matchpathcon.c
de078cb
  */
3b1c3d5
diff --exclude-from=exclude -N -u -r nsalibselinux/src/libselinux.pc.in libselinux-2.0.90/src/libselinux.pc.in
3b1c3d5
--- nsalibselinux/src/libselinux.pc.in	2009-11-02 12:58:30.000000000 -0500
3b1c3d5
+++ libselinux-2.0.90/src/libselinux.pc.in	2010-02-18 10:02:46.000000000 -0500
3b1c3d5
@@ -1,6 +1,6 @@
3b1c3d5
 prefix=@prefix@
3b1c3d5
 exec_prefix=${prefix}
3b1c3d5
-libdir=${exec_prefix}/lib
3b1c3d5
+libdir=${exec_prefix}/@libdir@
3b1c3d5
 includedir=@includedir@
3b1c3d5
 
3b1c3d5
 Name: libselinux
3b1c3d5
diff --exclude-from=exclude -N -u -r nsalibselinux/src/Makefile libselinux-2.0.90/src/Makefile
3b1c3d5
--- nsalibselinux/src/Makefile	2009-12-01 15:46:50.000000000 -0500
3b1c3d5
+++ libselinux-2.0.90/src/Makefile	2010-02-18 10:04:21.000000000 -0500
3b1c3d5
@@ -11,6 +11,7 @@
3b1c3d5
 RUBYPLATFORM ?= $(shell ruby -e 'print RUBY_PLATFORM')
3b1c3d5
 RUBYINC ?= $(LIBDIR)/ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
3b1c3d5
 RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
3b1c3d5
+LIBBASE=$(shell basename $(LIBDIR))
3b1c3d5
 
3b1c3d5
 VERSION = $(shell cat ../VERSION)
3b1c3d5
 LIBVERSION = 1
3b1c3d5
@@ -85,7 +86,7 @@
3b1c3d5
 	ln -sf $@ $(TARGET) 
3b1c3d5
 
3b1c3d5
 $(LIBPC): $(LIBPC).in
3b1c3d5
-	sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
3b1c3d5
+	sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
3b1c3d5
 
3b1c3d5
 selinuxswig_python_exception.i: ../include/selinux/selinux.h
3b1c3d5
 	bash exception.sh > $@ 
1f46a5f
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.90/src/matchpathcon.c
fa62185
--- nsalibselinux/src/matchpathcon.c	2009-03-06 14:41:45.000000000 -0500
de078cb
+++ libselinux-2.0.90/src/matchpathcon.c	2010-01-18 16:52:28.000000000 -0500
974a6e4
@@ -2,6 +2,7 @@
974a6e4
 #include <string.h>
974a6e4
 #include <errno.h>
974a6e4
 #include <stdio.h>
974a6e4
+#include <syslog.h>
974a6e4
 #include "selinux_internal.h"
974a6e4
 #include "label_internal.h"
974a6e4
 #include "callbacks.h"
974a6e4
@@ -57,7 +58,7 @@
974a6e4
 {
974a6e4
 	va_list ap;
974a6e4
 	va_start(ap, fmt);
974a6e4
-	vfprintf(stderr, fmt, ap);
974a6e4
+	vsyslog(LOG_ERR, fmt, ap);
974a6e4
 	va_end(ap);
974a6e4
 }
b5b41bc