62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h libselinux-2.0.78/include/selinux/selinux.h
62b730
--- nsalibselinux/include/selinux/selinux.h	2009-03-06 14:41:44.000000000 -0500
62b730
+++ libselinux-2.0.78/include/selinux/selinux.h	2009-03-06 16:27:32.000000000 -0500
62b730
@@ -457,8 +457,11 @@
62b730
 extern const char *selinux_file_context_path(void);
62b730
 extern const char *selinux_file_context_homedir_path(void);
f56f78
 extern const char *selinux_file_context_local_path(void);
62b730
+extern const char *selinux_file_context_subs_path(void);
f56f78
 extern const char *selinux_homedir_context_path(void);
f56f78
 extern const char *selinux_media_context_path(void);
f56f78
+extern const char *selinux_virtual_domain_context_path(void);
f56f78
+extern const char *selinux_virtual_image_context_path(void);
f56f78
 extern const char *selinux_x_context_path(void);
f56f78
 extern const char *selinux_contexts_path(void);
f56f78
 extern const char *selinux_securetty_types_path(void);
62b730
@@ -520,6 +523,14 @@
3cc598
    Caller must free the returned strings via free. */
3cc598
 extern int getseuserbyname(const char *linuxuser, char **seuser, char **level);
3cc598
 
3cc598
+/* Get the SELinux username and level to use for a given Linux username and service. 
3cc598
+   These values may then be passed into the get_ordered_context_list*
3cc598
+   and get_default_context* functions to obtain a context for the user.
3cc598
+   Returns 0 on success or -1 otherwise.
3cc598
+   Caller must free the returned strings via free. */
3cc598
+extern int getseuser(const char *username, const char *service, 
3cc598
+		     char **r_seuser, char **r_level);
3cc598
+
3cc598
 /* Compare two file contexts, return 0 if equivalent. */
3cc598
 int selinux_file_context_cmp(const security_context_t a,
3cc598
 			     const security_context_t b);
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 libselinux-2.0.78/man/man8/selinuxconlist.8
6137b9
--- nsalibselinux/man/man8/selinuxconlist.8	1969-12-31 19:00:00.000000000 -0500
62b730
+++ libselinux-2.0.78/man/man8/selinuxconlist.8	2009-03-06 16:27:32.000000000 -0500
6137b9
@@ -0,0 +1,18 @@
6137b9
+.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
6137b9
+.SH "NAME"
6137b9
+selinuxconlist \- list all SELinux context reachable for user
6137b9
+.SH "SYNOPSIS"
6137b9
+.B selinuxconlist [-l level] user [context]
6137b9
+
6137b9
+.SH "DESCRIPTION"
6137b9
+.B selinuxconlist
6137b9
+reports the list of context reachable for user from the current context or specified context
6137b9
+
6137b9
+.B \-l level
6137b9
+mcs/mls level
6137b9
+
6137b9
+.SH AUTHOR	
6137b9
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
6137b9
+
6137b9
+.SH "SEE ALSO"
6137b9
+secon(8), selinuxdefcon(8)
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libselinux-2.0.78/man/man8/selinuxdefcon.8
6137b9
--- nsalibselinux/man/man8/selinuxdefcon.8	1969-12-31 19:00:00.000000000 -0500
62b730
+++ libselinux-2.0.78/man/man8/selinuxdefcon.8	2009-03-06 16:27:32.000000000 -0500
6137b9
@@ -0,0 +1,19 @@
6137b9
+.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
6137b9
+.SH "NAME"
6137b9
+selinuxdefcon \- list default SELinux context for user 
6137b9
+
6137b9
+.SH "SYNOPSIS"
6137b9
+.B selinuxdefcon [-l level] user [fromcon]
6137b9
+
6137b9
+.SH "DESCRIPTION"
6137b9
+.B seconlist
6137b9
+reports the default context for the specified user from current context or specified context
6137b9
+
6137b9
+.B \-l level
6137b9
+mcs/mls level
6137b9
+
6137b9
+.SH AUTHOR	
6137b9
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
6137b9
+
6137b9
+.SH "SEE ALSO"
6137b9
+secon(8), selinuxconlist(8)
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2.0.78/src/callbacks.c
62b730
--- nsalibselinux/src/callbacks.c	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/callbacks.c	2009-03-06 16:27:32.000000000 -0500
94f8e1
@@ -16,6 +16,7 @@
88ff8b
 {
94f8e1
 	int rc;
94f8e1
 	va_list ap;
94f8e1
+	if (is_selinux_enabled() == 0) return 0;
94f8e1
 	va_start(ap, fmt);
94f8e1
 	rc = vfprintf(stderr, fmt, ap);
94f8e1
 	va_end(ap);
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/file_path_suffixes.h libselinux-2.0.78/src/file_path_suffixes.h
62b730
--- nsalibselinux/src/file_path_suffixes.h	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/file_path_suffixes.h	2009-03-06 16:27:32.000000000 -0500
62b730
@@ -20,3 +20,6 @@
f56f78
     S_(FILE_CONTEXTS_LOCAL, "/contexts/files/file_contexts.local")
f56f78
     S_(X_CONTEXTS, "/contexts/x_contexts")
f56f78
     S_(COLORS, "/secolor.conf")
6baaba
+    S_(VIRTUAL_DOMAIN, "/contexts/virtual_domain_context")
6baaba
+    S_(VIRTUAL_IMAGE, "/contexts/virtual_image_context")
62b730
+    S_(FILE_CONTEXT_SUBS, "/contexts/files/file_contexts.subs")
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/label.c libselinux-2.0.78/src/label.c
62b730
--- nsalibselinux/src/label.c	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/label.c	2009-03-06 16:27:32.000000000 -0500
62b730
@@ -5,10 +5,12 @@
62b730
  */
62b730
 
62b730
 #include <sys/types.h>
62b730
+#include <ctype.h>
62b730
 #include <errno.h>
62b730
 #include <stdio.h>
62b730
 #include <stdlib.h>
62b730
 #include <string.h>
62b730
+#include <selinux/selinux.h>
62b730
 #include "callbacks.h"
62b730
 #include "label_internal.h"
62b730
 
62b730
@@ -23,6 +25,96 @@
62b730
 	&selabel_x_init
62b730
 };
62b730
 
62b730
+typedef struct selabel_sub {
62b730
+	char *src;
62b730
+	int slen;
62b730
+	char *dst;
62b730
+	struct selabel_sub *next;
62b730
+} SELABELSUB;
62b730
+
62b730
+SELABELSUB *selabelsublist = NULL;
62b730
+
62b730
+static void selabel_subs_fini(void)
62b730
+{
62b730
+	SELABELSUB *ptr = selabelsublist;
62b730
+	SELABELSUB *next = NULL;
62b730
+	while (ptr) {
62b730
+		next = ptr->next;
62b730
+		free(ptr->src);
62b730
+		free(ptr->dst);
62b730
+		free(ptr);
62b730
+		ptr = next;
62b730
+	}
62b730
+	selabelsublist = NULL;
62b730
+}
62b730
+
62b730
+static char *selabel_sub(const char *src) 
62b730
+{
62b730
+	char *dst = NULL;
62b730
+	SELABELSUB *ptr = selabelsublist;
62b730
+	while (ptr) {
62b730
+		if (strncmp(src, ptr->src, ptr->slen) == 0 ) {
62b730
+			if (src[ptr->slen] == '/' || 
62b730
+			    src[ptr->slen] == 0) {
62b730
+				asprintf(&dst, "%s%s", ptr->dst, &src[ptr->slen]);
62b730
+				return dst;
62b730
+			}
62b730
+		}
62b730
+		ptr = ptr->next;
62b730
+	}
62b730
+	return NULL;
62b730
+}
62b730
+
62b730
+static int selabel_subs_init(void)
62b730
+{
62b730
+	char buf[1024];
62b730
+	FILE *cfg = fopen(selinux_file_context_subs_path(), "r");
62b730
+	if (cfg) {
62b730
+		while (fgets_unlocked(buf, sizeof(buf) - 1, cfg)) {
62b730
+			char *ptr = NULL;
62b730
+			char *src = buf;
62b730
+			char *dst = NULL;
62b730
+
62b730
+			while (*src && isspace(*src))
62b730
+				src++;
62b730
+			if (src[0] == '#') continue;
62b730
+			ptr = src;
62b730
+			while (*ptr && ! isspace(*ptr))
62b730
+				ptr++;
62b730
+			*ptr++ = 0;
62b730
+			if (! *src) continue;
62b730
+
62b730
+			dst = ptr;
62b730
+			while (*dst && isspace(*dst))
62b730
+				dst++;
62b730
+			ptr=dst;
62b730
+			while (*ptr && ! isspace(*ptr))
62b730
+				ptr++;
62b730
+			*ptr=0;
62b730
+			if (! *dst) continue;
62b730
+
62b730
+			SELABELSUB *sub = (SELABELSUB*) malloc(sizeof(SELABELSUB));
62b730
+			if (! sub) return -1;
62b730
+			sub->src=strdup(src);
62b730
+			if (! sub->src) {
62b730
+				free(sub);
62b730
+				return -1;
62b730
+			}
62b730
+			sub->dst=strdup(dst);
62b730
+			if (! sub->dst) {
62b730
+				free(sub);
62b730
+				free(sub->src);
62b730
+				return -1;
62b730
+			}
62b730
+			sub->slen = strlen(src);
62b730
+			sub->next = selabelsublist;
62b730
+			selabelsublist = sub;
62b730
+		}
62b730
+		fclose(cfg);
62b730
+	}
62b730
+	return 0;
62b730
+}
62b730
+
62b730
 /*
62b730
  * Validation functions
62b730
  */
62b730
@@ -67,6 +159,8 @@
62b730
 		goto out;
62b730
 	}
62b730
 
62b730
+	selabel_subs_init();
62b730
+
62b730
 	rec = (struct selabel_handle *)malloc(sizeof(*rec));
62b730
 	if (!rec)
62b730
 		goto out;
62b730
@@ -88,7 +182,14 @@
62b730
 selabel_lookup_common(struct selabel_handle *rec, int translating,
62b730
 		      const char *key, int type)
62b730
 {
62b730
-	struct selabel_lookup_rec *lr = rec->func_lookup(rec, key, type);
62b730
+	struct selabel_lookup_rec *lr;
62b730
+	char *ptr = selabel_sub(key);
62b730
+	if (ptr) {
62b730
+		lr = rec->func_lookup(rec, ptr, type); 
62b730
+		free(ptr);
62b730
+	} else {
62b730
+		lr = rec->func_lookup(rec, key, type); 
62b730
+	}
62b730
 	if (!lr)
62b730
 		return NULL;
62b730
 
62b730
@@ -132,6 +233,8 @@
62b730
 {
62b730
 	rec->func_close(rec);
62b730
 	free(rec);
62b730
+
62b730
+	selabel_subs_fini();
62b730
 }
62b730
 
62b730
 void selabel_stats(struct selabel_handle *rec)
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.78/src/matchpathcon.c
62b730
--- nsalibselinux/src/matchpathcon.c	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/matchpathcon.c	2009-03-06 16:27:32.000000000 -0500
71cd13
@@ -2,6 +2,7 @@
71cd13
 #include <string.h>
71cd13
 #include <errno.h>
71cd13
 #include <stdio.h>
71cd13
+#include <syslog.h>
71cd13
 #include "selinux_internal.h"
71cd13
 #include "label_internal.h"
71cd13
 #include "callbacks.h"
0fa749
@@ -57,7 +58,7 @@
71cd13
 {
71cd13
 	va_list ap;
71cd13
 	va_start(ap, fmt);
71cd13
-	vfprintf(stderr, fmt, ap);
0fa749
+	vsyslog(LOG_ERR, fmt, ap);
71cd13
 	va_end(ap);
71cd13
 }
71cd13
 
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_config.c libselinux-2.0.78/src/selinux_config.c
62b730
--- nsalibselinux/src/selinux_config.c	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/selinux_config.c	2009-03-06 16:27:32.000000000 -0500
62b730
@@ -40,7 +40,10 @@
f56f78
 #define SECURETTY_TYPES   18
f56f78
 #define X_CONTEXTS        19
f56f78
 #define COLORS            20
f56f78
-#define NEL               21
f56f78
+#define VIRTUAL_DOMAIN    21
f56f78
+#define VIRTUAL_IMAGE     22
62b730
+#define FILE_CONTEXT_SUBS 23
62b730
+#define NEL               24
f56f78
 
f56f78
 /* New layout is relative to SELINUXDIR/policytype. */
f56f78
 static char *file_paths[NEL];
62b730
@@ -391,3 +394,24 @@
f56f78
 }
f56f78
 
f56f78
 hidden_def(selinux_x_context_path)
f56f78
+
f56f78
+const char *selinux_virtual_domain_context_path()
f56f78
+{
f56f78
+	return get_path(VIRTUAL_DOMAIN);
f56f78
+}
f56f78
+
f56f78
+hidden_def(selinux_virtual_domain_context_path)
f56f78
+
f56f78
+const char *selinux_virtual_image_context_path()
f56f78
+{
f56f78
+	return get_path(VIRTUAL_IMAGE);
f56f78
+}
f56f78
+
f56f78
+hidden_def(selinux_virtual_image_context_path)
62b730
+
62b730
+const char * selinux_file_context_subs_path(void) {
62b730
+	return get_path(FILE_CONTEXT_SUBS);
62b730
+}
62b730
+
62b730
+hidden_def(selinux_file_context_subs_path)
62b730
+
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_internal.h libselinux-2.0.78/src/selinux_internal.h
62b730
--- nsalibselinux/src/selinux_internal.h	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/selinux_internal.h	2009-03-06 16:27:32.000000000 -0500
62b730
@@ -56,9 +56,12 @@
f56f78
     hidden_proto(selinux_securetty_types_path)
f56f78
     hidden_proto(selinux_failsafe_context_path)
f56f78
     hidden_proto(selinux_removable_context_path)
f56f78
+    hidden_proto(selinux_virtual_domain_context_path)
f56f78
+    hidden_proto(selinux_virtual_image_context_path)
f56f78
     hidden_proto(selinux_file_context_path)
f56f78
     hidden_proto(selinux_file_context_homedir_path)
f56f78
     hidden_proto(selinux_file_context_local_path)
62b730
+    hidden_proto(selinux_file_context_subs_path)
62b730
     hidden_proto(selinux_netfilter_context_path)
62b730
     hidden_proto(selinux_homedir_context_path)
62b730
     hidden_proto(selinux_user_contexts_path)
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux.py libselinux-2.0.78/src/selinux.py
62b730
--- nsalibselinux/src/selinux.py	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/selinux.py	2009-03-06 16:27:32.000000000 -0500
8a44c0
@@ -1,5 +1,5 @@
8a44c0
 # This file was automatically generated by SWIG (http://www.swig.org).
5db057
-# Version 1.3.35
3cc598
+# Version 1.3.36
8a44c0
 #
8a44c0
 # Don't modify this file, modify the SWIG interface instead.
8a44c0
 # This file is compatible with both classic and new-style classes.
5db057
@@ -61,6 +61,15 @@
5db057
                              map(restorecon, [os.path.join(dirname, fname)
5db057
                                               for fname in fnames]), None)
8a44c0
 
8a44c0
+def copytree(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.copytree method """
8a44c0
+    shutil.copytree(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
8a44c0
+
8a44c0
+def install(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.move method """
8a44c0
+    shutil.move(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
5db057
 
8a44c0
 is_selinux_enabled = _selinux.is_selinux_enabled
8a44c0
 is_selinux_mls_enabled = _selinux.is_selinux_mls_enabled
5db057
@@ -102,86 +111,9 @@
5db057
 fsetfilecon_raw = _selinux.fsetfilecon_raw
5db057
 getpeercon = _selinux.getpeercon
5db057
 getpeercon_raw = _selinux.getpeercon_raw
5db057
-class av_decision(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, av_decision, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, av_decision, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["allowed"] = _selinux.av_decision_allowed_set
5db057
-    __swig_getmethods__["allowed"] = _selinux.av_decision_allowed_get
5db057
-    if _newclass:allowed = _swig_property(_selinux.av_decision_allowed_get, _selinux.av_decision_allowed_set)
5db057
-    __swig_setmethods__["decided"] = _selinux.av_decision_decided_set
5db057
-    __swig_getmethods__["decided"] = _selinux.av_decision_decided_get
5db057
-    if _newclass:decided = _swig_property(_selinux.av_decision_decided_get, _selinux.av_decision_decided_set)
5db057
-    __swig_setmethods__["auditallow"] = _selinux.av_decision_auditallow_set
5db057
-    __swig_getmethods__["auditallow"] = _selinux.av_decision_auditallow_get
5db057
-    if _newclass:auditallow = _swig_property(_selinux.av_decision_auditallow_get, _selinux.av_decision_auditallow_set)
5db057
-    __swig_setmethods__["auditdeny"] = _selinux.av_decision_auditdeny_set
5db057
-    __swig_getmethods__["auditdeny"] = _selinux.av_decision_auditdeny_get
5db057
-    if _newclass:auditdeny = _swig_property(_selinux.av_decision_auditdeny_get, _selinux.av_decision_auditdeny_set)
5db057
-    __swig_setmethods__["seqno"] = _selinux.av_decision_seqno_set
5db057
-    __swig_getmethods__["seqno"] = _selinux.av_decision_seqno_get
5db057
-    if _newclass:seqno = _swig_property(_selinux.av_decision_seqno_get, _selinux.av_decision_seqno_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_av_decision(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_av_decision
5db057
-    __del__ = lambda self : None;
5db057
-av_decision_swigregister = _selinux.av_decision_swigregister
5db057
-av_decision_swigregister(av_decision)
5db057
-
5db057
-class selinux_opt(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, selinux_opt, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, selinux_opt, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["type"] = _selinux.selinux_opt_type_set
5db057
-    __swig_getmethods__["type"] = _selinux.selinux_opt_type_get
5db057
-    if _newclass:type = _swig_property(_selinux.selinux_opt_type_get, _selinux.selinux_opt_type_set)
5db057
-    __swig_setmethods__["value"] = _selinux.selinux_opt_value_set
5db057
-    __swig_getmethods__["value"] = _selinux.selinux_opt_value_get
5db057
-    if _newclass:value = _swig_property(_selinux.selinux_opt_value_get, _selinux.selinux_opt_value_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_selinux_opt(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_selinux_opt
5db057
-    __del__ = lambda self : None;
5db057
-selinux_opt_swigregister = _selinux.selinux_opt_swigregister
5db057
-selinux_opt_swigregister(selinux_opt)
5db057
-
5db057
-class selinux_callback(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, selinux_callback, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, selinux_callback, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["func_log"] = _selinux.selinux_callback_func_log_set
5db057
-    __swig_getmethods__["func_log"] = _selinux.selinux_callback_func_log_get
5db057
-    if _newclass:func_log = _swig_property(_selinux.selinux_callback_func_log_get, _selinux.selinux_callback_func_log_set)
5db057
-    __swig_setmethods__["func_audit"] = _selinux.selinux_callback_func_audit_set
5db057
-    __swig_getmethods__["func_audit"] = _selinux.selinux_callback_func_audit_get
5db057
-    if _newclass:func_audit = _swig_property(_selinux.selinux_callback_func_audit_get, _selinux.selinux_callback_func_audit_set)
5db057
-    __swig_setmethods__["func_validate"] = _selinux.selinux_callback_func_validate_set
5db057
-    __swig_getmethods__["func_validate"] = _selinux.selinux_callback_func_validate_get
5db057
-    if _newclass:func_validate = _swig_property(_selinux.selinux_callback_func_validate_get, _selinux.selinux_callback_func_validate_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_selinux_callback(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_selinux_callback
5db057
-    __del__ = lambda self : None;
5db057
-selinux_callback_swigregister = _selinux.selinux_callback_swigregister
5db057
-selinux_callback_swigregister(selinux_callback)
5db057
-
5db057
 SELINUX_CB_LOG = _selinux.SELINUX_CB_LOG
5db057
 SELINUX_CB_AUDIT = _selinux.SELINUX_CB_AUDIT
5db057
 SELINUX_CB_VALIDATE = _selinux.SELINUX_CB_VALIDATE
5db057
-selinux_get_callback = _selinux.selinux_get_callback
5db057
-selinux_set_callback = _selinux.selinux_set_callback
5db057
 SELINUX_ERROR = _selinux.SELINUX_ERROR
5db057
 SELINUX_WARNING = _selinux.SELINUX_WARNING
5db057
 SELINUX_INFO = _selinux.SELINUX_INFO
5db057
@@ -201,27 +133,6 @@
5db057
 security_get_initial_context_raw = _selinux.security_get_initial_context_raw
5db057
 selinux_mkload_policy = _selinux.selinux_mkload_policy
5db057
 selinux_init_load_policy = _selinux.selinux_init_load_policy
5db057
-class SELboolean(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, SELboolean, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, SELboolean, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["name"] = _selinux.SELboolean_name_set
5db057
-    __swig_getmethods__["name"] = _selinux.SELboolean_name_get
5db057
-    if _newclass:name = _swig_property(_selinux.SELboolean_name_get, _selinux.SELboolean_name_set)
5db057
-    __swig_setmethods__["value"] = _selinux.SELboolean_value_set
5db057
-    __swig_getmethods__["value"] = _selinux.SELboolean_value_get
5db057
-    if _newclass:value = _swig_property(_selinux.SELboolean_value_get, _selinux.SELboolean_value_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_SELboolean(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_SELboolean
5db057
-    __del__ = lambda self : None;
5db057
-SELboolean_swigregister = _selinux.SELboolean_swigregister
5db057
-SELboolean_swigregister(SELboolean)
5db057
-
5db057
 security_set_boolean_list = _selinux.security_set_boolean_list
5db057
 security_load_booleans = _selinux.security_load_booleans
5db057
 security_check_context = _selinux.security_check_context
5db057
@@ -237,47 +148,19 @@
5db057
 security_get_boolean_active = _selinux.security_get_boolean_active
5db057
 security_set_boolean = _selinux.security_set_boolean
5db057
 security_commit_booleans = _selinux.security_commit_booleans
5db057
-class security_class_mapping(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, security_class_mapping, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, security_class_mapping, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["name"] = _selinux.security_class_mapping_name_set
5db057
-    __swig_getmethods__["name"] = _selinux.security_class_mapping_name_get
5db057
-    if _newclass:name = _swig_property(_selinux.security_class_mapping_name_get, _selinux.security_class_mapping_name_set)
5db057
-    __swig_setmethods__["perms"] = _selinux.security_class_mapping_perms_set
5db057
-    __swig_getmethods__["perms"] = _selinux.security_class_mapping_perms_get
5db057
-    if _newclass:perms = _swig_property(_selinux.security_class_mapping_perms_get, _selinux.security_class_mapping_perms_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_security_class_mapping(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_security_class_mapping
5db057
-    __del__ = lambda self : None;
5db057
-security_class_mapping_swigregister = _selinux.security_class_mapping_swigregister
5db057
-security_class_mapping_swigregister(security_class_mapping)
5db057
-
5db057
-selinux_set_mapping = _selinux.selinux_set_mapping
5db057
 string_to_security_class = _selinux.string_to_security_class
5db057
 security_class_to_string = _selinux.security_class_to_string
5db057
 security_av_perm_to_string = _selinux.security_av_perm_to_string
5db057
 string_to_av_perm = _selinux.string_to_av_perm
5db057
 security_av_string = _selinux.security_av_string
5db057
-print_access_vector = _selinux.print_access_vector
5db057
 MATCHPATHCON_BASEONLY = _selinux.MATCHPATHCON_BASEONLY
5db057
 MATCHPATHCON_NOTRANS = _selinux.MATCHPATHCON_NOTRANS
5db057
 MATCHPATHCON_VALIDATE = _selinux.MATCHPATHCON_VALIDATE
5db057
-set_matchpathcon_flags = _selinux.set_matchpathcon_flags
5db057
 matchpathcon_init = _selinux.matchpathcon_init
5db057
 matchpathcon_init_prefix = _selinux.matchpathcon_init_prefix
5db057
-matchpathcon_fini = _selinux.matchpathcon_fini
5db057
 matchpathcon = _selinux.matchpathcon
5db057
 matchpathcon_index = _selinux.matchpathcon_index
5db057
 matchpathcon_filespec_add = _selinux.matchpathcon_filespec_add
5db057
-matchpathcon_filespec_destroy = _selinux.matchpathcon_filespec_destroy
5db057
-matchpathcon_filespec_eval = _selinux.matchpathcon_filespec_eval
5db057
-matchpathcon_checkmatches = _selinux.matchpathcon_checkmatches
5db057
 matchmediacon = _selinux.matchmediacon
5db057
 selinux_getenforcemode = _selinux.selinux_getenforcemode
5db057
 selinux_getpolicytype = _selinux.selinux_getpolicytype
5db057
@@ -306,37 +189,16 @@
5db057
 selinux_check_passwd_access = _selinux.selinux_check_passwd_access
5db057
 checkPasswdAccess = _selinux.checkPasswdAccess
5db057
 selinux_check_securetty_context = _selinux.selinux_check_securetty_context
5db057
-set_selinuxmnt = _selinux.set_selinuxmnt
5db057
 rpm_execcon = _selinux.rpm_execcon
5db057
 is_context_customizable = _selinux.is_context_customizable
3cc598
 selinux_trans_to_raw_context = _selinux.selinux_trans_to_raw_context
3cc598
 selinux_raw_to_trans_context = _selinux.selinux_raw_to_trans_context
5db057
 selinux_raw_context_to_color = _selinux.selinux_raw_context_to_color
3cc598
 getseuserbyname = _selinux.getseuserbyname
3cc598
+getseuser = _selinux.getseuser
3cc598
 selinux_file_context_cmp = _selinux.selinux_file_context_cmp
3cc598
 selinux_file_context_verify = _selinux.selinux_file_context_verify
3cc598
 selinux_lsetfilecon_default = _selinux.selinux_lsetfilecon_default
5db057
-class security_id(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, security_id, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, security_id, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["ctx"] = _selinux.security_id_ctx_set
5db057
-    __swig_getmethods__["ctx"] = _selinux.security_id_ctx_get
5db057
-    if _newclass:ctx = _swig_property(_selinux.security_id_ctx_get, _selinux.security_id_ctx_set)
5db057
-    __swig_setmethods__["refcnt"] = _selinux.security_id_refcnt_set
5db057
-    __swig_getmethods__["refcnt"] = _selinux.security_id_refcnt_get
5db057
-    if _newclass:refcnt = _swig_property(_selinux.security_id_refcnt_get, _selinux.security_id_refcnt_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_security_id(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_security_id
5db057
-    __del__ = lambda self : None;
5db057
-security_id_swigregister = _selinux.security_id_swigregister
5db057
-security_id_swigregister(security_id)
5db057
-
5db057
 avc_sid_to_context = _selinux.avc_sid_to_context
5db057
 avc_sid_to_context_raw = _selinux.avc_sid_to_context_raw
5db057
 avc_context_to_sid = _selinux.avc_context_to_sid
5db057
@@ -344,124 +206,13 @@
5db057
 sidget = _selinux.sidget
5db057
 sidput = _selinux.sidput
5db057
 avc_get_initial_sid = _selinux.avc_get_initial_sid
5db057
-class avc_entry_ref(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, avc_entry_ref, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, avc_entry_ref, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["ae"] = _selinux.avc_entry_ref_ae_set
5db057
-    __swig_getmethods__["ae"] = _selinux.avc_entry_ref_ae_get
5db057
-    if _newclass:ae = _swig_property(_selinux.avc_entry_ref_ae_get, _selinux.avc_entry_ref_ae_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_avc_entry_ref(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_avc_entry_ref
5db057
-    __del__ = lambda self : None;
5db057
-avc_entry_ref_swigregister = _selinux.avc_entry_ref_swigregister
5db057
-avc_entry_ref_swigregister(avc_entry_ref)
5db057
-
5db057
-class avc_memory_callback(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, avc_memory_callback, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, avc_memory_callback, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["func_malloc"] = _selinux.avc_memory_callback_func_malloc_set
5db057
-    __swig_getmethods__["func_malloc"] = _selinux.avc_memory_callback_func_malloc_get
5db057
-    if _newclass:func_malloc = _swig_property(_selinux.avc_memory_callback_func_malloc_get, _selinux.avc_memory_callback_func_malloc_set)
5db057
-    __swig_setmethods__["func_free"] = _selinux.avc_memory_callback_func_free_set
5db057
-    __swig_getmethods__["func_free"] = _selinux.avc_memory_callback_func_free_get
5db057
-    if _newclass:func_free = _swig_property(_selinux.avc_memory_callback_func_free_get, _selinux.avc_memory_callback_func_free_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_avc_memory_callback(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_avc_memory_callback
5db057
-    __del__ = lambda self : None;
5db057
-avc_memory_callback_swigregister = _selinux.avc_memory_callback_swigregister
5db057
-avc_memory_callback_swigregister(avc_memory_callback)
5db057
-
5db057
-class avc_log_callback(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, avc_log_callback, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, avc_log_callback, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["func_log"] = _selinux.avc_log_callback_func_log_set
5db057
-    __swig_getmethods__["func_log"] = _selinux.avc_log_callback_func_log_get
5db057
-    if _newclass:func_log = _swig_property(_selinux.avc_log_callback_func_log_get, _selinux.avc_log_callback_func_log_set)
5db057
-    __swig_setmethods__["func_audit"] = _selinux.avc_log_callback_func_audit_set
5db057
-    __swig_getmethods__["func_audit"] = _selinux.avc_log_callback_func_audit_get
5db057
-    if _newclass:func_audit = _swig_property(_selinux.avc_log_callback_func_audit_get, _selinux.avc_log_callback_func_audit_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_avc_log_callback(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_avc_log_callback
5db057
-    __del__ = lambda self : None;
5db057
-avc_log_callback_swigregister = _selinux.avc_log_callback_swigregister
5db057
-avc_log_callback_swigregister(avc_log_callback)
5db057
-
5db057
-class avc_thread_callback(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, avc_thread_callback, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, avc_thread_callback, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["func_create_thread"] = _selinux.avc_thread_callback_func_create_thread_set
5db057
-    __swig_getmethods__["func_create_thread"] = _selinux.avc_thread_callback_func_create_thread_get
5db057
-    if _newclass:func_create_thread = _swig_property(_selinux.avc_thread_callback_func_create_thread_get, _selinux.avc_thread_callback_func_create_thread_set)
5db057
-    __swig_setmethods__["func_stop_thread"] = _selinux.avc_thread_callback_func_stop_thread_set
5db057
-    __swig_getmethods__["func_stop_thread"] = _selinux.avc_thread_callback_func_stop_thread_get
5db057
-    if _newclass:func_stop_thread = _swig_property(_selinux.avc_thread_callback_func_stop_thread_get, _selinux.avc_thread_callback_func_stop_thread_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_avc_thread_callback(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_avc_thread_callback
5db057
-    __del__ = lambda self : None;
5db057
-avc_thread_callback_swigregister = _selinux.avc_thread_callback_swigregister
5db057
-avc_thread_callback_swigregister(avc_thread_callback)
5db057
-
5db057
-class avc_lock_callback(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, avc_lock_callback, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, avc_lock_callback, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["func_alloc_lock"] = _selinux.avc_lock_callback_func_alloc_lock_set
5db057
-    __swig_getmethods__["func_alloc_lock"] = _selinux.avc_lock_callback_func_alloc_lock_get
5db057
-    if _newclass:func_alloc_lock = _swig_property(_selinux.avc_lock_callback_func_alloc_lock_get, _selinux.avc_lock_callback_func_alloc_lock_set)
5db057
-    __swig_setmethods__["func_get_lock"] = _selinux.avc_lock_callback_func_get_lock_set
5db057
-    __swig_getmethods__["func_get_lock"] = _selinux.avc_lock_callback_func_get_lock_get
5db057
-    if _newclass:func_get_lock = _swig_property(_selinux.avc_lock_callback_func_get_lock_get, _selinux.avc_lock_callback_func_get_lock_set)
5db057
-    __swig_setmethods__["func_release_lock"] = _selinux.avc_lock_callback_func_release_lock_set
5db057
-    __swig_getmethods__["func_release_lock"] = _selinux.avc_lock_callback_func_release_lock_get
5db057
-    if _newclass:func_release_lock = _swig_property(_selinux.avc_lock_callback_func_release_lock_get, _selinux.avc_lock_callback_func_release_lock_set)
5db057
-    __swig_setmethods__["func_free_lock"] = _selinux.avc_lock_callback_func_free_lock_set
5db057
-    __swig_getmethods__["func_free_lock"] = _selinux.avc_lock_callback_func_free_lock_get
5db057
-    if _newclass:func_free_lock = _swig_property(_selinux.avc_lock_callback_func_free_lock_get, _selinux.avc_lock_callback_func_free_lock_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_avc_lock_callback(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_avc_lock_callback
5db057
-    __del__ = lambda self : None;
5db057
-avc_lock_callback_swigregister = _selinux.avc_lock_callback_swigregister
5db057
-avc_lock_callback_swigregister(avc_lock_callback)
5db057
-
5db057
 AVC_OPT_UNUSED = _selinux.AVC_OPT_UNUSED
5db057
 AVC_OPT_SETENFORCE = _selinux.AVC_OPT_SETENFORCE
5db057
 avc_init = _selinux.avc_init
5db057
 avc_open = _selinux.avc_open
5db057
-avc_cleanup = _selinux.avc_cleanup
5db057
 avc_reset = _selinux.avc_reset
5db057
-avc_destroy = _selinux.avc_destroy
5db057
 avc_has_perm_noaudit = _selinux.avc_has_perm_noaudit
5db057
 avc_has_perm = _selinux.avc_has_perm
5db057
-avc_audit = _selinux.avc_audit
5db057
 avc_compute_create = _selinux.avc_compute_create
5db057
 avc_compute_member = _selinux.avc_compute_member
5db057
 AVC_CALLBACK_GRANT = _selinux.AVC_CALLBACK_GRANT
5db057
@@ -473,47 +224,6 @@
5db057
 AVC_CALLBACK_AUDITDENY_ENABLE = _selinux.AVC_CALLBACK_AUDITDENY_ENABLE
5db057
 AVC_CALLBACK_AUDITDENY_DISABLE = _selinux.AVC_CALLBACK_AUDITDENY_DISABLE
5db057
 AVC_CACHE_STATS = _selinux.AVC_CACHE_STATS
5db057
-class avc_cache_stats(_object):
5db057
-    __swig_setmethods__ = {}
5db057
-    __setattr__ = lambda self, name, value: _swig_setattr(self, avc_cache_stats, name, value)
5db057
-    __swig_getmethods__ = {}
5db057
-    __getattr__ = lambda self, name: _swig_getattr(self, avc_cache_stats, name)
5db057
-    __repr__ = _swig_repr
5db057
-    __swig_setmethods__["entry_lookups"] = _selinux.avc_cache_stats_entry_lookups_set
5db057
-    __swig_getmethods__["entry_lookups"] = _selinux.avc_cache_stats_entry_lookups_get
5db057
-    if _newclass:entry_lookups = _swig_property(_selinux.avc_cache_stats_entry_lookups_get, _selinux.avc_cache_stats_entry_lookups_set)
5db057
-    __swig_setmethods__["entry_hits"] = _selinux.avc_cache_stats_entry_hits_set
5db057
-    __swig_getmethods__["entry_hits"] = _selinux.avc_cache_stats_entry_hits_get
5db057
-    if _newclass:entry_hits = _swig_property(_selinux.avc_cache_stats_entry_hits_get, _selinux.avc_cache_stats_entry_hits_set)
5db057
-    __swig_setmethods__["entry_misses"] = _selinux.avc_cache_stats_entry_misses_set
5db057
-    __swig_getmethods__["entry_misses"] = _selinux.avc_cache_stats_entry_misses_get
5db057
-    if _newclass:entry_misses = _swig_property(_selinux.avc_cache_stats_entry_misses_get, _selinux.avc_cache_stats_entry_misses_set)
5db057
-    __swig_setmethods__["entry_discards"] = _selinux.avc_cache_stats_entry_discards_set
5db057
-    __swig_getmethods__["entry_discards"] = _selinux.avc_cache_stats_entry_discards_get
5db057
-    if _newclass:entry_discards = _swig_property(_selinux.avc_cache_stats_entry_discards_get, _selinux.avc_cache_stats_entry_discards_set)
5db057
-    __swig_setmethods__["cav_lookups"] = _selinux.avc_cache_stats_cav_lookups_set
5db057
-    __swig_getmethods__["cav_lookups"] = _selinux.avc_cache_stats_cav_lookups_get
5db057
-    if _newclass:cav_lookups = _swig_property(_selinux.avc_cache_stats_cav_lookups_get, _selinux.avc_cache_stats_cav_lookups_set)
5db057
-    __swig_setmethods__["cav_hits"] = _selinux.avc_cache_stats_cav_hits_set
5db057
-    __swig_getmethods__["cav_hits"] = _selinux.avc_cache_stats_cav_hits_get
5db057
-    if _newclass:cav_hits = _swig_property(_selinux.avc_cache_stats_cav_hits_get, _selinux.avc_cache_stats_cav_hits_set)
5db057
-    __swig_setmethods__["cav_probes"] = _selinux.avc_cache_stats_cav_probes_set
5db057
-    __swig_getmethods__["cav_probes"] = _selinux.avc_cache_stats_cav_probes_get
5db057
-    if _newclass:cav_probes = _swig_property(_selinux.avc_cache_stats_cav_probes_get, _selinux.avc_cache_stats_cav_probes_set)
5db057
-    __swig_setmethods__["cav_misses"] = _selinux.avc_cache_stats_cav_misses_set
5db057
-    __swig_getmethods__["cav_misses"] = _selinux.avc_cache_stats_cav_misses_get
5db057
-    if _newclass:cav_misses = _swig_property(_selinux.avc_cache_stats_cav_misses_get, _selinux.avc_cache_stats_cav_misses_set)
5db057
-    def __init__(self, *args): 
5db057
-        this = _selinux.new_avc_cache_stats(*args)
5db057
-        try: self.this.append(this)
5db057
-        except: self.this = this
5db057
-    __swig_destroy__ = _selinux.delete_avc_cache_stats
5db057
-    __del__ = lambda self : None;
5db057
-avc_cache_stats_swigregister = _selinux.avc_cache_stats_swigregister
5db057
-avc_cache_stats_swigregister(avc_cache_stats)
5db057
-
5db057
-avc_av_stats = _selinux.avc_av_stats
5db057
-avc_sid_stats = _selinux.avc_sid_stats
5db057
 selinux_default_type_path = _selinux.selinux_default_type_path
5db057
 get_default_type = _selinux.get_default_type
5db057
 SELINUX_DEFAULTUSER = _selinux.SELINUX_DEFAULTUSER
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-2.0.78/src/selinuxswig.i
62b730
--- nsalibselinux/src/selinuxswig.i	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/selinuxswig.i	2009-03-06 16:27:32.000000000 -0500
5db057
@@ -47,8 +47,36 @@
5db057
 %ignore set_matchpathcon_printf;
5db057
 %ignore set_matchpathcon_invalidcon;
5db057
 %ignore set_matchpathcon_canoncon;
5db057
-
5db057
+%ignore set_selinuxmnt; 
5db057
+%ignore avc_entry_ref_init;
5db057
+%ignore avc_entry_ref;
5db057
+%ignore avc_memory_callback;
5db057
+%ignore avc_log_callback;
5db057
+%ignore avc_thread_callback;
5db057
+%ignore avc_lock_callback;
5db057
+%ignore avc_cache_stats;
5db057
+%ignore av_decision;
5db057
+%ignore selinux_opt;
5db057
+%ignore selinux_callback;
5db057
+%ignore selinux_get_callback;
5db057
+%ignore selinux_set_callback;
5db057
+%ignore SELboolean;
5db057
+%ignore security_class_mapping;
5db057
+%ignore print_access_vector;
5db057
+%ignore set_matchpathcon_flags;
5db057
+%ignore matchpathcon_fini;
5db057
+%ignore matchpathcon_filespec_destroy;
5db057
+%ignore matchpathcon_filespec_eval;
5db057
+%ignore matchpathcon_checkmatches;
5db057
 %ignore avc_add_callback;
5db057
+%ignore avc_sid_stats;
5db057
+%ignore avc_av_stats;
5db057
+%ignore avc_audit;
5db057
+%ignore avc_destroy;
5db057
+%ignore avc_cleanup;
5db057
+%ignore avc_computer_member;
5db057
+%ignore selinux_set_mapping;
5db057
+%ignore security_id;
5db057
 
5db057
 %include "../include/selinux/selinux.h"
5db057
 %include "../include/selinux/avc.h"
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libselinux-2.0.78/src/selinuxswig_python.i
62b730
--- nsalibselinux/src/selinuxswig_python.i	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/selinuxswig_python.i	2009-03-06 16:27:32.000000000 -0500
5db057
@@ -21,6 +21,15 @@
5db057
                              map(restorecon, [os.path.join(dirname, fname)
5db057
                                               for fname in fnames]), None)
8a44c0
 
8a44c0
+def copytree(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.copytree method """
8a44c0
+    shutil.copytree(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
8a44c0
+
8a44c0
+def install(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.move method """
8a44c0
+    shutil.move(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
5db057
 %}
5db057
 
8a44c0
 /* security_get_boolean_names() typemap */
5db057
@@ -150,4 +159,12 @@
5db057
 	free($1);
5db057
 }
5db057
 
5db057
+%exception {
5db057
+  $action
5db057
+  if (result < 0) {
5db057
+     PyErr_SetFromErrno(PyExc_OSError);
5db057
+     return NULL;
5db057
+  }
5db057
+}
5db057
+
5db057
 %include "selinuxswig.i"
62b730
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libselinux-2.0.78/src/selinuxswig_wrap.c
62b730
--- nsalibselinux/src/selinuxswig_wrap.c	2009-03-06 14:41:45.000000000 -0500
62b730
+++ libselinux-2.0.78/src/selinuxswig_wrap.c	2009-03-06 16:27:32.000000000 -0500
8a44c0
@@ -1,6 +1,6 @@
8a44c0
 /* ----------------------------------------------------------------------------
8a44c0
  * This file was automatically generated by SWIG (http://www.swig.org).
5db057
- * Version 1.3.35
3cc598
+ * Version 1.3.36
8a44c0
  * 
8a44c0
  * This file is not intended to be easily readable and contains a number of 
8a44c0
  * coding conventions designed to improve portability and efficiency. Do not make
3cc598
@@ -52,6 +52,12 @@
3cc598
 # endif
3cc598
 #endif
3cc598
 
3cc598
+#ifndef SWIG_MSC_UNSUPPRESS_4505
3cc598
+# if defined(_MSC_VER)
3cc598
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
3cc598
+# endif 
3cc598
+#endif
3cc598
+
3cc598
 #ifndef SWIGUNUSEDPARM
3cc598
 # ifdef __cplusplus
3cc598
 #   define SWIGUNUSEDPARM(p)
5db057
@@ -2476,36 +2482,23 @@
8a44c0
 
5db057
 #define SWIGTYPE_p_SELboolean swig_types[0]
5db057
 #define SWIGTYPE_p_av_decision swig_types[1]
5db057
-#define SWIGTYPE_p_avc_cache_stats swig_types[2]
5db057
-#define SWIGTYPE_p_avc_entry swig_types[3]
5db057
-#define SWIGTYPE_p_avc_entry_ref swig_types[4]
5db057
-#define SWIGTYPE_p_avc_lock_callback swig_types[5]
5db057
-#define SWIGTYPE_p_avc_log_callback swig_types[6]
5db057
-#define SWIGTYPE_p_avc_memory_callback swig_types[7]
5db057
-#define SWIGTYPE_p_avc_thread_callback swig_types[8]
5db057
-#define SWIGTYPE_p_char swig_types[9]
5db057
-#define SWIGTYPE_p_f_int_p_q_const__char_v_______int swig_types[10]
5db057
-#define SWIGTYPE_p_f_p_f_void__void__p_void swig_types[11]
5db057
-#define SWIGTYPE_p_f_p_p_char__int swig_types[12]
5db057
-#define SWIGTYPE_p_f_p_q_const__char_v_______void swig_types[13]
5db057
-#define SWIGTYPE_p_f_p_void__void swig_types[14]
5db057
-#define SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__int swig_types[15]
5db057
-#define SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__void swig_types[16]
5db057
-#define SWIGTYPE_p_f_size_t__p_void swig_types[17]
5db057
-#define SWIGTYPE_p_f_void__p_void swig_types[18]
5db057
-#define SWIGTYPE_p_ino_t swig_types[19]
5db057
-#define SWIGTYPE_p_int swig_types[20]
5db057
-#define SWIGTYPE_p_p_char swig_types[21]
5db057
-#define SWIGTYPE_p_p_p_char swig_types[22]
5db057
-#define SWIGTYPE_p_p_security_id swig_types[23]
5db057
-#define SWIGTYPE_p_security_class_mapping swig_types[24]
5db057
-#define SWIGTYPE_p_security_id swig_types[25]
5db057
-#define SWIGTYPE_p_selinux_callback swig_types[26]
5db057
-#define SWIGTYPE_p_selinux_opt swig_types[27]
5db057
-#define SWIGTYPE_p_unsigned_int swig_types[28]
5db057
-#define SWIGTYPE_p_unsigned_short swig_types[29]
5db057
-static swig_type_info *swig_types[31];
5db057
-static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0};
5db057
+#define SWIGTYPE_p_avc_entry_ref swig_types[2]
5db057
+#define SWIGTYPE_p_avc_lock_callback swig_types[3]
5db057
+#define SWIGTYPE_p_avc_log_callback swig_types[4]
5db057
+#define SWIGTYPE_p_avc_memory_callback swig_types[5]
5db057
+#define SWIGTYPE_p_avc_thread_callback swig_types[6]
5db057
+#define SWIGTYPE_p_char swig_types[7]
5db057
+#define SWIGTYPE_p_ino_t swig_types[8]
5db057
+#define SWIGTYPE_p_int swig_types[9]
5db057
+#define SWIGTYPE_p_p_char swig_types[10]
5db057
+#define SWIGTYPE_p_p_p_char swig_types[11]
5db057
+#define SWIGTYPE_p_p_security_id swig_types[12]
5db057
+#define SWIGTYPE_p_security_id swig_types[13]
5db057
+#define SWIGTYPE_p_selinux_opt swig_types[14]
5db057
+#define SWIGTYPE_p_unsigned_int swig_types[15]
5db057
+#define SWIGTYPE_p_unsigned_short swig_types[16]
5db057
+static swig_type_info *swig_types[18];
5db057
+static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
5db057
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
5db057
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
8a44c0
 
5db057
@@ -2524,7 +2517,7 @@
8a44c0
 
5db057
 #define SWIG_name    "_selinux"
8a44c0
 
5db057
-#define SWIGVERSION 0x010335 
5db057
+#define SWIGVERSION 0x010336 
5db057
 #define SWIG_VERSION SWIGVERSION
8a44c0
 
8a44c0
 
5db057
@@ -2825,6 +2818,32 @@
8a44c0
 }
8a44c0
 
8a44c0
 
5db057
+SWIGINTERN int
5db057
+SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
5db057
+{
5db057
+  unsigned long v;
5db057
+  int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
5db057
+  if (SWIG_IsOK(res)) {
5db057
+    if ((v > USHRT_MAX)) {
5db057
+      return SWIG_OverflowError;
5db057
+    } else {
5db057
+      if (val) *val = (unsigned short)(v);
5db057
+    }
5db057
+  }  
5db057
+  return res;
5db057
+}
5db057
+
5db057
+
5db057
+SWIGINTERNINLINE int
5db057
+SWIG_AsVal_size_t (PyObject * obj, size_t *val)
5db057
+{
5db057
+  unsigned long v;
5db057
+  int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
5db057
+  if (SWIG_IsOK(res) && val) *val = (size_t)(v);
5db057
+  return res;
5db057
+}
5db057
+
5db057
+
5db057
 SWIGINTERNINLINE PyObject* 
5db057
 SWIG_From_unsigned_SS_long  (unsigned long value)
8a44c0
 {
5db057
@@ -2834,7 +2853,7 @@
8a44c0
 
8a44c0
 
5db057
 SWIGINTERNINLINE PyObject *
5db057
-SWIG_From_unsigned_SS_int  (unsigned int value)
5db057
+SWIG_From_unsigned_SS_short  (unsigned short value)
5db057
 {    
5db057
   return SWIG_From_unsigned_SS_long  (value);
5db057
 }
5db057
@@ -2864,34 +2883,8 @@
5db057
 }
8a44c0
 
8a44c0
 
5db057
-SWIGINTERN int
5db057
-SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
5db057
-{
5db057
-  unsigned long v;
5db057
-  int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
5db057
-  if (SWIG_IsOK(res)) {
5db057
-    if ((v > USHRT_MAX)) {
5db057
-      return SWIG_OverflowError;
5db057
-    } else {
5db057
-      if (val) *val = (unsigned short)(v);
5db057
-    }
5db057
-  }  
5db057
-  return res;
5db057
-}
5db057
-
5db057
-
5db057
-SWIGINTERNINLINE int
5db057
-SWIG_AsVal_size_t (PyObject * obj, size_t *val)
5db057
-{
5db057
-  unsigned long v;
5db057
-  int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
5db057
-  if (SWIG_IsOK(res) && val) *val = (size_t)(v);
5db057
-  return res;
5db057
-}
5db057
-
5db057
-
5db057
 SWIGINTERNINLINE PyObject *
5db057
-SWIG_From_unsigned_SS_short  (unsigned short value)
5db057
+SWIG_From_unsigned_SS_int  (unsigned int value)
5db057
 {    
5db057
   return SWIG_From_unsigned_SS_long  (value);
5db057
 }
5db057
@@ -2904,7 +2897,13 @@
5db057
   int result;
5db057
   
5db057
   if (!PyArg_ParseTuple(args,(char *)":is_selinux_enabled")) SWIG_fail;
5db057
-  result = (int)is_selinux_enabled();
5db057
+  {
5db057
+    result = (int)is_selinux_enabled();
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   return resultobj;
5db057
 fail:
5db057
@@ -2917,7 +2916,13 @@
5db057
   int result;
5db057
   
5db057
   if (!PyArg_ParseTuple(args,(char *)":is_selinux_mls_enabled")) SWIG_fail;
5db057
-  result = (int)is_selinux_mls_enabled();
5db057
+  {
5db057
+    result = (int)is_selinux_mls_enabled();
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   return resultobj;
5db057
 fail:
5db057
@@ -2928,12 +2933,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getcon")) SWIG_fail;
5db057
-  result = (int)getcon(arg1);
5db057
+  {
5db057
+    result = (int)getcon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -2952,12 +2963,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getcon_raw")) SWIG_fail;
5db057
-  result = (int)getcon_raw(arg1);
5db057
+  {
5db057
+    result = (int)getcon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -2976,11 +2993,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setcon",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -2988,7 +3005,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setcon(arg1);
5db057
+  {
5db057
+    result = (int)setcon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3001,11 +3024,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setcon_raw",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3013,7 +3036,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setcon_raw(arg1);
5db057
+  {
5db057
+    result = (int)setcon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3027,11 +3056,11 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   pid_t arg1 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   unsigned int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:getpidcon",&obj0)) SWIG_fail;
5db057
@@ -3040,7 +3069,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpidcon" "', argument " "1"" of type '" "pid_t""'");
5db057
   } 
5db057
   arg1 = (pid_t)(val1);
5db057
-  result = (int)getpidcon(arg1,arg2);
5db057
+  {
5db057
+    result = (int)getpidcon(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3060,11 +3095,11 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   pid_t arg1 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   unsigned int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:getpidcon_raw",&obj0)) SWIG_fail;
5db057
@@ -3073,7 +3108,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpidcon_raw" "', argument " "1"" of type '" "pid_t""'");
5db057
   } 
5db057
   arg1 = (pid_t)(val1);
5db057
-  result = (int)getpidcon_raw(arg1,arg2);
5db057
+  {
5db057
+    result = (int)getpidcon_raw(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3092,12 +3133,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getprevcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getprevcon")) SWIG_fail;
5db057
-  result = (int)getprevcon(arg1);
5db057
+  {
5db057
+    result = (int)getprevcon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3116,12 +3163,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getprevcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getprevcon_raw")) SWIG_fail;
5db057
-  result = (int)getprevcon_raw(arg1);
5db057
+  {
5db057
+    result = (int)getprevcon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3140,12 +3193,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getexeccon")) SWIG_fail;
5db057
-  result = (int)getexeccon(arg1);
5db057
+  {
5db057
+    result = (int)getexeccon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3164,12 +3223,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getexeccon_raw")) SWIG_fail;
5db057
-  result = (int)getexeccon_raw(arg1);
5db057
+  {
5db057
+    result = (int)getexeccon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3188,11 +3253,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setexeccon",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3200,7 +3265,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setexeccon(arg1);
5db057
+  {
5db057
+    result = (int)setexeccon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3213,11 +3284,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setexeccon_raw",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3225,7 +3296,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setexeccon_raw(arg1);
5db057
+  {
5db057
+    result = (int)setexeccon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3238,12 +3315,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getfscreatecon")) SWIG_fail;
5db057
-  result = (int)getfscreatecon(arg1);
5db057
+  {
5db057
+    result = (int)getfscreatecon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3262,12 +3345,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getfscreatecon_raw")) SWIG_fail;
5db057
-  result = (int)getfscreatecon_raw(arg1);
5db057
+  {
5db057
+    result = (int)getfscreatecon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3286,11 +3375,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3298,7 +3387,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setfscreatecon(arg1);
5db057
+  {
5db057
+    result = (int)setfscreatecon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3311,11 +3406,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon_raw",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3323,7 +3418,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setfscreatecon_raw(arg1);
5db057
+  {
5db057
+    result = (int)setfscreatecon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3336,12 +3437,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getkeycreatecon")) SWIG_fail;
5db057
-  result = (int)getkeycreatecon(arg1);
5db057
+  {
5db057
+    result = (int)getkeycreatecon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3360,12 +3467,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getkeycreatecon_raw")) SWIG_fail;
5db057
-  result = (int)getkeycreatecon_raw(arg1);
5db057
+  {
5db057
+    result = (int)getkeycreatecon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3384,11 +3497,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3396,7 +3509,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setkeycreatecon(arg1);
5db057
+  {
5db057
+    result = (int)setkeycreatecon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3409,11 +3528,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon_raw",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3421,7 +3540,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setkeycreatecon_raw(arg1);
5db057
+  {
5db057
+    result = (int)setkeycreatecon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3434,12 +3559,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getsockcreatecon")) SWIG_fail;
5db057
-  result = (int)getsockcreatecon(arg1);
5db057
+  {
5db057
+    result = (int)getsockcreatecon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3458,12 +3589,18 @@
3cc598
 SWIGINTERN PyObject *_wrap_getsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t *arg1 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   security_context_t temp1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg1 = &temp1;
3cc598
   if (!PyArg_ParseTuple(args,(char *)":getsockcreatecon_raw")) SWIG_fail;
5db057
-  result = (int)getsockcreatecon_raw(arg1);
5db057
+  {
5db057
+    result = (int)getsockcreatecon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg1) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1));
5db057
@@ -3482,11 +3619,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3494,7 +3631,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setsockcreatecon(arg1);
5db057
+  {
5db057
+    result = (int)setsockcreatecon(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3507,11 +3650,11 @@
3cc598
 SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
3cc598
   security_context_t arg1 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon_raw",&obj0)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3519,7 +3662,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg1 = (security_context_t)(buf1);
5db057
-  result = (int)setsockcreatecon_raw(arg1);
5db057
+  {
5db057
+    result = (int)setsockcreatecon_raw(arg1);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   return resultobj;
5db057
@@ -3533,12 +3682,12 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:getfilecon",&obj0)) SWIG_fail;
5db057
@@ -3547,7 +3696,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getfilecon" "', argument " "1"" of type '" "char const *""'");
5db057
   }
5db057
   arg1 = (char *)(buf1);
5db057
-  result = (int)getfilecon((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)getfilecon((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3569,12 +3724,12 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:getfilecon_raw",&obj0)) SWIG_fail;
5db057
@@ -3583,7 +3738,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getfilecon_raw" "', argument " "1"" of type '" "char const *""'");
5db057
   }
5db057
   arg1 = (char *)(buf1);
5db057
-  result = (int)getfilecon_raw((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)getfilecon_raw((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3605,12 +3766,12 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:lgetfilecon",&obj0)) SWIG_fail;
5db057
@@ -3619,7 +3780,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lgetfilecon" "', argument " "1"" of type '" "char const *""'");
5db057
   }
5db057
   arg1 = (char *)(buf1);
5db057
-  result = (int)lgetfilecon((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)lgetfilecon((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3641,12 +3808,12 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:lgetfilecon_raw",&obj0)) SWIG_fail;
5db057
@@ -3655,7 +3822,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lgetfilecon_raw" "', argument " "1"" of type '" "char const *""'");
5db057
   }
5db057
   arg1 = (char *)(buf1);
5db057
-  result = (int)lgetfilecon_raw((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)lgetfilecon_raw((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3677,11 +3850,11 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   int arg1 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:fgetfilecon",&obj0)) SWIG_fail;
5db057
@@ -3690,7 +3863,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fgetfilecon" "', argument " "1"" of type '" "int""'");
5db057
   } 
5db057
   arg1 = (int)(val1);
5db057
-  result = (int)fgetfilecon(arg1,arg2);
5db057
+  {
5db057
+    result = (int)fgetfilecon(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3710,11 +3889,11 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   int arg1 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:fgetfilecon_raw",&obj0)) SWIG_fail;
5db057
@@ -3723,7 +3902,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fgetfilecon_raw" "', argument " "1"" of type '" "int""'");
5db057
   } 
5db057
   arg1 = (int)(val1);
5db057
-  result = (int)fgetfilecon_raw(arg1,arg2);
5db057
+  {
5db057
+    result = (int)fgetfilecon_raw(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3743,7 +3928,6 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t arg2 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
5db057
@@ -3752,6 +3936,7 @@
3cc598
   int alloc2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
   PyObject * obj1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"OO:setfilecon",&obj0,&obj1)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3764,7 +3949,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setfilecon" "', argument " "2"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg2 = (security_context_t)(buf2);
5db057
-  result = (int)setfilecon((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)setfilecon((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5db057
@@ -3780,7 +3971,6 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t arg2 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
5db057
@@ -3789,6 +3979,7 @@
3cc598
   int alloc2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
   PyObject * obj1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"OO:setfilecon_raw",&obj0,&obj1)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3801,8 +3992,14 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setfilecon_raw" "', argument " "2"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg2 = (security_context_t)(buf2);
5db057
-  result = (int)setfilecon_raw((char const *)arg1,arg2);
5db057
-  resultobj = SWIG_From_int((int)(result));
5db057
+  {
5db057
+    result = (int)setfilecon_raw((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
+  resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5db057
   return resultobj;
5db057
@@ -3817,7 +4014,6 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t arg2 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
5db057
@@ -3826,6 +4022,7 @@
3cc598
   int alloc2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
   PyObject * obj1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"OO:lsetfilecon",&obj0,&obj1)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3838,7 +4035,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lsetfilecon" "', argument " "2"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg2 = (security_context_t)(buf2);
5db057
-  result = (int)lsetfilecon((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)lsetfilecon((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5db057
@@ -3854,7 +4057,6 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   char *arg1 = (char *) 0 ;
3cc598
   security_context_t arg2 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int res1 ;
3cc598
   char *buf1 = 0 ;
3cc598
   int alloc1 = 0 ;
5db057
@@ -3863,6 +4065,7 @@
3cc598
   int alloc2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
   PyObject * obj1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"OO:lsetfilecon_raw",&obj0,&obj1)) SWIG_fail;
3cc598
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
@@ -3875,7 +4078,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lsetfilecon_raw" "', argument " "2"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg2 = (security_context_t)(buf2);
5db057
-  result = (int)lsetfilecon_raw((char const *)arg1,arg2);
5db057
+  {
5db057
+    result = (int)lsetfilecon_raw((char const *)arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5db057
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5db057
@@ -3891,7 +4100,6 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   int arg1 ;
3cc598
   security_context_t arg2 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   int res2 ;
5db057
@@ -3899,6 +4107,7 @@
3cc598
   int alloc2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
   PyObject * obj1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"OO:fsetfilecon",&obj0,&obj1)) SWIG_fail;
3cc598
   ecode1 = SWIG_AsVal_int(obj0, &val1);
5db057
@@ -3911,7 +4120,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fsetfilecon" "', argument " "2"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg2 = (security_context_t)(buf2);
5db057
-  result = (int)fsetfilecon(arg1,arg2);
5db057
+  {
5db057
+    result = (int)fsetfilecon(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5db057
   return resultobj;
5db057
@@ -3925,7 +4140,6 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   int arg1 ;
3cc598
   security_context_t arg2 = (security_context_t) 0 ;
3cc598
-  int result;
3cc598
   int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   int res2 ;
5db057
@@ -3933,6 +4147,7 @@
3cc598
   int alloc2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
   PyObject * obj1 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   if (!PyArg_ParseTuple(args,(char *)"OO:fsetfilecon_raw",&obj0,&obj1)) SWIG_fail;
3cc598
   ecode1 = SWIG_AsVal_int(obj0, &val1);
5db057
@@ -3945,7 +4160,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fsetfilecon_raw" "', argument " "2"" of type '" "security_context_t""'");
5db057
   }
5db057
   arg2 = (security_context_t)(buf2);
5db057
-  result = (int)fsetfilecon_raw(arg1,arg2);
5db057
+  {
5db057
+    result = (int)fsetfilecon_raw(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5db057
   return resultobj;
5db057
@@ -3959,11 +4180,11 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   int arg1 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:getpeercon",&obj0)) SWIG_fail;
5db057
@@ -3972,7 +4193,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpeercon" "', argument " "1"" of type '" "int""'");
5db057
   } 
5db057
   arg1 = (int)(val1);
5db057
-  result = (int)getpeercon(arg1,arg2);
5db057
+  {
5db057
+    result = (int)getpeercon(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -3992,11 +4219,11 @@
3cc598
   PyObject *resultobj = 0;
3cc598
   int arg1 ;
3cc598
   security_context_t *arg2 = (security_context_t *) 0 ;
3cc598
-  int result;
3cc598
   int val1 ;
3cc598
   int ecode1 = 0 ;
3cc598
   security_context_t temp2 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
3cc598
+  int result;
3cc598
   
3cc598
   arg2 = &temp2;
3cc598
   if (!PyArg_ParseTuple(args,(char *)"O:getpeercon_raw",&obj0)) SWIG_fail;
5db057
@@ -4005,7 +4232,13 @@
5db057
     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpeercon_raw" "', argument " "1"" of type '" "int""'");
3cc598
   } 
5db057
   arg1 = (int)(val1);
5db057
-  result = (int)getpeercon_raw(arg1,arg2);
5db057
+  {
5db057
+    result = (int)getpeercon_raw(arg1,arg2);
5db057
+    if (result < 0) {
5db057
+      PyErr_SetFromErrno(PyExc_OSError);
5db057
+      return NULL;
5db057
+    }
5db057
+  }
5db057
   resultobj = SWIG_From_int((int)(result));
5db057
   if (*arg2) {
5db057
     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2));
5db057
@@ -4021,1381 +4254,1297 @@
5db057
 }
5db057
 
5db057
 
5db057
-SWIGINTERN PyObject *_wrap_av_decision_allowed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5db057
+SWIGINTERN PyObject *_wrap_security_compute_av(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3cc598
   PyObject *resultobj = 0;
5db057
-  struct av_decision *arg1 = (struct av_decision *) 0 ;
5db057
-  access_vector_t arg2 ;
5db057
-  void *argp1 = 0 ;
5db057
-  int res1 = 0 ;
5db057
-  unsigned int val2 ;
5db057
-  int ecode2 = 0 ;
5db057
+  security_context_t arg1 = (security_context_t) 0 ;
5db057
+  security_context_t arg2 = (security_context_t) 0 ;
5db057
+  security_class_t arg3 ;
5db057
+  access_vector_t arg4 ;
5db057
+  struct av_decision *arg5 = (struct av_decision *) 0 ;
5db057
+  int res1 ;
5db057
+  char *buf1 = 0 ;
5db057
+  int alloc1 = 0 ;
5db057
+  int res2 ;
5db057
+  char *buf2 = 0 ;
5db057
+  int alloc2 = 0 ;
5db057
+  unsigned short val3 ;
5db057
+  int ecode3 = 0 ;
5db057
+  unsigned int val4 ;
5db057
+  int ecode4 = 0 ;
5db057
+  void *argp5 = 0 ;
5db057
+  int res5 = 0 ;
3cc598
   PyObject * obj0 = 0 ;
5db057
   PyObject * obj1 = 0 ;
5db057
+  PyObject * obj2 = 0 ;
5db057
+  PyObject * obj3 = 0 ;
5db057
+  PyObject * obj4 = 0 ;
5db057
+  int result;
3cc598
   
5db057
-  if (!PyArg_ParseTuple(args,(char *)"OO:av_decision_allowed_set",&obj0,&obj1)) SWIG_fail;
5db057
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 |  0 );
5db057
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
5db057
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5db057
   if (!SWIG_IsOK(res1)) {
5db057
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_allowed_set" "', argument " "1"" of type '" "struct av_decision *""'"); 
5db057
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av" "', argument " "1"" of type '" "security_context_t""'");
5db057
   }
5db057
-  arg1 = (struct av_decision *)(argp1);