diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 9559bb8..03e162b 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,7 +1,16 @@ -diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h libselinux-2.0.76/include/selinux/selinux.h ---- nsalibselinux/include/selinux/selinux.h 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/include/selinux/selinux.h 2008-12-12 10:06:21.000000000 -0500 -@@ -511,6 +511,14 @@ +diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h libselinux-2.0.77/include/selinux/selinux.h +--- nsalibselinux/include/selinux/selinux.h 2009-01-05 17:45:35.000000000 -0500 ++++ libselinux-2.0.77/include/selinux/selinux.h 2009-02-18 14:18:54.000000000 -0500 +@@ -459,6 +459,8 @@ + extern const char *selinux_file_context_local_path(void); + extern const char *selinux_homedir_context_path(void); + extern const char *selinux_media_context_path(void); ++extern const char *selinux_virtual_domain_context_path(void); ++extern const char *selinux_virtual_image_context_path(void); + extern const char *selinux_x_context_path(void); + extern const char *selinux_contexts_path(void); + extern const char *selinux_securetty_types_path(void); +@@ -520,6 +522,14 @@ Caller must free the returned strings via free. */ extern int getseuserbyname(const char *linuxuser, char **seuser, char **level); @@ -16,9 +25,9 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h lib /* Compare two file contexts, return 0 if equivalent. */ int selinux_file_context_cmp(const security_context_t a, const security_context_t b); -diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 libselinux-2.0.76/man/man8/selinuxconlist.8 +diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 libselinux-2.0.77/man/man8/selinuxconlist.8 --- nsalibselinux/man/man8/selinuxconlist.8 1969-12-31 19:00:00.000000000 -0500 -+++ libselinux-2.0.76/man/man8/selinuxconlist.8 2008-12-02 09:14:48.000000000 -0500 ++++ libselinux-2.0.77/man/man8/selinuxconlist.8 2009-02-18 14:18:54.000000000 -0500 @@ -0,0 +1,18 @@ +.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation" +.SH "NAME" @@ -38,9 +47,9 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 lib + +.SH "SEE ALSO" +secon(8), selinuxdefcon(8) -diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libselinux-2.0.76/man/man8/selinuxdefcon.8 +diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libselinux-2.0.77/man/man8/selinuxdefcon.8 --- nsalibselinux/man/man8/selinuxdefcon.8 1969-12-31 19:00:00.000000000 -0500 -+++ libselinux-2.0.76/man/man8/selinuxdefcon.8 2008-12-02 09:14:48.000000000 -0500 ++++ libselinux-2.0.77/man/man8/selinuxdefcon.8 2009-02-18 14:18:54.000000000 -0500 @@ -0,0 +1,19 @@ +.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation" +.SH "NAME" @@ -61,9 +70,9 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libs + +.SH "SEE ALSO" +secon(8), selinuxconlist(8) -diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2.0.76/src/callbacks.c +diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2.0.77/src/callbacks.c --- nsalibselinux/src/callbacks.c 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/src/callbacks.c 2008-12-02 09:14:48.000000000 -0500 ++++ libselinux-2.0.77/src/callbacks.c 2009-02-18 14:18:54.000000000 -0500 @@ -16,6 +16,7 @@ { int rc; @@ -72,9 +81,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2. va_start(ap, fmt); rc = vfprintf(stderr, fmt, ap); va_end(ap); -diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.76/src/matchpathcon.c +diff --exclude-from=exclude -N -u -r nsalibselinux/src/file_path_suffixes.h libselinux-2.0.77/src/file_path_suffixes.h +--- nsalibselinux/src/file_path_suffixes.h 2009-01-05 17:45:35.000000000 -0500 ++++ libselinux-2.0.77/src/file_path_suffixes.h 2009-02-18 14:18:54.000000000 -0500 +@@ -20,3 +20,5 @@ + S_(FILE_CONTEXTS_LOCAL, "/contexts/files/file_contexts.local") + S_(X_CONTEXTS, "/contexts/x_contexts") + S_(COLORS, "/secolor.conf") ++ S_(VIRTUAL_DOMAIN, "/contexts/virtual_domain_context") ++ S_(VIRTUAL_IMAGE, "/contexts/virtual_image_context") +diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.77/src/matchpathcon.c --- nsalibselinux/src/matchpathcon.c 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/src/matchpathcon.c 2008-12-02 09:14:48.000000000 -0500 ++++ libselinux-2.0.77/src/matchpathcon.c 2009-02-18 14:18:54.000000000 -0500 @@ -2,6 +2,7 @@ #include #include @@ -92,33 +110,64 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux va_end(ap); } -diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux.py libselinux-2.0.76/src/selinux.py ---- nsalibselinux/src/selinux.py 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/src/selinux.py 2008-12-12 10:08:01.000000000 -0500 +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_config.c libselinux-2.0.77/src/selinux_config.c +--- nsalibselinux/src/selinux_config.c 2009-01-05 17:45:35.000000000 -0500 ++++ libselinux-2.0.77/src/selinux_config.c 2009-02-18 14:18:54.000000000 -0500 +@@ -40,7 +40,9 @@ + #define SECURETTY_TYPES 18 + #define X_CONTEXTS 19 + #define COLORS 20 +-#define NEL 21 ++#define VIRTUAL_DOMAIN 21 ++#define VIRTUAL_IMAGE 22 ++#define NEL 23 + + /* New layout is relative to SELINUXDIR/policytype. */ + static char *file_paths[NEL]; +@@ -391,3 +393,17 @@ + } + + hidden_def(selinux_x_context_path) ++ ++const char *selinux_virtual_domain_context_path() ++{ ++ return get_path(VIRTUAL_DOMAIN); ++} ++ ++hidden_def(selinux_virtual_domain_context_path) ++ ++const char *selinux_virtual_image_context_path() ++{ ++ return get_path(VIRTUAL_IMAGE); ++} ++ ++hidden_def(selinux_virtual_image_context_path) +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_internal.h libselinux-2.0.77/src/selinux_internal.h +--- nsalibselinux/src/selinux_internal.h 2009-01-05 17:45:35.000000000 -0500 ++++ libselinux-2.0.77/src/selinux_internal.h 2009-02-18 14:18:54.000000000 -0500 +@@ -56,6 +56,8 @@ + hidden_proto(selinux_securetty_types_path) + hidden_proto(selinux_failsafe_context_path) + hidden_proto(selinux_removable_context_path) ++ hidden_proto(selinux_virtual_domain_context_path) ++ hidden_proto(selinux_virtual_image_context_path) + hidden_proto(selinux_file_context_path) + hidden_proto(selinux_file_context_homedir_path) + hidden_proto(selinux_file_context_local_path) +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux.py libselinux-2.0.77/src/selinux.py +--- nsalibselinux/src/selinux.py 2009-01-13 08:45:35.000000000 -0500 ++++ libselinux-2.0.77/src/selinux.py 2009-02-18 14:18:54.000000000 -0500 @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). --# Version 1.3.33 +-# Version 1.3.35 +# Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. -@@ -48,6 +48,29 @@ - del types - +@@ -61,6 +61,15 @@ + map(restorecon, [os.path.join(dirname, fname) + for fname in fnames]), None) -+import shutil, os, stat -+ -+def restorecon(path, recursive=False): -+ """ Restore SELinux context on a given path """ -+ mode = os.stat(path)[stat.ST_MODE] -+ status, context = matchpathcon(path, mode) -+ if status == 0: -+ lsetfilecon(path, context) -+ if recursive: -+ os.path.walk(path, lambda arg, dirname, fnames: -+ map(restorecon, [os.path.join(dirname, fname) -+ for fname in fnames]), None) -+ +def copytree(src, dest): + """ An SELinux-friendly shutil.copytree method """ + shutil.copytree(src, dest) @@ -128,40 +177,432 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux.py libselinux-2.0 + """ An SELinux-friendly shutil.move method """ + shutil.move(src, dest) + restorecon(dest, recursive=True) -+ + is_selinux_enabled = _selinux.is_selinux_enabled is_selinux_mls_enabled = _selinux.is_selinux_mls_enabled - getcon = _selinux.getcon -@@ -297,6 +320,7 @@ +@@ -102,86 +111,9 @@ + fsetfilecon_raw = _selinux.fsetfilecon_raw + getpeercon = _selinux.getpeercon + getpeercon_raw = _selinux.getpeercon_raw +-class av_decision(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, av_decision, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, av_decision, name) +- __repr__ = _swig_repr +- __swig_setmethods__["allowed"] = _selinux.av_decision_allowed_set +- __swig_getmethods__["allowed"] = _selinux.av_decision_allowed_get +- if _newclass:allowed = _swig_property(_selinux.av_decision_allowed_get, _selinux.av_decision_allowed_set) +- __swig_setmethods__["decided"] = _selinux.av_decision_decided_set +- __swig_getmethods__["decided"] = _selinux.av_decision_decided_get +- if _newclass:decided = _swig_property(_selinux.av_decision_decided_get, _selinux.av_decision_decided_set) +- __swig_setmethods__["auditallow"] = _selinux.av_decision_auditallow_set +- __swig_getmethods__["auditallow"] = _selinux.av_decision_auditallow_get +- if _newclass:auditallow = _swig_property(_selinux.av_decision_auditallow_get, _selinux.av_decision_auditallow_set) +- __swig_setmethods__["auditdeny"] = _selinux.av_decision_auditdeny_set +- __swig_getmethods__["auditdeny"] = _selinux.av_decision_auditdeny_get +- if _newclass:auditdeny = _swig_property(_selinux.av_decision_auditdeny_get, _selinux.av_decision_auditdeny_set) +- __swig_setmethods__["seqno"] = _selinux.av_decision_seqno_set +- __swig_getmethods__["seqno"] = _selinux.av_decision_seqno_get +- if _newclass:seqno = _swig_property(_selinux.av_decision_seqno_get, _selinux.av_decision_seqno_set) +- def __init__(self, *args): +- this = _selinux.new_av_decision(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_av_decision +- __del__ = lambda self : None; +-av_decision_swigregister = _selinux.av_decision_swigregister +-av_decision_swigregister(av_decision) +- +-class selinux_opt(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, selinux_opt, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, selinux_opt, name) +- __repr__ = _swig_repr +- __swig_setmethods__["type"] = _selinux.selinux_opt_type_set +- __swig_getmethods__["type"] = _selinux.selinux_opt_type_get +- if _newclass:type = _swig_property(_selinux.selinux_opt_type_get, _selinux.selinux_opt_type_set) +- __swig_setmethods__["value"] = _selinux.selinux_opt_value_set +- __swig_getmethods__["value"] = _selinux.selinux_opt_value_get +- if _newclass:value = _swig_property(_selinux.selinux_opt_value_get, _selinux.selinux_opt_value_set) +- def __init__(self, *args): +- this = _selinux.new_selinux_opt(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_selinux_opt +- __del__ = lambda self : None; +-selinux_opt_swigregister = _selinux.selinux_opt_swigregister +-selinux_opt_swigregister(selinux_opt) +- +-class selinux_callback(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, selinux_callback, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, selinux_callback, name) +- __repr__ = _swig_repr +- __swig_setmethods__["func_log"] = _selinux.selinux_callback_func_log_set +- __swig_getmethods__["func_log"] = _selinux.selinux_callback_func_log_get +- if _newclass:func_log = _swig_property(_selinux.selinux_callback_func_log_get, _selinux.selinux_callback_func_log_set) +- __swig_setmethods__["func_audit"] = _selinux.selinux_callback_func_audit_set +- __swig_getmethods__["func_audit"] = _selinux.selinux_callback_func_audit_get +- if _newclass:func_audit = _swig_property(_selinux.selinux_callback_func_audit_get, _selinux.selinux_callback_func_audit_set) +- __swig_setmethods__["func_validate"] = _selinux.selinux_callback_func_validate_set +- __swig_getmethods__["func_validate"] = _selinux.selinux_callback_func_validate_get +- if _newclass:func_validate = _swig_property(_selinux.selinux_callback_func_validate_get, _selinux.selinux_callback_func_validate_set) +- def __init__(self, *args): +- this = _selinux.new_selinux_callback(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_selinux_callback +- __del__ = lambda self : None; +-selinux_callback_swigregister = _selinux.selinux_callback_swigregister +-selinux_callback_swigregister(selinux_callback) +- + SELINUX_CB_LOG = _selinux.SELINUX_CB_LOG + SELINUX_CB_AUDIT = _selinux.SELINUX_CB_AUDIT + SELINUX_CB_VALIDATE = _selinux.SELINUX_CB_VALIDATE +-selinux_get_callback = _selinux.selinux_get_callback +-selinux_set_callback = _selinux.selinux_set_callback + SELINUX_ERROR = _selinux.SELINUX_ERROR + SELINUX_WARNING = _selinux.SELINUX_WARNING + SELINUX_INFO = _selinux.SELINUX_INFO +@@ -201,27 +133,6 @@ + security_get_initial_context_raw = _selinux.security_get_initial_context_raw + selinux_mkload_policy = _selinux.selinux_mkload_policy + selinux_init_load_policy = _selinux.selinux_init_load_policy +-class SELboolean(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, SELboolean, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, SELboolean, name) +- __repr__ = _swig_repr +- __swig_setmethods__["name"] = _selinux.SELboolean_name_set +- __swig_getmethods__["name"] = _selinux.SELboolean_name_get +- if _newclass:name = _swig_property(_selinux.SELboolean_name_get, _selinux.SELboolean_name_set) +- __swig_setmethods__["value"] = _selinux.SELboolean_value_set +- __swig_getmethods__["value"] = _selinux.SELboolean_value_get +- if _newclass:value = _swig_property(_selinux.SELboolean_value_get, _selinux.SELboolean_value_set) +- def __init__(self, *args): +- this = _selinux.new_SELboolean(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_SELboolean +- __del__ = lambda self : None; +-SELboolean_swigregister = _selinux.SELboolean_swigregister +-SELboolean_swigregister(SELboolean) +- + security_set_boolean_list = _selinux.security_set_boolean_list + security_load_booleans = _selinux.security_load_booleans + security_check_context = _selinux.security_check_context +@@ -237,47 +148,19 @@ + security_get_boolean_active = _selinux.security_get_boolean_active + security_set_boolean = _selinux.security_set_boolean + security_commit_booleans = _selinux.security_commit_booleans +-class security_class_mapping(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, security_class_mapping, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, security_class_mapping, name) +- __repr__ = _swig_repr +- __swig_setmethods__["name"] = _selinux.security_class_mapping_name_set +- __swig_getmethods__["name"] = _selinux.security_class_mapping_name_get +- if _newclass:name = _swig_property(_selinux.security_class_mapping_name_get, _selinux.security_class_mapping_name_set) +- __swig_setmethods__["perms"] = _selinux.security_class_mapping_perms_set +- __swig_getmethods__["perms"] = _selinux.security_class_mapping_perms_get +- if _newclass:perms = _swig_property(_selinux.security_class_mapping_perms_get, _selinux.security_class_mapping_perms_set) +- def __init__(self, *args): +- this = _selinux.new_security_class_mapping(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_security_class_mapping +- __del__ = lambda self : None; +-security_class_mapping_swigregister = _selinux.security_class_mapping_swigregister +-security_class_mapping_swigregister(security_class_mapping) +- +-selinux_set_mapping = _selinux.selinux_set_mapping + string_to_security_class = _selinux.string_to_security_class + security_class_to_string = _selinux.security_class_to_string + security_av_perm_to_string = _selinux.security_av_perm_to_string + string_to_av_perm = _selinux.string_to_av_perm + security_av_string = _selinux.security_av_string +-print_access_vector = _selinux.print_access_vector + MATCHPATHCON_BASEONLY = _selinux.MATCHPATHCON_BASEONLY + MATCHPATHCON_NOTRANS = _selinux.MATCHPATHCON_NOTRANS + MATCHPATHCON_VALIDATE = _selinux.MATCHPATHCON_VALIDATE +-set_matchpathcon_flags = _selinux.set_matchpathcon_flags + matchpathcon_init = _selinux.matchpathcon_init + matchpathcon_init_prefix = _selinux.matchpathcon_init_prefix +-matchpathcon_fini = _selinux.matchpathcon_fini + matchpathcon = _selinux.matchpathcon + matchpathcon_index = _selinux.matchpathcon_index + matchpathcon_filespec_add = _selinux.matchpathcon_filespec_add +-matchpathcon_filespec_destroy = _selinux.matchpathcon_filespec_destroy +-matchpathcon_filespec_eval = _selinux.matchpathcon_filespec_eval +-matchpathcon_checkmatches = _selinux.matchpathcon_checkmatches + matchmediacon = _selinux.matchmediacon + selinux_getenforcemode = _selinux.selinux_getenforcemode + selinux_getpolicytype = _selinux.selinux_getpolicytype +@@ -306,37 +189,16 @@ + selinux_check_passwd_access = _selinux.selinux_check_passwd_access + checkPasswdAccess = _selinux.checkPasswdAccess + selinux_check_securetty_context = _selinux.selinux_check_securetty_context +-set_selinuxmnt = _selinux.set_selinuxmnt + rpm_execcon = _selinux.rpm_execcon + is_context_customizable = _selinux.is_context_customizable selinux_trans_to_raw_context = _selinux.selinux_trans_to_raw_context selinux_raw_to_trans_context = _selinux.selinux_raw_to_trans_context + selinux_raw_context_to_color = _selinux.selinux_raw_context_to_color getseuserbyname = _selinux.getseuserbyname +getseuser = _selinux.getseuser selinux_file_context_cmp = _selinux.selinux_file_context_cmp selinux_file_context_verify = _selinux.selinux_file_context_verify selinux_lsetfilecon_default = _selinux.selinux_lsetfilecon_default -diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libselinux-2.0.76/src/selinuxswig_python.i ---- nsalibselinux/src/selinuxswig_python.i 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/src/selinuxswig_python.i 2008-12-02 09:14:48.000000000 -0500 -@@ -6,6 +6,32 @@ - #include "selinux/selinux.h" - %} +-class security_id(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, security_id, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, security_id, name) +- __repr__ = _swig_repr +- __swig_setmethods__["ctx"] = _selinux.security_id_ctx_set +- __swig_getmethods__["ctx"] = _selinux.security_id_ctx_get +- if _newclass:ctx = _swig_property(_selinux.security_id_ctx_get, _selinux.security_id_ctx_set) +- __swig_setmethods__["refcnt"] = _selinux.security_id_refcnt_set +- __swig_getmethods__["refcnt"] = _selinux.security_id_refcnt_get +- if _newclass:refcnt = _swig_property(_selinux.security_id_refcnt_get, _selinux.security_id_refcnt_set) +- def __init__(self, *args): +- this = _selinux.new_security_id(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_security_id +- __del__ = lambda self : None; +-security_id_swigregister = _selinux.security_id_swigregister +-security_id_swigregister(security_id) +- + avc_sid_to_context = _selinux.avc_sid_to_context + avc_sid_to_context_raw = _selinux.avc_sid_to_context_raw + avc_context_to_sid = _selinux.avc_context_to_sid +@@ -344,124 +206,13 @@ + sidget = _selinux.sidget + sidput = _selinux.sidput + avc_get_initial_sid = _selinux.avc_get_initial_sid +-class avc_entry_ref(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, avc_entry_ref, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, avc_entry_ref, name) +- __repr__ = _swig_repr +- __swig_setmethods__["ae"] = _selinux.avc_entry_ref_ae_set +- __swig_getmethods__["ae"] = _selinux.avc_entry_ref_ae_get +- if _newclass:ae = _swig_property(_selinux.avc_entry_ref_ae_get, _selinux.avc_entry_ref_ae_set) +- def __init__(self, *args): +- this = _selinux.new_avc_entry_ref(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_avc_entry_ref +- __del__ = lambda self : None; +-avc_entry_ref_swigregister = _selinux.avc_entry_ref_swigregister +-avc_entry_ref_swigregister(avc_entry_ref) +- +-class avc_memory_callback(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, avc_memory_callback, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, avc_memory_callback, name) +- __repr__ = _swig_repr +- __swig_setmethods__["func_malloc"] = _selinux.avc_memory_callback_func_malloc_set +- __swig_getmethods__["func_malloc"] = _selinux.avc_memory_callback_func_malloc_get +- if _newclass:func_malloc = _swig_property(_selinux.avc_memory_callback_func_malloc_get, _selinux.avc_memory_callback_func_malloc_set) +- __swig_setmethods__["func_free"] = _selinux.avc_memory_callback_func_free_set +- __swig_getmethods__["func_free"] = _selinux.avc_memory_callback_func_free_get +- if _newclass:func_free = _swig_property(_selinux.avc_memory_callback_func_free_get, _selinux.avc_memory_callback_func_free_set) +- def __init__(self, *args): +- this = _selinux.new_avc_memory_callback(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_avc_memory_callback +- __del__ = lambda self : None; +-avc_memory_callback_swigregister = _selinux.avc_memory_callback_swigregister +-avc_memory_callback_swigregister(avc_memory_callback) +- +-class avc_log_callback(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, avc_log_callback, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, avc_log_callback, name) +- __repr__ = _swig_repr +- __swig_setmethods__["func_log"] = _selinux.avc_log_callback_func_log_set +- __swig_getmethods__["func_log"] = _selinux.avc_log_callback_func_log_get +- if _newclass:func_log = _swig_property(_selinux.avc_log_callback_func_log_get, _selinux.avc_log_callback_func_log_set) +- __swig_setmethods__["func_audit"] = _selinux.avc_log_callback_func_audit_set +- __swig_getmethods__["func_audit"] = _selinux.avc_log_callback_func_audit_get +- if _newclass:func_audit = _swig_property(_selinux.avc_log_callback_func_audit_get, _selinux.avc_log_callback_func_audit_set) +- def __init__(self, *args): +- this = _selinux.new_avc_log_callback(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_avc_log_callback +- __del__ = lambda self : None; +-avc_log_callback_swigregister = _selinux.avc_log_callback_swigregister +-avc_log_callback_swigregister(avc_log_callback) +- +-class avc_thread_callback(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, avc_thread_callback, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, avc_thread_callback, name) +- __repr__ = _swig_repr +- __swig_setmethods__["func_create_thread"] = _selinux.avc_thread_callback_func_create_thread_set +- __swig_getmethods__["func_create_thread"] = _selinux.avc_thread_callback_func_create_thread_get +- if _newclass:func_create_thread = _swig_property(_selinux.avc_thread_callback_func_create_thread_get, _selinux.avc_thread_callback_func_create_thread_set) +- __swig_setmethods__["func_stop_thread"] = _selinux.avc_thread_callback_func_stop_thread_set +- __swig_getmethods__["func_stop_thread"] = _selinux.avc_thread_callback_func_stop_thread_get +- if _newclass:func_stop_thread = _swig_property(_selinux.avc_thread_callback_func_stop_thread_get, _selinux.avc_thread_callback_func_stop_thread_set) +- def __init__(self, *args): +- this = _selinux.new_avc_thread_callback(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_avc_thread_callback +- __del__ = lambda self : None; +-avc_thread_callback_swigregister = _selinux.avc_thread_callback_swigregister +-avc_thread_callback_swigregister(avc_thread_callback) +- +-class avc_lock_callback(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, avc_lock_callback, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, avc_lock_callback, name) +- __repr__ = _swig_repr +- __swig_setmethods__["func_alloc_lock"] = _selinux.avc_lock_callback_func_alloc_lock_set +- __swig_getmethods__["func_alloc_lock"] = _selinux.avc_lock_callback_func_alloc_lock_get +- if _newclass:func_alloc_lock = _swig_property(_selinux.avc_lock_callback_func_alloc_lock_get, _selinux.avc_lock_callback_func_alloc_lock_set) +- __swig_setmethods__["func_get_lock"] = _selinux.avc_lock_callback_func_get_lock_set +- __swig_getmethods__["func_get_lock"] = _selinux.avc_lock_callback_func_get_lock_get +- if _newclass:func_get_lock = _swig_property(_selinux.avc_lock_callback_func_get_lock_get, _selinux.avc_lock_callback_func_get_lock_set) +- __swig_setmethods__["func_release_lock"] = _selinux.avc_lock_callback_func_release_lock_set +- __swig_getmethods__["func_release_lock"] = _selinux.avc_lock_callback_func_release_lock_get +- if _newclass:func_release_lock = _swig_property(_selinux.avc_lock_callback_func_release_lock_get, _selinux.avc_lock_callback_func_release_lock_set) +- __swig_setmethods__["func_free_lock"] = _selinux.avc_lock_callback_func_free_lock_set +- __swig_getmethods__["func_free_lock"] = _selinux.avc_lock_callback_func_free_lock_get +- if _newclass:func_free_lock = _swig_property(_selinux.avc_lock_callback_func_free_lock_get, _selinux.avc_lock_callback_func_free_lock_set) +- def __init__(self, *args): +- this = _selinux.new_avc_lock_callback(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_avc_lock_callback +- __del__ = lambda self : None; +-avc_lock_callback_swigregister = _selinux.avc_lock_callback_swigregister +-avc_lock_callback_swigregister(avc_lock_callback) +- + AVC_OPT_UNUSED = _selinux.AVC_OPT_UNUSED + AVC_OPT_SETENFORCE = _selinux.AVC_OPT_SETENFORCE + avc_init = _selinux.avc_init + avc_open = _selinux.avc_open +-avc_cleanup = _selinux.avc_cleanup + avc_reset = _selinux.avc_reset +-avc_destroy = _selinux.avc_destroy + avc_has_perm_noaudit = _selinux.avc_has_perm_noaudit + avc_has_perm = _selinux.avc_has_perm +-avc_audit = _selinux.avc_audit + avc_compute_create = _selinux.avc_compute_create + avc_compute_member = _selinux.avc_compute_member + AVC_CALLBACK_GRANT = _selinux.AVC_CALLBACK_GRANT +@@ -473,47 +224,6 @@ + AVC_CALLBACK_AUDITDENY_ENABLE = _selinux.AVC_CALLBACK_AUDITDENY_ENABLE + AVC_CALLBACK_AUDITDENY_DISABLE = _selinux.AVC_CALLBACK_AUDITDENY_DISABLE + AVC_CACHE_STATS = _selinux.AVC_CACHE_STATS +-class avc_cache_stats(_object): +- __swig_setmethods__ = {} +- __setattr__ = lambda self, name, value: _swig_setattr(self, avc_cache_stats, name, value) +- __swig_getmethods__ = {} +- __getattr__ = lambda self, name: _swig_getattr(self, avc_cache_stats, name) +- __repr__ = _swig_repr +- __swig_setmethods__["entry_lookups"] = _selinux.avc_cache_stats_entry_lookups_set +- __swig_getmethods__["entry_lookups"] = _selinux.avc_cache_stats_entry_lookups_get +- if _newclass:entry_lookups = _swig_property(_selinux.avc_cache_stats_entry_lookups_get, _selinux.avc_cache_stats_entry_lookups_set) +- __swig_setmethods__["entry_hits"] = _selinux.avc_cache_stats_entry_hits_set +- __swig_getmethods__["entry_hits"] = _selinux.avc_cache_stats_entry_hits_get +- if _newclass:entry_hits = _swig_property(_selinux.avc_cache_stats_entry_hits_get, _selinux.avc_cache_stats_entry_hits_set) +- __swig_setmethods__["entry_misses"] = _selinux.avc_cache_stats_entry_misses_set +- __swig_getmethods__["entry_misses"] = _selinux.avc_cache_stats_entry_misses_get +- if _newclass:entry_misses = _swig_property(_selinux.avc_cache_stats_entry_misses_get, _selinux.avc_cache_stats_entry_misses_set) +- __swig_setmethods__["entry_discards"] = _selinux.avc_cache_stats_entry_discards_set +- __swig_getmethods__["entry_discards"] = _selinux.avc_cache_stats_entry_discards_get +- if _newclass:entry_discards = _swig_property(_selinux.avc_cache_stats_entry_discards_get, _selinux.avc_cache_stats_entry_discards_set) +- __swig_setmethods__["cav_lookups"] = _selinux.avc_cache_stats_cav_lookups_set +- __swig_getmethods__["cav_lookups"] = _selinux.avc_cache_stats_cav_lookups_get +- if _newclass:cav_lookups = _swig_property(_selinux.avc_cache_stats_cav_lookups_get, _selinux.avc_cache_stats_cav_lookups_set) +- __swig_setmethods__["cav_hits"] = _selinux.avc_cache_stats_cav_hits_set +- __swig_getmethods__["cav_hits"] = _selinux.avc_cache_stats_cav_hits_get +- if _newclass:cav_hits = _swig_property(_selinux.avc_cache_stats_cav_hits_get, _selinux.avc_cache_stats_cav_hits_set) +- __swig_setmethods__["cav_probes"] = _selinux.avc_cache_stats_cav_probes_set +- __swig_getmethods__["cav_probes"] = _selinux.avc_cache_stats_cav_probes_get +- if _newclass:cav_probes = _swig_property(_selinux.avc_cache_stats_cav_probes_get, _selinux.avc_cache_stats_cav_probes_set) +- __swig_setmethods__["cav_misses"] = _selinux.avc_cache_stats_cav_misses_set +- __swig_getmethods__["cav_misses"] = _selinux.avc_cache_stats_cav_misses_get +- if _newclass:cav_misses = _swig_property(_selinux.avc_cache_stats_cav_misses_get, _selinux.avc_cache_stats_cav_misses_set) +- def __init__(self, *args): +- this = _selinux.new_avc_cache_stats(*args) +- try: self.this.append(this) +- except: self.this = this +- __swig_destroy__ = _selinux.delete_avc_cache_stats +- __del__ = lambda self : None; +-avc_cache_stats_swigregister = _selinux.avc_cache_stats_swigregister +-avc_cache_stats_swigregister(avc_cache_stats) +- +-avc_av_stats = _selinux.avc_av_stats +-avc_sid_stats = _selinux.avc_sid_stats + selinux_default_type_path = _selinux.selinux_default_type_path + get_default_type = _selinux.get_default_type + SELINUX_DEFAULTUSER = _selinux.SELINUX_DEFAULTUSER +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-2.0.77/src/selinuxswig.i +--- nsalibselinux/src/selinuxswig.i 2008-08-28 09:34:24.000000000 -0400 ++++ libselinux-2.0.77/src/selinuxswig.i 2009-02-18 14:18:54.000000000 -0500 +@@ -47,8 +47,36 @@ + %ignore set_matchpathcon_printf; + %ignore set_matchpathcon_invalidcon; + %ignore set_matchpathcon_canoncon; +- ++%ignore set_selinuxmnt; ++%ignore avc_entry_ref_init; ++%ignore avc_entry_ref; ++%ignore avc_memory_callback; ++%ignore avc_log_callback; ++%ignore avc_thread_callback; ++%ignore avc_lock_callback; ++%ignore avc_cache_stats; ++%ignore av_decision; ++%ignore selinux_opt; ++%ignore selinux_callback; ++%ignore selinux_get_callback; ++%ignore selinux_set_callback; ++%ignore SELboolean; ++%ignore security_class_mapping; ++%ignore print_access_vector; ++%ignore set_matchpathcon_flags; ++%ignore matchpathcon_fini; ++%ignore matchpathcon_filespec_destroy; ++%ignore matchpathcon_filespec_eval; ++%ignore matchpathcon_checkmatches; + %ignore avc_add_callback; ++%ignore avc_sid_stats; ++%ignore avc_av_stats; ++%ignore avc_audit; ++%ignore avc_destroy; ++%ignore avc_cleanup; ++%ignore avc_computer_member; ++%ignore selinux_set_mapping; ++%ignore security_id; + + %include "../include/selinux/selinux.h" + %include "../include/selinux/avc.h" +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libselinux-2.0.77/src/selinuxswig_python.i +--- nsalibselinux/src/selinuxswig_python.i 2009-01-13 08:45:35.000000000 -0500 ++++ libselinux-2.0.77/src/selinuxswig_python.i 2009-02-18 14:18:54.000000000 -0500 +@@ -21,6 +21,15 @@ + map(restorecon, [os.path.join(dirname, fname) + for fname in fnames]), None) -+%pythoncode %{ -+ -+import shutil, os, stat -+ -+def restorecon(path, recursive=False): -+ """ Restore SELinux context on a given path """ -+ mode = os.stat(path)[stat.ST_MODE] -+ status, context = matchpathcon(path, mode) -+ if status == 0: -+ lsetfilecon(path, context) -+ if recursive: -+ os.path.walk(path, lambda arg, dirname, fnames: -+ map(restorecon, [os.path.join(dirname, fname) -+ for fname in fnames]), None) -+ +def copytree(src, dest): + """ An SELinux-friendly shutil.copytree method """ + shutil.copytree(src, dest) @@ -171,18 +612,29 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libs + """ An SELinux-friendly shutil.move method """ + shutil.move(src, dest) + restorecon(dest, recursive=True) -+%} -+ + %} + /* security_get_boolean_names() typemap */ - %typemap(argout) (char ***names, int *len) { - PyObject* list = PyList_New(*$2); -diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libselinux-2.0.76/src/selinuxswig_wrap.c ---- nsalibselinux/src/selinuxswig_wrap.c 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/src/selinuxswig_wrap.c 2008-12-12 10:08:01.000000000 -0500 +@@ -150,4 +159,12 @@ + free($1); + } + ++%exception { ++ $action ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++} ++ + %include "selinuxswig.i" +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libselinux-2.0.77/src/selinuxswig_wrap.c +--- nsalibselinux/src/selinuxswig_wrap.c 2009-01-13 08:45:35.000000000 -0500 ++++ libselinux-2.0.77/src/selinuxswig_wrap.c 2009-02-18 14:18:54.000000000 -0500 @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). -- * Version 1.3.33 +- * Version 1.3.35 + * Version 1.3.36 * * This file is not intended to be easily readable and contains a number of @@ -200,154 +652,178 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) -@@ -126,7 +132,7 @@ +@@ -2476,36 +2482,23 @@ - /* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ --#define SWIG_RUNTIME_VERSION "3" -+#define SWIG_RUNTIME_VERSION "4" + #define SWIGTYPE_p_SELboolean swig_types[0] + #define SWIGTYPE_p_av_decision swig_types[1] +-#define SWIGTYPE_p_avc_cache_stats swig_types[2] +-#define SWIGTYPE_p_avc_entry swig_types[3] +-#define SWIGTYPE_p_avc_entry_ref swig_types[4] +-#define SWIGTYPE_p_avc_lock_callback swig_types[5] +-#define SWIGTYPE_p_avc_log_callback swig_types[6] +-#define SWIGTYPE_p_avc_memory_callback swig_types[7] +-#define SWIGTYPE_p_avc_thread_callback swig_types[8] +-#define SWIGTYPE_p_char swig_types[9] +-#define SWIGTYPE_p_f_int_p_q_const__char_v_______int swig_types[10] +-#define SWIGTYPE_p_f_p_f_void__void__p_void swig_types[11] +-#define SWIGTYPE_p_f_p_p_char__int swig_types[12] +-#define SWIGTYPE_p_f_p_q_const__char_v_______void swig_types[13] +-#define SWIGTYPE_p_f_p_void__void swig_types[14] +-#define SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__int swig_types[15] +-#define SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__void swig_types[16] +-#define SWIGTYPE_p_f_size_t__p_void swig_types[17] +-#define SWIGTYPE_p_f_void__p_void swig_types[18] +-#define SWIGTYPE_p_ino_t swig_types[19] +-#define SWIGTYPE_p_int swig_types[20] +-#define SWIGTYPE_p_p_char swig_types[21] +-#define SWIGTYPE_p_p_p_char swig_types[22] +-#define SWIGTYPE_p_p_security_id swig_types[23] +-#define SWIGTYPE_p_security_class_mapping swig_types[24] +-#define SWIGTYPE_p_security_id swig_types[25] +-#define SWIGTYPE_p_selinux_callback swig_types[26] +-#define SWIGTYPE_p_selinux_opt swig_types[27] +-#define SWIGTYPE_p_unsigned_int swig_types[28] +-#define SWIGTYPE_p_unsigned_short swig_types[29] +-static swig_type_info *swig_types[31]; +-static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0}; ++#define SWIGTYPE_p_avc_entry_ref swig_types[2] ++#define SWIGTYPE_p_avc_lock_callback swig_types[3] ++#define SWIGTYPE_p_avc_log_callback swig_types[4] ++#define SWIGTYPE_p_avc_memory_callback swig_types[5] ++#define SWIGTYPE_p_avc_thread_callback swig_types[6] ++#define SWIGTYPE_p_char swig_types[7] ++#define SWIGTYPE_p_ino_t swig_types[8] ++#define SWIGTYPE_p_int swig_types[9] ++#define SWIGTYPE_p_p_char swig_types[10] ++#define SWIGTYPE_p_p_p_char swig_types[11] ++#define SWIGTYPE_p_p_security_id swig_types[12] ++#define SWIGTYPE_p_security_id swig_types[13] ++#define SWIGTYPE_p_selinux_opt swig_types[14] ++#define SWIGTYPE_p_unsigned_int swig_types[15] ++#define SWIGTYPE_p_unsigned_short swig_types[16] ++static swig_type_info *swig_types[18]; ++static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0}; + #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) + #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) - /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ - #ifdef SWIG_TYPE_TABLE -@@ -161,6 +167,7 @@ +@@ -2524,7 +2517,7 @@ - /* Flags for pointer conversions */ - #define SWIG_POINTER_DISOWN 0x1 -+#define SWIG_CAST_NEW_MEMORY 0x2 + #define SWIG_name "_selinux" - /* Flags for new pointer objects */ - #define SWIG_POINTER_OWN 0x1 -@@ -301,10 +308,10 @@ - extern "C" { - #endif +-#define SWIGVERSION 0x010335 ++#define SWIGVERSION 0x010336 + #define SWIG_VERSION SWIGVERSION --typedef void *(*swig_converter_func)(void *); -+typedef void *(*swig_converter_func)(void *, int *); - typedef struct swig_type_info *(*swig_dycast_func)(void **); --/* Structure to store inforomation on one type */ -+/* Structure to store information on one type */ - typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ -@@ -431,8 +438,8 @@ - Cast a pointer up an inheritance hierarchy - */ - SWIGRUNTIMEINLINE void * --SWIG_TypeCast(swig_cast_info *ty, void *ptr) { -- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); -+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { -+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +@@ -2825,6 +2818,32 @@ } - /* -@@ -856,7 +863,7 @@ - Py_DECREF(old_str); - Py_DECREF(value); - } else { -- PyErr_Format(PyExc_RuntimeError, mesg); -+ PyErr_SetString(PyExc_RuntimeError, mesg); - } - } -@@ -1416,7 +1423,7 @@ ++SWIGINTERN int ++SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) ++{ ++ unsigned long v; ++ int res = SWIG_AsVal_unsigned_SS_long (obj, &v); ++ if (SWIG_IsOK(res)) { ++ if ((v > USHRT_MAX)) { ++ return SWIG_OverflowError; ++ } else { ++ if (val) *val = (unsigned short)(v); ++ } ++ } ++ return res; ++} ++ ++ ++SWIGINTERNINLINE int ++SWIG_AsVal_size_t (PyObject * obj, size_t *val) ++{ ++ unsigned long v; ++ int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); ++ if (SWIG_IsOK(res) && val) *val = (size_t)(v); ++ return res; ++} ++ ++ + SWIGINTERNINLINE PyObject* + SWIG_From_unsigned_SS_long (unsigned long value) { - PySwigObject *sobj = (PySwigObject *) v; - PyObject *next = sobj->next; -- if (sobj->own) { -+ if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; -@@ -1434,12 +1441,13 @@ - res = ((*meth)(mself, v)); - } - Py_XDECREF(res); -- } else { -- const char *name = SWIG_TypePrettyName(ty); -+ } - #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) -- printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name); --#endif -+ else { -+ const char *name = SWIG_TypePrettyName(ty); -+ printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -+#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -@@ -1944,7 +1952,7 @@ - - SWIGRUNTIME int - SWIG_Python_AcquirePtr(PyObject *obj, int own) { -- if (own) { -+ if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; -@@ -1965,6 +1973,8 @@ - return SWIG_OK; - } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); -+ if (own) -+ *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { -@@ -1978,7 +1988,15 @@ - if (!tc) { - sobj = (PySwigObject *)sobj->next; - } else { -- if (ptr) *ptr = SWIG_TypeCast(tc,vptr); -+ if (ptr) { -+ int newmemory = 0; -+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory); -+ if (newmemory == SWIG_CAST_NEW_MEMORY) { -+ assert(own); -+ if (own) -+ *own = *own | SWIG_CAST_NEW_MEMORY; -+ } -+ } - break; - } - } -@@ -1988,7 +2006,8 @@ - } - } - if (sobj) { -- if (own) *own = sobj->own; -+ if (own) -+ *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } -@@ -2053,8 +2072,13 @@ - } - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); -- if (!tc) return SWIG_ERROR; -- *ptr = SWIG_TypeCast(tc,vptr); -+ if (tc) { -+ int newmemory = 0; -+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory); -+ assert(!newmemory); /* newmemory handling not yet implemented */ -+ } else { -+ return SWIG_ERROR; -+ } - } else { - *ptr = vptr; - } -@@ -2506,7 +2530,7 @@ +@@ -2834,7 +2853,7 @@ - #define SWIG_name "_selinux" --#define SWIGVERSION 0x010333 -+#define SWIGVERSION 0x010336 - #define SWIG_VERSION SWIGVERSION + SWIGINTERNINLINE PyObject * +-SWIG_From_unsigned_SS_int (unsigned int value) ++SWIG_From_unsigned_SS_short (unsigned short value) + { + return SWIG_From_unsigned_SS_long (value); + } +@@ -2864,34 +2883,8 @@ + } -@@ -2910,8 +2934,8 @@ +-SWIGINTERN int +-SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) +-{ +- unsigned long v; +- int res = SWIG_AsVal_unsigned_SS_long (obj, &v); +- if (SWIG_IsOK(res)) { +- if ((v > USHRT_MAX)) { +- return SWIG_OverflowError; +- } else { +- if (val) *val = (unsigned short)(v); +- } +- } +- return res; +-} +- +- +-SWIGINTERNINLINE int +-SWIG_AsVal_size_t (PyObject * obj, size_t *val) +-{ +- unsigned long v; +- int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); +- if (SWIG_IsOK(res) && val) *val = (size_t)(v); +- return res; +-} +- +- + SWIGINTERNINLINE PyObject * +-SWIG_From_unsigned_SS_short (unsigned short value) ++SWIG_From_unsigned_SS_int (unsigned int value) + { + return SWIG_From_unsigned_SS_long (value); + } +@@ -2904,7 +2897,13 @@ + int result; + + if (!PyArg_ParseTuple(args,(char *)":is_selinux_enabled")) SWIG_fail; +- result = (int)is_selinux_enabled(); ++ { ++ result = (int)is_selinux_enabled(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: +@@ -2917,7 +2916,13 @@ + int result; + + if (!PyArg_ParseTuple(args,(char *)":is_selinux_mls_enabled")) SWIG_fail; +- result = (int)is_selinux_mls_enabled(); ++ { ++ result = (int)is_selinux_mls_enabled(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: +@@ -2928,12 +2933,18 @@ SWIGINTERN PyObject *_wrap_getcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -357,7 +833,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getcon")) SWIG_fail; -@@ -2934,8 +2958,8 @@ +- result = (int)getcon(arg1); ++ { ++ result = (int)getcon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -2952,12 +2963,18 @@ SWIGINTERN PyObject *_wrap_getcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -367,7 +854,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getcon_raw")) SWIG_fail; -@@ -2958,11 +2982,11 @@ +- result = (int)getcon_raw(arg1); ++ { ++ result = (int)getcon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -2976,11 +2993,11 @@ SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -380,7 +878,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setcon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -2983,11 +3007,11 @@ +@@ -2988,7 +3005,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setcon(arg1); ++ { ++ result = (int)setcon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3001,11 +3024,11 @@ SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -393,7 +906,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setcon_raw",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3009,11 +3033,11 @@ +@@ -3013,7 +3036,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setcon_raw(arg1); ++ { ++ result = (int)setcon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3027,11 +3056,11 @@ PyObject *resultobj = 0; pid_t arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -406,7 +934,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getpidcon",&obj0)) SWIG_fail; -@@ -3042,11 +3066,11 @@ +@@ -3040,7 +3069,13 @@ + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpidcon" "', argument " "1"" of type '" "pid_t""'"); + } + arg1 = (pid_t)(val1); +- result = (int)getpidcon(arg1,arg2); ++ { ++ result = (int)getpidcon(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3060,11 +3095,11 @@ PyObject *resultobj = 0; pid_t arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -419,7 +962,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getpidcon_raw",&obj0)) SWIG_fail; -@@ -3074,8 +3098,8 @@ +@@ -3073,7 +3108,13 @@ + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpidcon_raw" "', argument " "1"" of type '" "pid_t""'"); + } + arg1 = (pid_t)(val1); +- result = (int)getpidcon_raw(arg1,arg2); ++ { ++ result = (int)getpidcon_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3092,12 +3133,18 @@ SWIGINTERN PyObject *_wrap_getprevcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -429,7 +987,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getprevcon")) SWIG_fail; -@@ -3098,8 +3122,8 @@ +- result = (int)getprevcon(arg1); ++ { ++ result = (int)getprevcon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3116,12 +3163,18 @@ SWIGINTERN PyObject *_wrap_getprevcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -439,7 +1008,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getprevcon_raw")) SWIG_fail; -@@ -3122,8 +3146,8 @@ +- result = (int)getprevcon_raw(arg1); ++ { ++ result = (int)getprevcon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3140,12 +3193,18 @@ SWIGINTERN PyObject *_wrap_getexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -449,7 +1029,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getexeccon")) SWIG_fail; -@@ -3146,8 +3170,8 @@ +- result = (int)getexeccon(arg1); ++ { ++ result = (int)getexeccon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3164,12 +3223,18 @@ SWIGINTERN PyObject *_wrap_getexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -459,7 +1050,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getexeccon_raw")) SWIG_fail; -@@ -3170,11 +3194,11 @@ +- result = (int)getexeccon_raw(arg1); ++ { ++ result = (int)getexeccon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3188,11 +3253,11 @@ SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -472,7 +1074,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setexeccon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3195,11 +3219,11 @@ +@@ -3200,7 +3265,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setexeccon(arg1); ++ { ++ result = (int)setexeccon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3213,11 +3284,11 @@ SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -485,7 +1102,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setexeccon_raw",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3220,8 +3244,8 @@ +@@ -3225,7 +3296,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setexeccon_raw(arg1); ++ { ++ result = (int)setexeccon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3238,12 +3315,18 @@ SWIGINTERN PyObject *_wrap_getfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -495,7 +1127,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getfscreatecon")) SWIG_fail; -@@ -3244,8 +3268,8 @@ +- result = (int)getfscreatecon(arg1); ++ { ++ result = (int)getfscreatecon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3262,12 +3345,18 @@ SWIGINTERN PyObject *_wrap_getfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -505,7 +1148,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getfscreatecon_raw")) SWIG_fail; -@@ -3268,11 +3292,11 @@ +- result = (int)getfscreatecon_raw(arg1); ++ { ++ result = (int)getfscreatecon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3286,11 +3375,11 @@ SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -518,7 +1172,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3293,11 +3317,11 @@ +@@ -3298,7 +3387,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setfscreatecon(arg1); ++ { ++ result = (int)setfscreatecon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3311,11 +3406,11 @@ SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -531,7 +1200,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon_raw",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3318,8 +3342,8 @@ +@@ -3323,7 +3418,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setfscreatecon_raw(arg1); ++ { ++ result = (int)setfscreatecon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3336,12 +3437,18 @@ SWIGINTERN PyObject *_wrap_getkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -541,7 +1225,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getkeycreatecon")) SWIG_fail; -@@ -3342,8 +3366,8 @@ +- result = (int)getkeycreatecon(arg1); ++ { ++ result = (int)getkeycreatecon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3360,12 +3467,18 @@ SWIGINTERN PyObject *_wrap_getkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -551,7 +1246,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getkeycreatecon_raw")) SWIG_fail; -@@ -3366,11 +3390,11 @@ +- result = (int)getkeycreatecon_raw(arg1); ++ { ++ result = (int)getkeycreatecon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3384,11 +3497,11 @@ SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -564,7 +1270,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3391,11 +3415,11 @@ +@@ -3396,7 +3509,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setkeycreatecon(arg1); ++ { ++ result = (int)setkeycreatecon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3409,11 +3528,11 @@ SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -577,7 +1298,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon_raw",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3416,8 +3440,8 @@ +@@ -3421,7 +3540,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setkeycreatecon_raw(arg1); ++ { ++ result = (int)setkeycreatecon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3434,12 +3559,18 @@ SWIGINTERN PyObject *_wrap_getsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -587,7 +1323,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getsockcreatecon")) SWIG_fail; -@@ -3440,8 +3464,8 @@ +- result = (int)getsockcreatecon(arg1); ++ { ++ result = (int)getsockcreatecon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3458,12 +3589,18 @@ SWIGINTERN PyObject *_wrap_getsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; @@ -597,7 +1344,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getsockcreatecon_raw")) SWIG_fail; -@@ -3464,11 +3488,11 @@ +- result = (int)getsockcreatecon_raw(arg1); ++ { ++ result = (int)getsockcreatecon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -3482,11 +3619,11 @@ SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -610,7 +1368,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3489,11 +3513,11 @@ +@@ -3494,7 +3631,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setsockcreatecon(arg1); ++ { ++ result = (int)setsockcreatecon(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3507,11 +3650,11 @@ SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; @@ -623,7 +1396,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon_raw",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3515,12 +3539,12 @@ +@@ -3519,7 +3662,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- result = (int)setsockcreatecon_raw(arg1); ++ { ++ result = (int)setsockcreatecon_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -3533,12 +3682,12 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -637,7 +1425,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getfilecon",&obj0)) SWIG_fail; -@@ -3551,12 +3575,12 @@ +@@ -3547,7 +3696,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getfilecon" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)getfilecon((char const *)arg1,arg2); ++ { ++ result = (int)getfilecon((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3569,12 +3724,12 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -651,7 +1454,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getfilecon_raw",&obj0)) SWIG_fail; -@@ -3587,12 +3611,12 @@ +@@ -3583,7 +3738,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getfilecon_raw" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)getfilecon_raw((char const *)arg1,arg2); ++ { ++ result = (int)getfilecon_raw((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3605,12 +3766,12 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -665,7 +1483,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:lgetfilecon",&obj0)) SWIG_fail; -@@ -3623,12 +3647,12 @@ +@@ -3619,7 +3780,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lgetfilecon" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)lgetfilecon((char const *)arg1,arg2); ++ { ++ result = (int)lgetfilecon((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3641,12 +3808,12 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -679,7 +1512,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:lgetfilecon_raw",&obj0)) SWIG_fail; -@@ -3659,11 +3683,11 @@ +@@ -3655,7 +3822,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lgetfilecon_raw" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)lgetfilecon_raw((char const *)arg1,arg2); ++ { ++ result = (int)lgetfilecon_raw((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3677,11 +3850,11 @@ PyObject *resultobj = 0; int arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -692,7 +1540,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:fgetfilecon",&obj0)) SWIG_fail; -@@ -3692,11 +3716,11 @@ +@@ -3690,7 +3863,13 @@ + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fgetfilecon" "', argument " "1"" of type '" "int""'"); + } + arg1 = (int)(val1); +- result = (int)fgetfilecon(arg1,arg2); ++ { ++ result = (int)fgetfilecon(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3710,11 +3889,11 @@ PyObject *resultobj = 0; int arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -705,7 +1568,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:fgetfilecon_raw",&obj0)) SWIG_fail; -@@ -3725,7 +3749,6 @@ +@@ -3723,7 +3902,13 @@ + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fgetfilecon_raw" "', argument " "1"" of type '" "int""'"); + } + arg1 = (int)(val1); +- result = (int)fgetfilecon_raw(arg1,arg2); ++ { ++ result = (int)fgetfilecon_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3743,7 +3928,6 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t arg2 = (security_context_t) 0 ; @@ -713,7 +1591,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -3734,6 +3757,7 @@ +@@ -3752,6 +3936,7 @@ int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -721,7 +1599,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"OO:setfilecon",&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3762,7 +3786,6 @@ +@@ -3764,7 +3949,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setfilecon" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)setfilecon((char const *)arg1,arg2); ++ { ++ result = (int)setfilecon((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +@@ -3780,7 +3971,6 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t arg2 = (security_context_t) 0 ; @@ -729,7 +1622,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -3771,6 +3794,7 @@ +@@ -3789,6 +3979,7 @@ int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -737,7 +1630,24 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"OO:setfilecon_raw",&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3799,7 +3823,6 @@ +@@ -3801,8 +3992,14 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setfilecon_raw" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)setfilecon_raw((char const *)arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); ++ { ++ result = (int)setfilecon_raw((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +@@ -3817,7 +4014,6 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t arg2 = (security_context_t) 0 ; @@ -745,7 +1655,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -3808,6 +3831,7 @@ +@@ -3826,6 +4022,7 @@ int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -753,7 +1663,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"OO:lsetfilecon",&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3836,7 +3860,6 @@ +@@ -3838,7 +4035,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lsetfilecon" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)lsetfilecon((char const *)arg1,arg2); ++ { ++ result = (int)lsetfilecon((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +@@ -3854,7 +4057,6 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t arg2 = (security_context_t) 0 ; @@ -761,7 +1686,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -3845,6 +3868,7 @@ +@@ -3863,6 +4065,7 @@ int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -769,7 +1694,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"OO:lsetfilecon_raw",&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -3873,7 +3897,6 @@ +@@ -3875,7 +4078,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lsetfilecon_raw" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)lsetfilecon_raw((char const *)arg1,arg2); ++ { ++ result = (int)lsetfilecon_raw((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +@@ -3891,7 +4100,6 @@ PyObject *resultobj = 0; int arg1 ; security_context_t arg2 = (security_context_t) 0 ; @@ -777,7 +1717,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int val1 ; int ecode1 = 0 ; int res2 ; -@@ -3881,6 +3904,7 @@ +@@ -3899,6 +4107,7 @@ int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -785,7 +1725,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"OO:fsetfilecon",&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); -@@ -3907,7 +3931,6 @@ +@@ -3911,7 +4120,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fsetfilecon" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)fsetfilecon(arg1,arg2); ++ { ++ result = (int)fsetfilecon(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +@@ -3925,7 +4140,6 @@ PyObject *resultobj = 0; int arg1 ; security_context_t arg2 = (security_context_t) 0 ; @@ -793,7 +1748,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int val1 ; int ecode1 = 0 ; int res2 ; -@@ -3915,6 +3938,7 @@ +@@ -3933,6 +4147,7 @@ int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -801,7 +1756,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel if (!PyArg_ParseTuple(args,(char *)"OO:fsetfilecon_raw",&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); -@@ -3941,11 +3965,11 @@ +@@ -3945,7 +4160,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fsetfilecon_raw" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)fsetfilecon_raw(arg1,arg2); ++ { ++ result = (int)fsetfilecon_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +@@ -3959,11 +4180,11 @@ PyObject *resultobj = 0; int arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -814,7 +1784,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getpeercon",&obj0)) SWIG_fail; -@@ -3974,11 +3998,11 @@ +@@ -3972,7 +4193,13 @@ + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpeercon" "', argument " "1"" of type '" "int""'"); + } + arg1 = (int)(val1); +- result = (int)getpeercon(arg1,arg2); ++ { ++ result = (int)getpeercon(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -3992,11 +4219,11 @@ PyObject *resultobj = 0; int arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -827,1964 +1812,7899 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getpeercon_raw",&obj0)) SWIG_fail; -@@ -4026,7 +4050,6 @@ +@@ -4005,7 +4232,13 @@ + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpeercon_raw" "', argument " "1"" of type '" "int""'"); } - arg2 = (access_vector_t)(val2); - if (arg1) (arg1)->allowed = arg2; -- - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -4037,10 +4060,10 @@ - SWIGINTERN PyObject *_wrap_av_decision_allowed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + arg1 = (int)(val1); +- result = (int)getpeercon_raw(arg1,arg2); ++ { ++ result = (int)getpeercon_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -4021,1381 +4254,1297 @@ + } + + +-SWIGINTERN PyObject *_wrap_av_decision_allowed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_av(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct av_decision *arg1 = (struct av_decision *) 0 ; -- access_vector_t result; - void *argp1 = 0 ; - int res1 = 0 ; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- access_vector_t arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ access_vector_t arg4 ; ++ struct av_decision *arg5 = (struct av_decision *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ unsigned int val4 ; ++ int ecode4 = 0 ; ++ void *argp5 = 0 ; ++ int res5 = 0 ; PyObject * obj0 = 0 ; -+ access_vector_t result; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ PyObject * obj3 = 0 ; ++ PyObject * obj4 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:av_decision_allowed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); -@@ -4079,7 +4102,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:av_decision_allowed_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_allowed_set" "', argument " "1"" of type '" "struct av_decision *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av" "', argument " "1"" of type '" "security_context_t""'"); + } +- arg1 = (struct av_decision *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "av_decision_allowed_set" "', argument " "2"" of type '" "access_vector_t""'"); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av" "', argument " "2"" of type '" "security_context_t""'"); ++ } ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_av" "', argument " "3"" of type '" "security_class_t""'"); } - arg2 = (access_vector_t)(val2); - if (arg1) (arg1)->decided = arg2; +- arg2 = (access_vector_t)(val2); +- if (arg1) (arg1)->allowed = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -4090,10 +4112,10 @@ - SWIGINTERN PyObject *_wrap_av_decision_decided_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct av_decision *arg1 = (struct av_decision *) 0 ; +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_av_decision_allowed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; - access_vector_t result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ access_vector_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:av_decision_decided_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); -@@ -4132,7 +4154,6 @@ - } - arg2 = (access_vector_t)(val2); - if (arg1) (arg1)->auditallow = arg2; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)"O:av_decision_allowed_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_allowed_get" "', argument " "1"" of type '" "struct av_decision *""'"); ++ arg3 = (security_class_t)(val3); ++ ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); ++ if (!SWIG_IsOK(ecode4)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "security_compute_av" "', argument " "4"" of type '" "access_vector_t""'"); ++ } ++ arg4 = (access_vector_t)(val4); ++ res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_av_decision, 0 | 0 ); ++ if (!SWIG_IsOK(res5)) { ++ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "security_compute_av" "', argument " "5"" of type '" "struct av_decision *""'"); + } +- arg1 = (struct av_decision *)(argp1); +- result = (access_vector_t) ((arg1)->allowed); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg5 = (struct av_decision *)(argp5); ++ { ++ result = (int)security_compute_av(arg1,arg2,arg3,arg4,arg5); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4143,10 +4164,10 @@ - SWIGINTERN PyObject *_wrap_av_decision_auditallow_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_av_decision_decided_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_av_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct av_decision *arg1 = (struct av_decision *) 0 ; -- access_vector_t result; - void *argp1 = 0 ; - int res1 = 0 ; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- access_vector_t arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ access_vector_t arg4 ; ++ struct av_decision *arg5 = (struct av_decision *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ unsigned int val4 ; ++ int ecode4 = 0 ; ++ void *argp5 = 0 ; ++ int res5 = 0 ; PyObject * obj0 = 0 ; -+ access_vector_t result; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ PyObject * obj3 = 0 ; ++ PyObject * obj4 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:av_decision_auditallow_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); -@@ -4185,7 +4206,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:av_decision_decided_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_raw",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_decided_set" "', argument " "1"" of type '" "struct av_decision *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_raw" "', argument " "1"" of type '" "security_context_t""'"); + } +- arg1 = (struct av_decision *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "av_decision_decided_set" "', argument " "2"" of type '" "access_vector_t""'"); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_raw" "', argument " "2"" of type '" "security_context_t""'"); ++ } ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_av_raw" "', argument " "3"" of type '" "security_class_t""'"); } - arg2 = (access_vector_t)(val2); - if (arg1) (arg1)->auditdeny = arg2; +- arg2 = (access_vector_t)(val2); +- if (arg1) (arg1)->decided = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -4196,10 +4216,10 @@ - SWIGINTERN PyObject *_wrap_av_decision_auditdeny_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct av_decision *arg1 = (struct av_decision *) 0 ; +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_av_decision_decided_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; - access_vector_t result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ access_vector_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:av_decision_auditdeny_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); -@@ -4238,7 +4258,6 @@ - } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->seqno = arg2; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)"O:av_decision_decided_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_decided_get" "', argument " "1"" of type '" "struct av_decision *""'"); ++ arg3 = (security_class_t)(val3); ++ ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); ++ if (!SWIG_IsOK(ecode4)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "security_compute_av_raw" "', argument " "4"" of type '" "access_vector_t""'"); ++ } ++ arg4 = (access_vector_t)(val4); ++ res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_av_decision, 0 | 0 ); ++ if (!SWIG_IsOK(res5)) { ++ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "security_compute_av_raw" "', argument " "5"" of type '" "struct av_decision *""'"); + } +- arg1 = (struct av_decision *)(argp1); +- result = (access_vector_t) ((arg1)->decided); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg5 = (struct av_decision *)(argp5); ++ { ++ result = (int)security_compute_av_raw(arg1,arg2,arg3,arg4,arg5); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4249,10 +4268,10 @@ - SWIGINTERN PyObject *_wrap_av_decision_seqno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_av_decision_auditallow_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct av_decision *arg1 = (struct av_decision *) 0 ; -- unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- access_vector_t arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ security_context_t *arg4 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_context_t temp4 = 0 ; PyObject * obj0 = 0 ; -+ unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:av_decision_seqno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); -@@ -4273,7 +4292,7 @@ - struct av_decision *result = 0 ; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_av_decision")) SWIG_fail; -- result = (struct av_decision *)(struct av_decision *) calloc(1, sizeof(struct av_decision)); -+ result = (struct av_decision *)calloc(1, sizeof(struct av_decision)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_av_decision, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -4295,7 +4314,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:av_decision_auditallow_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_auditallow_set" "', argument " "1"" of type '" "struct av_decision *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create" "', argument " "1"" of type '" "security_context_t""'"); } - arg1 = (struct av_decision *)(argp1); - free((char *) arg1); -- - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -4305,7 +4323,7 @@ - - SWIGINTERN PyObject *av_decision_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_av_decision, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); - } -@@ -4333,7 +4351,6 @@ +- arg1 = (struct av_decision *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "av_decision_auditallow_set" "', argument " "2"" of type '" "access_vector_t""'"); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create" "', argument " "2"" of type '" "security_context_t""'"); ++ } ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_create" "', argument " "3"" of type '" "security_class_t""'"); } - arg2 = (int)(val2); - if (arg1) (arg1)->type = arg2; +- arg2 = (access_vector_t)(val2); +- if (arg1) (arg1)->auditallow = arg2; - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)security_compute_create(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ freecon(*arg4); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4344,10 +4361,10 @@ - SWIGINTERN PyObject *_wrap_selinux_opt_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_av_decision_auditallow_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_create_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- access_vector_t result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:av_decision_auditallow_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_auditallow_get" "', argument " "1"" of type '" "struct av_decision *""'"); +- } +- arg1 = (struct av_decision *)(argp1); +- result = (access_vector_t) ((arg1)->auditallow); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_av_decision_auditdeny_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- access_vector_t arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ security_context_t *arg4 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_context_t temp4 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_opt_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); -@@ -4404,10 +4421,10 @@ - SWIGINTERN PyObject *_wrap_selinux_opt_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; -- char *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:selinux_opt_value_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); -@@ -4428,7 +4445,7 @@ - struct selinux_opt *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_selinux_opt")) SWIG_fail; -- result = (struct selinux_opt *)(struct selinux_opt *) calloc(1, sizeof(struct selinux_opt)); -+ result = (struct selinux_opt *)calloc(1, sizeof(struct selinux_opt)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_selinux_opt, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -4450,7 +4467,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:av_decision_auditdeny_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_auditdeny_set" "', argument " "1"" of type '" "struct av_decision *""'"); +- } +- arg1 = (struct av_decision *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "av_decision_auditdeny_set" "', argument " "2"" of type '" "access_vector_t""'"); +- } +- arg2 = (access_vector_t)(val2); +- if (arg1) (arg1)->auditdeny = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_av_decision_auditdeny_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- access_vector_t result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:av_decision_auditdeny_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create_raw",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_auditdeny_get" "', argument " "1"" of type '" "struct av_decision *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create_raw" "', argument " "1"" of type '" "security_context_t""'"); + } +- arg1 = (struct av_decision *)(argp1); +- result = (access_vector_t) ((arg1)->auditdeny); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_av_decision_seqno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- unsigned int arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:av_decision_seqno_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_seqno_set" "', argument " "1"" of type '" "struct av_decision *""'"); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create_raw" "', argument " "2"" of type '" "security_context_t""'"); + } +- arg1 = (struct av_decision *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "av_decision_seqno_set" "', argument " "2"" of type '" "unsigned int""'"); ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_create_raw" "', argument " "3"" of type '" "security_class_t""'"); + } +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->seqno = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_av_decision_seqno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- unsigned int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:av_decision_seqno_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "av_decision_seqno_get" "', argument " "1"" of type '" "struct av_decision *""'"); ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)security_compute_create_raw(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct av_decision *)(argp1); +- result = (unsigned int) ((arg1)->seqno); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_av_decision(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_av_decision")) SWIG_fail; +- result = (struct av_decision *)calloc(1, sizeof(struct av_decision)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_av_decision, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_av_decision(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct av_decision *arg1 = (struct av_decision *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_av_decision",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_av_decision, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_av_decision" "', argument " "1"" of type '" "struct av_decision *""'"); ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ freecon(*arg4); } - arg1 = (struct selinux_opt *)(argp1); - free((char *) arg1); +- arg1 = (struct av_decision *)(argp1); +- free((char *) arg1); - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4460,7 +4476,7 @@ - - SWIGINTERN PyObject *selinux_opt_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_selinux_opt, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; } -@@ -4487,7 +4503,6 @@ - } + + +-SWIGINTERN PyObject *av_decision_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_av_decision, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_selinux_opt_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_relabel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- int arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- int val2 ; +- int ecode2 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ security_context_t *arg4 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_context_t temp4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; + +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_opt_type_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_opt_type_set" "', argument " "1"" of type '" "struct selinux_opt *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel" "', argument " "1"" of type '" "security_context_t""'"); } - if (arg1) (arg1)->func_log = arg2; +- arg1 = (struct selinux_opt *)(argp1); +- ecode2 = SWIG_AsVal_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "selinux_opt_type_set" "', argument " "2"" of type '" "int""'"); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel" "', argument " "2"" of type '" "security_context_t""'"); ++ } ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_relabel" "', argument " "3"" of type '" "security_class_t""'"); + } +- arg2 = (int)(val2); +- if (arg1) (arg1)->type = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_opt_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_opt_type_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_opt_type_get" "', argument " "1"" of type '" "struct selinux_opt *""'"); ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)security_compute_relabel(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct selinux_opt *)(argp1); +- result = (int) ((arg1)->type); + resultobj = SWIG_From_int((int)(result)); ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ freecon(*arg4); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4498,10 +4513,10 @@ - SWIGINTERN PyObject *_wrap_selinux_callback_func_log_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_opt_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_relabel_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - union selinux_callback *arg1 = (union selinux_callback *) 0 ; -- int (*result)(int,char const *,...) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- char *arg2 = (char *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ security_context_t *arg4 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_context_t temp4 = 0 ; PyObject * obj0 = 0 ; -+ int (*result)(int,char const *,...) = 0 ; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_callback_func_log_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); -@@ -4539,7 +4554,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_opt_value_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel_raw",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_opt_value_set" "', argument " "1"" of type '" "struct selinux_opt *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel_raw" "', argument " "1"" of type '" "security_context_t""'"); } - if (arg1) (arg1)->func_audit = arg2; -- - resultobj = SWIG_Py_Void(); +- arg1 = (struct selinux_opt *)(argp1); ++ arg1 = (security_context_t)(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "selinux_opt_value_set" "', argument " "2"" of type '" "char const *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel_raw" "', argument " "2"" of type '" "security_context_t""'"); + } +- arg2 = (char *)(buf2); +- if (arg2) { +- size_t size = strlen((const char *)((const char *)(arg2))) + 1; +- arg1->value = (char const *)(char *)memcpy((char *)malloc((size)*sizeof(char)), arg2, sizeof(char)*(size)); +- } else { +- arg1->value = 0; ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_relabel_raw" "', argument " "3"" of type '" "security_class_t""'"); ++ } ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)security_compute_relabel_raw(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ freecon(*arg4); + } +- resultobj = SWIG_Py_Void(); ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4550,10 +4564,10 @@ - SWIGINTERN PyObject *_wrap_selinux_callback_func_audit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_opt_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - union selinux_callback *arg1 = (union selinux_callback *) 0 ; -- int (*result)(void *,security_class_t,char *,size_t) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- char *result = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ security_context_t *arg4 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_context_t temp4 = 0 ; PyObject * obj0 = 0 ; -+ int (*result)(void *,security_class_t,char *,size_t) = 0 ; ++ PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_callback_func_audit_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); -@@ -4591,7 +4605,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_opt_value_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_opt_value_get" "', argument " "1"" of type '" "struct selinux_opt *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member" "', argument " "1"" of type '" "security_context_t""'"); } - if (arg1) (arg1)->func_validate = arg2; +- arg1 = (struct selinux_opt *)(argp1); +- result = (char *) ((arg1)->value); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_selinux_opt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct selinux_opt *result = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)":new_selinux_opt")) SWIG_fail; +- result = (struct selinux_opt *)calloc(1, sizeof(struct selinux_opt)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_selinux_opt, SWIG_POINTER_NEW | 0 ); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member" "', argument " "2"" of type '" "security_context_t""'"); ++ } ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_member" "', argument " "3"" of type '" "security_class_t""'"); ++ } ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)security_compute_member(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ freecon(*arg4); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4602,10 +4615,10 @@ - SWIGINTERN PyObject *_wrap_selinux_callback_func_validate_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_delete_selinux_opt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_member_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - union selinux_callback *arg1 = (union selinux_callback *) 0 ; -- int (*result)(security_context_t *) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t arg2 = (security_context_t) 0 ; ++ security_class_t arg3 ; ++ security_context_t *arg4 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_context_t temp4 = 0 ; PyObject * obj0 = 0 ; -+ int (*result)(security_context_t *) = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:selinux_callback_func_validate_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); -@@ -4626,7 +4639,7 @@ - union selinux_callback *result = 0 ; ++ PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_selinux_callback")) SWIG_fail; -- result = (union selinux_callback *)(union selinux_callback *) calloc(1, sizeof(union selinux_callback)); -+ result = (union selinux_callback *)calloc(1, sizeof(union selinux_callback)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_selinux_callback, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -4648,7 +4661,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:delete_selinux_opt",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, SWIG_POINTER_DISOWN | 0 ); ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member_raw",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_selinux_opt" "', argument " "1"" of type '" "struct selinux_opt *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member_raw" "', argument " "1"" of type '" "security_context_t""'"); } - arg1 = (union selinux_callback *)(argp1); - free((char *) arg1); +- arg1 = (struct selinux_opt *)(argp1); +- free((char *) arg1); - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member_raw" "', argument " "2"" of type '" "security_context_t""'"); ++ } ++ arg2 = (security_context_t)(buf2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_member_raw" "', argument " "3"" of type '" "security_class_t""'"); ++ } ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)security_compute_member_raw(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ freecon(*arg4); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -4658,7 +4670,7 @@ - - SWIGINTERN PyObject *selinux_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_selinux_callback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; } -@@ -4666,10 +4678,10 @@ - SWIGINTERN PyObject *_wrap_selinux_get_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + + +-SWIGINTERN PyObject *selinux_opt_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_selinux_opt, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_selinux_callback_func_log_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - int arg1 ; -- union selinux_callback result; - int val1 ; - int ecode1 = 0 ; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- int (*arg2)(int,char const *,...) = (int (*)(int,char const *,...)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ char *arg2 = (char *) 0 ; ++ security_context_t **arg3 = (security_context_t **) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ security_context_t *temp3 ; PyObject * obj0 = 0 ; -+ union selinux_callback result; - - if (!PyArg_ParseTuple(args,(char *)"O:selinux_get_callback",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); -@@ -4728,7 +4740,6 @@ - security_class_t arg3 ; - access_vector_t arg4 ; - struct av_decision *arg5 = (struct av_decision *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -4746,6 +4757,7 @@ - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -4792,7 +4804,6 @@ - security_class_t arg3 ; - access_vector_t arg4 ; - struct av_decision *arg5 = (struct av_decision *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -4810,6 +4821,7 @@ - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; + PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_raw",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -4855,7 +4867,6 @@ - security_context_t arg2 = (security_context_t) 0 ; - security_class_t arg3 ; - security_context_t *arg4 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -4868,6 +4879,7 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_callback_func_log_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); ++ { ++ arg3 = &temp3; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"OO:security_compute_user",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_callback_func_log_set" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user" "', argument " "1"" of type '" "security_context_t""'"); ++ } ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_user" "', argument " "2"" of type '" "char const *""'"); + } +- arg1 = (union selinux_callback *)(argp1); ++ arg2 = (char *)(buf2); + { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_int_p_q_const__char_v_______int); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "selinux_callback_func_log_set" "', argument " "2"" of type '" "int (*)(int,char const *,...)""'"); ++ result = (int)security_compute_user(arg1,(char const *)arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } +- if (arg1) (arg1)->func_log = arg2; +- +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_From_int((int)(result)); ++ { ++ PyObject* plist; ++ int i, len = 0; ++ ++ if (*arg3) { ++ while((*arg3)[len]) ++ len++; ++ plist = PyList_New(len); ++ for (i = 0; i < len; i++) { ++ PyList_SetItem(plist, i, PyString_FromString((*arg3)[i])); ++ } ++ } else { ++ plist = PyList_New(0); ++ } ++ ++ resultobj = SWIG_Python_AppendOutput(resultobj, plist); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ { ++ if (*arg3) freeconary(*arg3); ++ } + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ { ++ if (*arg3) freeconary(*arg3); ++ } + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_callback_func_log_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- int (*result)(int,char const *,...) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ char *arg2 = (char *) 0 ; ++ security_context_t **arg3 = (security_context_t **) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ security_context_t *temp3 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; ++ PyObject * obj1 = 0 ; + int result; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -4912,7 +4924,6 @@ - security_context_t arg2 = (security_context_t) 0 ; - security_class_t arg3 ; - security_context_t *arg4 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -4925,6 +4936,7 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_callback_func_log_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); ++ { ++ arg3 = &temp3; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"OO:security_compute_user_raw",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_callback_func_log_get" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user_raw" "', argument " "1"" of type '" "security_context_t""'"); ++ } ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_user_raw" "', argument " "2"" of type '" "char const *""'"); ++ } ++ arg2 = (char *)(buf2); ++ { ++ result = (int)security_compute_user_raw(arg1,(char const *)arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ { ++ PyObject* plist; ++ int i, len = 0; ++ ++ if (*arg3) { ++ while((*arg3)[len]) ++ len++; ++ plist = PyList_New(len); ++ for (i = 0; i < len; i++) { ++ PyList_SetItem(plist, i, PyString_FromString((*arg3)[i])); ++ } ++ } else { ++ plist = PyList_New(0); ++ } ++ ++ resultobj = SWIG_Python_AppendOutput(resultobj, plist); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ { ++ if (*arg3) freeconary(*arg3); + } +- arg1 = (union selinux_callback *)(argp1); +- result = (int (*)(int,char const *,...)) ((arg1)->func_log); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_int_p_q_const__char_v_______int); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ { ++ if (*arg3) freeconary(*arg3); ++ } + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_callback_func_audit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_load_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- int (*arg2)(void *,security_class_t,char *,size_t) = (int (*)(void *,security_class_t,char *,size_t)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ void *arg1 = (void *) 0 ; ++ size_t arg2 ; ++ int res1 ; ++ size_t val2 ; ++ int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + int result; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create_raw",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -4969,7 +4981,6 @@ - security_context_t arg2 = (security_context_t) 0 ; - security_class_t arg3 ; - security_context_t *arg4 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -4982,6 +4993,7 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_callback_func_audit_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OO:security_load_policy",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_callback_func_audit_set" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_load_policy" "', argument " "1"" of type '" "void *""'"); + } +- arg1 = (union selinux_callback *)(argp1); ++ ecode2 = SWIG_AsVal_size_t(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_load_policy" "', argument " "2"" of type '" "size_t""'"); ++ } ++ arg2 = (size_t)(val2); + { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__int); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "selinux_callback_func_audit_set" "', argument " "2"" of type '" "int (*)(void *,security_class_t,char *,size_t)""'"); ++ result = (int)security_load_policy(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } +- if (arg1) (arg1)->func_audit = arg2; +- +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_callback_func_audit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_get_initial_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- int (*result)(void *,security_class_t,char *,size_t) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ char *arg1 = (char *) 0 ; ++ security_context_t *arg2 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + int result; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -5026,7 +5038,6 @@ - security_context_t arg2 = (security_context_t) 0 ; - security_class_t arg3 ; - security_context_t *arg4 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -5039,6 +5050,7 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_callback_func_audit_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_get_initial_context",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_callback_func_audit_get" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_initial_context" "', argument " "1"" of type '" "char const *""'"); ++ } ++ arg1 = (char *)(buf1); ++ { ++ result = (int)security_get_initial_context((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } +- arg1 = (union selinux_callback *)(argp1); +- result = (int (*)(void *,security_class_t,char *,size_t)) ((arg1)->func_audit); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__int); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_callback_func_validate_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_get_initial_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- int (*arg2)(security_context_t *) = (int (*)(security_context_t *)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ char *arg1 = (char *) 0 ; ++ security_context_t *arg2 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; +- PyObject * obj1 = 0 ; + int result; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel_raw",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -5083,7 +5095,6 @@ - security_context_t arg2 = (security_context_t) 0 ; - security_class_t arg3 ; - security_context_t *arg4 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -5096,6 +5107,7 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_callback_func_validate_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_get_initial_context_raw",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_callback_func_validate_set" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_initial_context_raw" "', argument " "1"" of type '" "char const *""'"); + } +- arg1 = (union selinux_callback *)(argp1); ++ arg1 = (char *)(buf1); + { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_p_char__int); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "selinux_callback_func_validate_set" "', argument " "2"" of type '" "int (*)(security_context_t *)""'"); ++ result = (int)security_get_initial_context_raw((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } +- if (arg1) (arg1)->func_validate = arg2; +- +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_callback_func_validate_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_mkload_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- int (*result)(security_context_t *) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ int arg1 ; ++ int val1 ; ++ int ecode1 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + int result; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -5140,7 +5152,6 @@ - security_context_t arg2 = (security_context_t) 0 ; - security_class_t arg3 ; - security_context_t *arg4 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -5153,6 +5164,7 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_callback_func_validate_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_callback_func_validate_get" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_mkload_policy",&obj0)) SWIG_fail; ++ ecode1 = SWIG_AsVal_int(obj0, &val1); ++ if (!SWIG_IsOK(ecode1)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "selinux_mkload_policy" "', argument " "1"" of type '" "int""'"); ++ } ++ arg1 = (int)(val1); ++ { ++ result = (int)selinux_mkload_policy(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (union selinux_callback *)(argp1); +- result = (int (*)(security_context_t *)) ((arg1)->func_validate); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_p_char__int); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_selinux_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- union selinux_callback *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_selinux_callback")) SWIG_fail; +- result = (union selinux_callback *)calloc(1, sizeof(union selinux_callback)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_selinux_callback, SWIG_POINTER_NEW | 0 ); ++ resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_delete_selinux_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_init_load_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- union selinux_callback *arg1 = (union selinux_callback *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; ++ int *arg1 = (int *) 0 ; ++ int temp1 ; ++ int res1 = SWIG_TMPOBJ ; ++ int result; + +- if (!PyArg_ParseTuple(args,(char *)"O:delete_selinux_callback",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_callback, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_selinux_callback" "', argument " "1"" of type '" "union selinux_callback *""'"); ++ arg1 = &temp1; ++ if (!PyArg_ParseTuple(args,(char *)":selinux_init_load_policy")) SWIG_fail; ++ { ++ result = (int)selinux_init_load_policy(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (SWIG_IsTmpObj(res1)) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); ++ } else { ++ int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); + } +- arg1 = (union selinux_callback *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *selinux_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_selinux_callback, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_selinux_get_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_set_boolean_list(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- int arg1 ; +- union selinux_callback result; +- int val1 ; ++ size_t arg1 ; ++ SELboolean *arg2 = (SELboolean *) 0 ; ++ int arg3 ; ++ size_t val1 ; + int ecode1 = 0 ; ++ void *argp2 = 0 ; ++ int res2 = 0 ; ++ int val3 ; ++ int ecode3 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; ++ PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; + int result; - arg4 = &temp4; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member_raw",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -5196,7 +5208,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_get_callback",&obj0)) SWIG_fail; +- ecode1 = SWIG_AsVal_int(obj0, &val1); ++ if (!PyArg_ParseTuple(args,(char *)"OOO:security_set_boolean_list",&obj0,&obj1,&obj2)) SWIG_fail; ++ ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "selinux_get_callback" "', argument " "1"" of type '" "int""'"); ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_set_boolean_list" "', argument " "1"" of type '" "size_t""'"); + } +- arg1 = (int)(val1); +- result = selinux_get_callback(arg1); +- resultobj = SWIG_NewPointerObj((union selinux_callback *)memcpy((union selinux_callback *)malloc(sizeof(union selinux_callback)),&result,sizeof(union selinux_callback)), SWIGTYPE_p_selinux_callback, SWIG_POINTER_OWN | 0 ); ++ arg1 = (size_t)(val1); ++ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SELboolean, 0 | 0 ); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_set_boolean_list" "', argument " "2"" of type '" "SELboolean *""'"); ++ } ++ arg2 = (SELboolean *)(argp2); ++ ecode3 = SWIG_AsVal_int(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_set_boolean_list" "', argument " "3"" of type '" "int""'"); ++ } ++ arg3 = (int)(val3); ++ { ++ result = (int)security_set_boolean_list(arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_set_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_load_booleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- int arg1 ; +- union selinux_callback arg2 ; +- int val1 ; +- int ecode1 = 0 ; +- void *argp2 ; +- int res2 = 0 ; ++ char *arg1 = (char *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; + PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; ++ int result; + +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_set_callback",&obj0,&obj1)) SWIG_fail; +- ecode1 = SWIG_AsVal_int(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "selinux_set_callback" "', argument " "1"" of type '" "int""'"); +- } +- arg1 = (int)(val1); ++ if (!PyArg_ParseTuple(args,(char *)"O:security_load_booleans",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); ++ if (!SWIG_IsOK(res1)) { ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_load_booleans" "', argument " "1"" of type '" "char *""'"); ++ } ++ arg1 = (char *)(buf1); + { +- res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_selinux_callback, 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "selinux_set_callback" "', argument " "2"" of type '" "union selinux_callback""'"); +- } +- if (!argp2) { +- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "selinux_set_callback" "', argument " "2"" of type '" "union selinux_callback""'"); +- } else { +- arg2 = *((union selinux_callback *)(argp2)); ++ result = (int)security_load_booleans(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } +- selinux_set_callback(arg1,arg2); +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_av(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; - char *arg2 = (char *) 0 ; - security_context_t **arg3 = (security_context_t **) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- access_vector_t arg4 ; +- struct av_decision *arg5 = (struct av_decision *) 0 ; - int result; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -5206,6 +5217,7 @@ - security_context_t *temp3 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- unsigned int val4 ; +- int ecode4 = 0 ; +- void *argp5 = 0 ; +- int res5 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- PyObject * obj4 = 0 ; + int result; - { - arg3 = &temp3; -@@ -5261,7 +5273,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_check_context",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av" "', argument " "1"" of type '" "security_context_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av" "', argument " "2"" of type '" "security_context_t""'"); +- } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_av" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); +- if (!SWIG_IsOK(ecode4)) { +- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "security_compute_av" "', argument " "4"" of type '" "access_vector_t""'"); +- } +- arg4 = (access_vector_t)(val4); +- res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res5)) { +- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "security_compute_av" "', argument " "5"" of type '" "struct av_decision *""'"); ++ { ++ result = (int)security_check_context(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg5 = (struct av_decision *)(argp5); +- result = (int)security_compute_av(arg1,arg2,arg3,arg4,arg5); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_av_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; security_context_t arg1 = (security_context_t) 0 ; - char *arg2 = (char *) 0 ; - security_context_t **arg3 = (security_context_t **) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- access_vector_t arg4 ; +- struct av_decision *arg5 = (struct av_decision *) 0 ; - int result; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -5271,6 +5282,7 @@ - security_context_t *temp3 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- unsigned int val4 ; +- int ecode4 = 0 ; +- void *argp5 = 0 ; +- int res5 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- PyObject * obj4 = 0 ; + int result; - { - arg3 = &temp3; -@@ -5325,12 +5337,12 @@ - PyObject *resultobj = 0; - void *arg1 = (void *) 0 ; - size_t arg2 ; -- int result; - int res1 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:security_load_policy",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); -@@ -5354,12 +5366,12 @@ +- if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_raw",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_check_context_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_raw" "', argument " "1"" of type '" "security_context_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_raw" "', argument " "2"" of type '" "security_context_t""'"); ++ { ++ result = (int)security_check_context_raw(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_av_raw" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); +- if (!SWIG_IsOK(ecode4)) { +- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "security_compute_av_raw" "', argument " "4"" of type '" "access_vector_t""'"); +- } +- arg4 = (access_vector_t)(val4); +- res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res5)) { +- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "security_compute_av_raw" "', argument " "5"" of type '" "struct av_decision *""'"); +- } +- arg5 = (struct av_decision *)(argp5); +- result = (int)security_compute_av_raw(arg1,arg2,arg3,arg4,arg5); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_canonicalize_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; + security_context_t arg1 = (security_context_t) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- security_context_t *arg4 = (security_context_t *) 0 ; - int result; ++ security_context_t *arg2 = (security_context_t *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_context_t temp4 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; + int result; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:security_get_initial_context",&obj0)) SWIG_fail; -@@ -5390,12 +5402,12 @@ +- arg4 = &temp4; +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create",&obj0,&obj1,&obj2)) SWIG_fail; ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create" "', argument " "1"" of type '" "security_context_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create" "', argument " "2"" of type '" "security_context_t""'"); ++ { ++ result = (int)security_canonicalize_context(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_create" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- result = (int)security_compute_create(arg1,arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); +- if (*arg4) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +- freecon(*arg4); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_create_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_canonicalize_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; + security_context_t arg1 = (security_context_t) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- security_context_t *arg4 = (security_context_t *) 0 ; - int result; ++ security_context_t *arg2 = (security_context_t *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:security_get_initial_context_raw",&obj0)) SWIG_fail; -@@ -5425,10 +5437,10 @@ - SWIGINTERN PyObject *_wrap_selinux_mkload_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; -- int result; - int val1 ; - int ecode1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_context_t temp4 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_mkload_policy",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); -@@ -5447,9 +5459,9 @@ - SWIGINTERN PyObject *_wrap_selinux_init_load_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; -- int result; - int temp1 ; - int res1 = SWIG_TMPOBJ ; -+ int result; - - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":selinux_init_load_policy")) SWIG_fail; -@@ -5509,10 +5521,10 @@ - SWIGINTERN PyObject *_wrap_SELboolean_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- arg4 = &temp4; +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create_raw",&obj0,&obj1,&obj2)) SWIG_fail; ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create_raw" "', argument " "1"" of type '" "security_context_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create_raw" "', argument " "2"" of type '" "security_context_t""'"); ++ { ++ result = (int)security_canonicalize_context_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_create_raw" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- result = (int)security_compute_create_raw(arg1,arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); +- if (*arg4) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +- freecon(*arg4); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_relabel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_getenforce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - SELboolean *arg1 = (SELboolean *) 0 ; -- char *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SELboolean_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, 0 | 0 ); -@@ -5551,7 +5563,6 @@ - } - arg2 = (int)(val2); - if (arg1) (arg1)->value = arg2; -- - resultobj = SWIG_Py_Void(); +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- security_context_t *arg4 = (security_context_t *) 0 ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_context_t temp4 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; + +- arg4 = &temp4; +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel",&obj0,&obj1,&obj2)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel" "', argument " "2"" of type '" "security_context_t""'"); ++ if (!PyArg_ParseTuple(args,(char *)":security_getenforce")) SWIG_fail; ++ { ++ result = (int)security_getenforce(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_relabel" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- result = (int)security_compute_relabel(arg1,arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); +- if (*arg4) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +- freecon(*arg4); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -5562,10 +5573,10 @@ - SWIGINTERN PyObject *_wrap_SELboolean_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_relabel_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_setenforce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - SELboolean *arg1 = (SELboolean *) 0 ; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- security_context_t *arg4 = (security_context_t *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_context_t temp4 = 0 ; ++ int arg1 ; ++ int val1 ; ++ int ecode1 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:SELboolean_value_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, 0 | 0 ); -@@ -5586,7 +5597,7 @@ - SELboolean *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_SELboolean")) SWIG_fail; -- result = (SELboolean *)(SELboolean *) calloc(1, sizeof(SELboolean)); -+ result = (SELboolean *)calloc(1, sizeof(SELboolean)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SELboolean, SWIG_POINTER_NEW | 0 ); +- arg4 = &temp4; +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel_raw",&obj0,&obj1,&obj2)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel_raw" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel_raw" "', argument " "2"" of type '" "security_context_t""'"); +- } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_relabel_raw" "', argument " "3"" of type '" "security_class_t""'"); ++ if (!PyArg_ParseTuple(args,(char *)"O:security_setenforce",&obj0)) SWIG_fail; ++ ecode1 = SWIG_AsVal_int(obj0, &val1); ++ if (!SWIG_IsOK(ecode1)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_setenforce" "', argument " "1"" of type '" "int""'"); + } +- arg3 = (security_class_t)(val3); +- result = (int)security_compute_relabel_raw(arg1,arg2,arg3,arg4); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg4) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +- freecon(*arg4); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ arg1 = (int)(val1); ++ { ++ result = (int)security_setenforce(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -5608,7 +5619,6 @@ +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_disable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- security_context_t *arg4 = (security_context_t *) 0 ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_context_t temp4 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; + +- arg4 = &temp4; +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member",&obj0,&obj1,&obj2)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member" "', argument " "2"" of type '" "security_context_t""'"); ++ if (!PyArg_ParseTuple(args,(char *)":security_disable")) SWIG_fail; ++ { ++ result = (int)security_disable(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } } - arg1 = (SELboolean *)(argp1); - free((char *) arg1); -- - resultobj = SWIG_Py_Void(); +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_member" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- result = (int)security_compute_member(arg1,arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); +- if (*arg4) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +- freecon(*arg4); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -5618,7 +5628,7 @@ +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + - SWIGINTERN PyObject *SELboolean_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_SELboolean, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); +-SWIGINTERN PyObject *_wrap_security_compute_member_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_policyvers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- security_class_t arg3 ; +- security_context_t *arg4 = (security_context_t *) 0 ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_context_t temp4 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; + +- arg4 = &temp4; +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member_raw",&obj0,&obj1,&obj2)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member_raw" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member_raw" "', argument " "2"" of type '" "security_context_t""'"); ++ if (!PyArg_ParseTuple(args,(char *)":security_policyvers")) SWIG_fail; ++ { ++ result = (int)security_policyvers(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (security_context_t)(buf2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_compute_member_raw" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- result = (int)security_compute_member_raw(arg1,arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); +- if (*arg4) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +- freecon(*arg4); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; } -@@ -5628,7 +5638,6 @@ - size_t arg1 ; - SELboolean *arg2 = (SELboolean *) 0 ; - int arg3 ; -- int result; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; -@@ -5638,6 +5647,7 @@ - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; -+ int result; + + +-SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_get_boolean_names(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- char *arg2 = (char *) 0 ; +- security_context_t **arg3 = (security_context_t **) 0 ; ++ char ***arg1 = (char ***) 0 ; ++ int *arg2 = (int *) 0 ; ++ char **temp11 ; ++ int temp21 ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- security_context_t *temp3 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:security_set_boolean_list",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); -@@ -5666,11 +5676,11 @@ - SWIGINTERN PyObject *_wrap_security_load_booleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + { +- arg3 = &temp3; +- } +- if (!PyArg_ParseTuple(args,(char *)"OO:security_compute_user",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user" "', argument " "1"" of type '" "security_context_t""'"); ++ arg1 = &temp11; ++ arg2 = &temp21; + } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_user" "', argument " "2"" of type '" "char const *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":security_get_boolean_names")) SWIG_fail; ++ { ++ result = (int)security_get_boolean_names(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (char *)(buf2); +- result = (int)security_compute_user(arg1,(char const *)arg2,arg3); + resultobj = SWIG_From_int((int)(result)); + { +- PyObject* plist; +- int i, len = 0; +- +- if (*arg3) { +- while((*arg3)[len]) +- len++; +- plist = PyList_New(len); +- for (i = 0; i < len; i++) { +- PyList_SetItem(plist, i, PyString_FromString((*arg3)[i])); +- } +- } else { +- plist = PyList_New(0); ++ PyObject* list = PyList_New(*arg2); ++ int i; ++ for (i = 0; i < *arg2; i++) { ++ PyList_SetItem(list, i, PyString_FromString((*arg1)[i])); + } +- +- resultobj = SWIG_Python_AppendOutput(resultobj, plist); ++ resultobj = SWIG_Python_AppendOutput(resultobj, list); + } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + { +- if (*arg3) freeconary(*arg3); ++ int i; ++ if (*arg1) { ++ for (i = 0; i < *arg2; i++) { ++ free((*arg1)[i]); ++ } ++ free(*arg1); ++ } + } + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + { +- if (*arg3) freeconary(*arg3); ++ int i; ++ if (*arg1) { ++ for (i = 0; i < *arg2; i++) { ++ free((*arg1)[i]); ++ } ++ free(*arg1); ++ } + } + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_get_boolean_pending(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; +- security_context_t arg1 = (security_context_t) 0 ; +- char *arg2 = (char *) 0 ; +- security_context_t **arg3 = (security_context_t **) 0 ; - int result; ++ char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- security_context_t *temp3 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:security_load_booleans",&obj0)) SWIG_fail; +- { +- arg3 = &temp3; +- } +- if (!PyArg_ParseTuple(args,(char *)"OO:security_compute_user_raw",&obj0,&obj1)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:security_get_boolean_pending",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -5691,11 +5701,11 @@ - SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user_raw" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_user_raw" "', argument " "2"" of type '" "char const *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_boolean_pending" "', argument " "1"" of type '" "char const *""'"); + } +- arg2 = (char *)(buf2); +- result = (int)security_compute_user_raw(arg1,(char const *)arg2,arg3); +- resultobj = SWIG_From_int((int)(result)); ++ arg1 = (char *)(buf1); + { +- PyObject* plist; +- int i, len = 0; +- +- if (*arg3) { +- while((*arg3)[len]) +- len++; +- plist = PyList_New(len); +- for (i = 0; i < len; i++) { +- PyList_SetItem(plist, i, PyString_FromString((*arg3)[i])); +- } +- } else { +- plist = PyList_New(0); ++ result = (int)security_get_boolean_pending((char const *)arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } +- +- resultobj = SWIG_Python_AppendOutput(resultobj, plist); + } ++ resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- { +- if (*arg3) freeconary(*arg3); +- } + return resultobj; + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- { +- if (*arg3) freeconary(*arg3); +- } + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_load_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_get_boolean_active(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; +- void *arg1 = (void *) 0 ; +- size_t arg2 ; - int result; ++ char *arg1 = (char *) 0 ; int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; +- size_t val2 ; +- int ecode2 = 0 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:security_check_context",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -5716,11 +5726,11 @@ - SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"OO:security_load_policy",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); ++ if (!PyArg_ParseTuple(args,(char *)"O:security_get_boolean_active",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_load_policy" "', argument " "1"" of type '" "void *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_boolean_active" "', argument " "1"" of type '" "char const *""'"); ++ } ++ arg1 = (char *)(buf1); ++ { ++ result = (int)security_get_boolean_active((char const *)arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- ecode2 = SWIG_AsVal_size_t(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_load_policy" "', argument " "2"" of type '" "size_t""'"); +- } +- arg2 = (size_t)(val2); +- result = (int)security_load_policy(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_get_initial_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_set_boolean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; + char *arg1 = (char *) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; - int result; ++ int arg2 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; +- security_context_t temp2 = 0 ; ++ int val2 ; ++ int ecode2 = 0 ; PyObject * obj0 = 0 ; ++ PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:security_check_context_raw",&obj0)) SWIG_fail; +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:security_get_initial_context",&obj0)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"OO:security_set_boolean",&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -5742,12 +5752,12 @@ + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_initial_context" "', argument " "1"" of type '" "char const *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_set_boolean" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)security_get_initial_context((char const *)arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ ecode2 = SWIG_AsVal_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_set_boolean" "', argument " "2"" of type '" "int""'"); ++ } ++ arg2 = (int)(val2); ++ { ++ result = (int)security_set_boolean((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } ++ resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: +@@ -5404,34 +5553,48 @@ + } + + +-SWIGINTERN PyObject *_wrap_security_get_initial_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_commit_booleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context",&obj0)) SWIG_fail; -@@ -5778,12 +5788,12 @@ +- char *arg1 = (char *) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; + +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:security_get_initial_context_raw",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_initial_context_raw" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- result = (int)security_get_initial_context_raw((char const *)arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); ++ if (!PyArg_ParseTuple(args,(char *)":security_commit_booleans")) SWIG_fail; ++ { ++ result = (int)security_commit_booleans(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ resultobj = SWIG_From_int((int)(result)); ++ return resultobj; ++fail: ++ return NULL; ++} ++ ++ ++SWIGINTERN PyObject *_wrap_string_to_security_class(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ PyObject *resultobj = 0; ++ char *arg1 = (char *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ PyObject * obj0 = 0 ; ++ security_class_t result; ++ ++ if (!PyArg_ParseTuple(args,(char *)"O:string_to_security_class",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); ++ if (!SWIG_IsOK(res1)) { ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "string_to_security_class" "', argument " "1"" of type '" "char const *""'"); ++ } ++ arg1 = (char *)(buf1); ++ { ++ result = (security_class_t)string_to_security_class((char const *)arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } ++ resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: +@@ -5440,82 +5603,103 @@ + } + + +-SWIGINTERN PyObject *_wrap_selinux_mkload_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_class_to_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; +- int arg1 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_context_t temp2 = 0 ; +- int val1 ; ++ security_class_t arg1 ; ++ unsigned short val1 ; + int ecode1 = 0 ; PyObject * obj0 = 0 ; -+ int result; ++ char *result = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context_raw",&obj0)) SWIG_fail; -@@ -5826,10 +5836,10 @@ - SWIGINTERN PyObject *_wrap_security_setenforce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_mkload_policy",&obj0)) SWIG_fail; +- ecode1 = SWIG_AsVal_int(obj0, &val1); ++ if (!PyArg_ParseTuple(args,(char *)"O:security_class_to_string",&obj0)) SWIG_fail; ++ ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "selinux_mkload_policy" "', argument " "1"" of type '" "int""'"); ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_class_to_string" "', argument " "1"" of type '" "security_class_t""'"); + } +- arg1 = (int)(val1); +- result = (int)selinux_mkload_policy(arg1); +- resultobj = SWIG_From_int((int)(result)); ++ arg1 = (security_class_t)(val1); ++ { ++ result = (char *)security_class_to_string(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_selinux_init_load_policy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_av_perm_to_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - int arg1 ; +- int *arg1 = (int *) 0 ; - int result; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; -+ int result; +- int temp1 ; +- int res1 = SWIG_TMPOBJ ; ++ security_class_t arg1 ; ++ access_vector_t arg2 ; ++ unsigned short val1 ; ++ int ecode1 = 0 ; ++ unsigned int val2 ; ++ int ecode2 = 0 ; ++ PyObject * obj0 = 0 ; ++ PyObject * obj1 = 0 ; ++ char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:security_setenforce",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); -@@ -5875,9 +5885,9 @@ +- arg1 = &temp1; +- if (!PyArg_ParseTuple(args,(char *)":selinux_init_load_policy")) SWIG_fail; +- result = (int)selinux_init_load_policy(arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (SWIG_IsTmpObj(res1)) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); +- } else { +- int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); ++ if (!PyArg_ParseTuple(args,(char *)"OO:security_av_perm_to_string",&obj0,&obj1)) SWIG_fail; ++ ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); ++ if (!SWIG_IsOK(ecode1)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_av_perm_to_string" "', argument " "1"" of type '" "security_class_t""'"); ++ } ++ arg1 = (security_class_t)(val1); ++ ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_av_perm_to_string" "', argument " "2"" of type '" "access_vector_t""'"); ++ } ++ arg2 = (access_vector_t)(val2); ++ { ++ result = (char *)security_av_perm_to_string(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_SELboolean_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_string_to_av_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char ***arg1 = (char ***) 0 ; - int *arg2 = (int *) 0 ; -- int result; - char **temp11 ; - int temp21 ; -+ int result; +- SELboolean *arg1 = (SELboolean *) 0 ; ++ security_class_t arg1 ; + char *arg2 = (char *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ unsigned short val1 ; ++ int ecode1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; ++ access_vector_t result; - { - arg1 = &temp11; -@@ -5921,11 +5931,11 @@ - SWIGINTERN PyObject *_wrap_security_get_boolean_pending(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"OO:SELboolean_name_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SELboolean_name_set" "', argument " "1"" of type '" "SELboolean *""'"); +- } +- arg1 = (SELboolean *)(argp1); ++ if (!PyArg_ParseTuple(args,(char *)"OO:string_to_av_perm",&obj0,&obj1)) SWIG_fail; ++ ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); ++ if (!SWIG_IsOK(ecode1)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "string_to_av_perm" "', argument " "1"" of type '" "security_class_t""'"); ++ } ++ arg1 = (security_class_t)(val1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SELboolean_name_set" "', argument " "2"" of type '" "char *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "string_to_av_perm" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); +- if (arg1->name) free((char*)arg1->name); +- if (arg2) { +- size_t size = strlen((const char *)(arg2)) + 1; +- arg1->name = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size)); +- } else { +- arg1->name = 0; ++ { ++ result = (access_vector_t)string_to_av_perm(arg1,(char const *)arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: +@@ -5524,205 +5708,319 @@ + } + + +-SWIGINTERN PyObject *_wrap_SELboolean_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_security_av_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; +- SELboolean *arg1 = (SELboolean *) 0 ; +- char *result = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_class_t arg1 ; ++ access_vector_t arg2 ; ++ char **arg3 = (char **) 0 ; ++ unsigned short val1 ; ++ int ecode1 = 0 ; ++ unsigned int val2 ; ++ int ecode2 = 0 ; ++ char *temp3 = 0 ; PyObject * obj0 = 0 ; ++ PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:security_get_boolean_pending",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -5946,11 +5956,11 @@ - SWIGINTERN PyObject *_wrap_security_get_boolean_active(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; +- if (!PyArg_ParseTuple(args,(char *)"O:SELboolean_name_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SELboolean_name_get" "', argument " "1"" of type '" "SELboolean *""'"); ++ arg3 = &temp3; ++ if (!PyArg_ParseTuple(args,(char *)"OO:security_av_string",&obj0,&obj1)) SWIG_fail; ++ ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); ++ if (!SWIG_IsOK(ecode1)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_av_string" "', argument " "1"" of type '" "security_class_t""'"); ++ } ++ arg1 = (security_class_t)(val1); ++ ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_av_string" "', argument " "2"" of type '" "access_vector_t""'"); ++ } ++ arg2 = (access_vector_t)(val2); ++ { ++ result = (int)security_av_string(arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg3) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); ++ free(*arg3); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } +- arg1 = (SELboolean *)(argp1); +- result = (char *) ((arg1)->name); +- resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_SELboolean_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_matchpathcon_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- SELboolean *arg1 = (SELboolean *) 0 ; +- int arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- int val2 ; +- int ecode2 = 0 ; ++ char *arg1 = (char *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:security_get_boolean_active",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -5972,7 +5982,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:SELboolean_value_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"O:matchpathcon_init",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SELboolean_value_set" "', argument " "1"" of type '" "SELboolean *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_init" "', argument " "1"" of type '" "char const *""'"); + } +- arg1 = (SELboolean *)(argp1); +- ecode2 = SWIG_AsVal_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SELboolean_value_set" "', argument " "2"" of type '" "int""'"); +- } +- arg2 = (int)(val2); +- if (arg1) (arg1)->value = arg2; +- +- resultobj = SWIG_Py_Void(); ++ arg1 = (char *)(buf1); ++ { ++ result = (int)matchpathcon_init((char const *)arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_SELboolean_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_matchpathcon_init_prefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; +- SELboolean *arg1 = (SELboolean *) 0 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -5980,6 +5989,7 @@ - int ecode2 = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ char *arg1 = (char *) 0 ; ++ char *arg2 = (char *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; ++ PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:security_set_boolean",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -6056,10 +6066,10 @@ - SWIGINTERN PyObject *_wrap_security_class_mapping_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"O:SELboolean_value_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon_init_prefix",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SELboolean_value_get" "', argument " "1"" of type '" "SELboolean *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_init_prefix" "', argument " "1"" of type '" "char const *""'"); ++ } ++ arg1 = (char *)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "matchpathcon_init_prefix" "', argument " "2"" of type '" "char const *""'"); ++ } ++ arg2 = (char *)(buf2); ++ { ++ result = (int)matchpathcon_init_prefix((char const *)arg1,(char const *)arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (SELboolean *)(argp1); +- result = (int) ((arg1)->value); + resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_new_SELboolean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_matchpathcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; -- char *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ char *result = 0 ; +- SELboolean *result = 0 ; ++ char *arg1 = (char *) 0 ; ++ mode_t arg2 ; ++ security_context_t *arg3 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ unsigned int val2 ; ++ int ecode2 = 0 ; ++ security_context_t temp3 = 0 ; ++ PyObject * obj0 = 0 ; ++ PyObject * obj1 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:security_class_mapping_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); -@@ -6115,10 +6125,10 @@ - SWIGINTERN PyObject *_wrap_security_class_mapping_perms_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)":new_SELboolean")) SWIG_fail; +- result = (SELboolean *)calloc(1, sizeof(SELboolean)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SELboolean, SWIG_POINTER_NEW | 0 ); ++ arg3 = &temp3; ++ if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); ++ if (!SWIG_IsOK(res1)) { ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon" "', argument " "1"" of type '" "char const *""'"); ++ } ++ arg1 = (char *)(buf1); ++ ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon" "', argument " "2"" of type '" "mode_t""'"); ++ } ++ arg2 = (mode_t)(val2); ++ { ++ result = (int)matchpathcon((char const *)arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg3) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); ++ freecon(*arg3); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_delete_SELboolean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_matchpathcon_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; -- char **result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- SELboolean *arg1 = (SELboolean *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ char *arg1 = (char *) 0 ; ++ mode_t arg2 ; ++ security_context_t *arg3 = (security_context_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ unsigned int val2 ; ++ int ecode2 = 0 ; ++ security_context_t temp3 = 0 ; PyObject * obj0 = 0 ; -+ char **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:security_class_mapping_perms_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); -@@ -6139,7 +6149,7 @@ - struct security_class_mapping *result = 0 ; ++ PyObject * obj1 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_security_class_mapping")) SWIG_fail; -- result = (struct security_class_mapping *)(struct security_class_mapping *) calloc(1, sizeof(struct security_class_mapping)); -+ result = (struct security_class_mapping *)calloc(1, sizeof(struct security_class_mapping)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_security_class_mapping, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -6161,7 +6171,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:delete_SELboolean",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SELboolean, SWIG_POINTER_DISOWN | 0 ); ++ arg3 = &temp3; ++ if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon_index",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SELboolean" "', argument " "1"" of type '" "SELboolean *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_index" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct security_class_mapping *)(argp1); - free((char *) arg1); +- arg1 = (SELboolean *)(argp1); +- free((char *) arg1); - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ arg1 = (char *)(buf1); ++ ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon_index" "', argument " "2"" of type '" "mode_t""'"); ++ } ++ arg2 = (mode_t)(val2); ++ { ++ result = (int)matchpathcon_index((char const *)arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg3) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); ++ freecon(*arg3); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -6171,7 +6180,7 @@ - - SWIGINTERN PyObject *security_class_mapping_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_security_class_mapping, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; } -@@ -6179,10 +6188,10 @@ - SWIGINTERN PyObject *_wrap_selinux_set_mapping(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + + +-SWIGINTERN PyObject *SELboolean_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_SELboolean, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_security_set_boolean_list(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_matchpathcon_filespec_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; +- size_t arg1 ; +- SELboolean *arg2 = (SELboolean *) 0 ; +- int arg3 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; +- size_t val1 ; +- int ecode1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- int val3 ; +- int ecode3 = 0 ; ++ ino_t arg1 ; ++ int arg2 ; ++ char *arg3 = (char *) 0 ; ++ void *argp1 ; ++ int res1 = 0 ; ++ int val2 ; ++ int ecode2 = 0 ; ++ int res3 ; ++ char *buf3 = 0 ; ++ int alloc3 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_set_mapping",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); -@@ -6201,11 +6210,11 @@ - SWIGINTERN PyObject *_wrap_string_to_security_class(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"OOO:security_set_boolean_list",&obj0,&obj1,&obj2)) SWIG_fail; +- ecode1 = SWIG_AsVal_size_t(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_set_boolean_list" "', argument " "1"" of type '" "size_t""'"); +- } +- arg1 = (size_t)(val1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SELboolean, 0 | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_set_boolean_list" "', argument " "2"" of type '" "SELboolean *""'"); ++ if (!PyArg_ParseTuple(args,(char *)"OOO:matchpathcon_filespec_add",&obj0,&obj1,&obj2)) SWIG_fail; ++ { ++ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_ino_t, 0 ); ++ if (!SWIG_IsOK(res1)) { ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_filespec_add" "', argument " "1"" of type '" "ino_t""'"); ++ } ++ if (!argp1) { ++ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "matchpathcon_filespec_add" "', argument " "1"" of type '" "ino_t""'"); ++ } else { ++ arg1 = *((ino_t *)(argp1)); ++ } + } +- arg2 = (SELboolean *)(argp2); +- ecode3 = SWIG_AsVal_int(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "security_set_boolean_list" "', argument " "3"" of type '" "int""'"); ++ ecode2 = SWIG_AsVal_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon_filespec_add" "', argument " "2"" of type '" "int""'"); + } +- arg3 = (int)(val3); +- result = (int)security_set_boolean_list(arg1,arg2,arg3); ++ arg2 = (int)(val2); ++ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); ++ if (!SWIG_IsOK(res3)) { ++ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "matchpathcon_filespec_add" "', argument " "3"" of type '" "char const *""'"); ++ } ++ arg3 = (char *)(buf3); ++ { ++ result = (int)matchpathcon_filespec_add(arg1,arg2,(char const *)arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); ++ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return resultobj; + fail: ++ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_load_booleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_matchmediacon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; -- security_class_t result; +- int result; ++ security_context_t *arg2 = (security_context_t *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; -+ security_class_t result; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:string_to_security_class",&obj0)) SWIG_fail; +- if (!PyArg_ParseTuple(args,(char *)"O:security_load_booleans",&obj0)) SWIG_fail; ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:matchmediacon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -6226,10 +6235,10 @@ - SWIGINTERN PyObject *_wrap_security_class_to_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_load_booleans" "', argument " "1"" of type '" "char *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchmediacon" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)security_load_booleans(arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:security_check_context",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context" "', argument " "1"" of type '" "security_context_t""'"); ++ { ++ result = (int)matchmediacon((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (security_context_t)(buf1); +- result = (int)security_check_context(arg1); + resultobj = SWIG_From_int((int)(result)); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: +@@ -5731,361 +6029,286 @@ + } + + +-SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_getenforcemode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_class_t arg1 ; -- char *result = 0 ; - unsigned short val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; +- security_context_t arg1 = (security_context_t) 0 ; ++ int *arg1 = (int *) 0 ; ++ int temp1 ; ++ int res1 = SWIG_TMPOBJ ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"O:security_check_context_raw",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context_raw" "', argument " "1"" of type '" "security_context_t""'"); ++ arg1 = &temp1; ++ if (!PyArg_ParseTuple(args,(char *)":selinux_getenforcemode")) SWIG_fail; ++ { ++ result = (int)selinux_getenforcemode(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (security_context_t)(buf1); +- result = (int)security_check_context_raw(arg1); + resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (SWIG_IsTmpObj(res1)) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); ++ } else { ++ int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); ++ } + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_canonicalize_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_getpolicytype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; ++ char **arg1 = (char **) 0 ; ++ char *temp1 = 0 ; + int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; + +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context" "', argument " "1"" of type '" "security_context_t""'"); ++ arg1 = &temp1; ++ if (!PyArg_ParseTuple(args,(char *)":selinux_getpolicytype")) SWIG_fail; ++ { ++ result = (int)selinux_getpolicytype(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (security_context_t)(buf1); +- result = (int)security_canonicalize_context(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); ++ if (*arg1) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); ++ free(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_canonicalize_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_policy_root(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:security_class_to_string",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); -@@ -6249,13 +6258,13 @@ +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context_raw",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context_raw" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)security_canonicalize_context_raw(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_policy_root")) SWIG_fail; ++ { ++ result = (char *)selinux_policy_root(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_getenforce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_binary_policy_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_class_t arg1 ; - access_vector_t arg2 ; -- char *result = 0 ; - unsigned short val1 ; - int ecode1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; +- int result; + char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:security_av_perm_to_string",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); -@@ -6280,7 +6289,6 @@ +- if (!PyArg_ParseTuple(args,(char *)":security_getenforce")) SWIG_fail; +- result = (int)security_getenforce(); +- resultobj = SWIG_From_int((int)(result)); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_binary_policy_path")) SWIG_fail; ++ { ++ result = (char *)selinux_binary_policy_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_setenforce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_failsafe_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_class_t arg1 ; - char *arg2 = (char *) 0 ; -- access_vector_t result; - unsigned short val1 ; - int ecode1 = 0 ; - int res2 ; -@@ -6288,6 +6296,7 @@ - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ access_vector_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:string_to_av_perm",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); -@@ -6315,7 +6324,6 @@ - security_class_t arg1 ; - access_vector_t arg2 ; - char **arg3 = (char **) 0 ; +- int arg1 ; - int result; - unsigned short val1 ; - int ecode1 = 0 ; - unsigned int val2 ; -@@ -6323,6 +6331,7 @@ - char *temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; +- int val1 ; +- int ecode1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:security_av_string",&obj0,&obj1)) SWIG_fail; -@@ -6406,11 +6415,11 @@ - SWIGINTERN PyObject *_wrap_matchpathcon_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"O:security_setenforce",&obj0)) SWIG_fail; +- ecode1 = SWIG_AsVal_int(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_setenforce" "', argument " "1"" of type '" "int""'"); +- } +- arg1 = (int)(val1); +- result = (int)security_setenforce(arg1); +- resultobj = SWIG_From_int((int)(result)); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_failsafe_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_failsafe_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_disable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_removable_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; -+ int result; ++ char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:matchpathcon_init",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -6432,7 +6441,6 @@ +- if (!PyArg_ParseTuple(args,(char *)":security_disable")) SWIG_fail; +- result = (int)security_disable(); +- resultobj = SWIG_From_int((int)(result)); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_removable_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_removable_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_policyvers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_default_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -6441,6 +6449,7 @@ - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; ++ char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon_init_prefix",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -6482,7 +6491,6 @@ - char *arg1 = (char *) 0 ; - mode_t arg2 ; - security_context_t *arg3 = (security_context_t *) 0 ; +- if (!PyArg_ParseTuple(args,(char *)":security_policyvers")) SWIG_fail; +- result = (int)security_policyvers(); +- resultobj = SWIG_From_int((int)(result)); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_default_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_default_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_get_boolean_names(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_user_contexts_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- char ***arg1 = (char ***) 0 ; +- int *arg2 = (int *) 0 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -6491,6 +6499,7 @@ - security_context_t temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; +- char **temp11 ; +- int temp21 ; ++ char *result = 0 ; - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon",&obj0,&obj1)) SWIG_fail; -@@ -6527,7 +6536,6 @@ - char *arg1 = (char *) 0 ; - mode_t arg2 ; - security_context_t *arg3 = (security_context_t *) 0 ; ++ if (!PyArg_ParseTuple(args,(char *)":selinux_user_contexts_path")) SWIG_fail; + { +- arg1 = &temp11; +- arg2 = &temp21; +- } +- if (!PyArg_ParseTuple(args,(char *)":security_get_boolean_names")) SWIG_fail; +- result = (int)security_get_boolean_names(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- { +- PyObject* list = PyList_New(*arg2); +- int i; +- for (i = 0; i < *arg2; i++) { +- PyList_SetItem(list, i, PyString_FromString((*arg1)[i])); +- } +- resultobj = SWIG_Python_AppendOutput(resultobj, list); +- } +- { +- int i; +- if (*arg1) { +- for (i = 0; i < *arg2; i++) { +- free((*arg1)[i]); +- } +- free(*arg1); ++ result = (char *)selinux_user_contexts_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- { +- int i; +- if (*arg1) { +- for (i = 0; i < *arg2; i++) { +- free((*arg1)[i]); +- } +- free(*arg1); +- } +- } + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_get_boolean_pending(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_file_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -6536,6 +6544,7 @@ - security_context_t temp3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; - arg3 = &temp3; - if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon_index",&obj0,&obj1)) SWIG_fail; -@@ -6572,7 +6581,6 @@ - ino_t arg1 ; - int arg2 ; - char *arg3 = (char *) 0 ; +- if (!PyArg_ParseTuple(args,(char *)"O:security_get_boolean_pending",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_boolean_pending" "', argument " "1"" of type '" "char const *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_file_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- result = (int)security_get_boolean_pending((char const *)arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_get_boolean_active(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_file_context_homedir_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; - int result; - void *argp1 ; - int res1 = 0 ; - int val2 ; -@@ -6583,6 +6591,7 @@ - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; -+ int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:matchpathcon_filespec_add",&obj0,&obj1,&obj2)) SWIG_fail; - { -@@ -6668,12 +6677,12 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:security_get_boolean_active",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_boolean_active" "', argument " "1"" of type '" "char const *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_homedir_path")) SWIG_fail; ++ { ++ result = (char *)selinux_file_context_homedir_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- result = (int)security_get_boolean_active((char const *)arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_set_boolean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_file_context_local_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; +- char *arg1 = (char *) 0 ; +- int arg2 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int val2 ; +- int ecode2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; ++ char *result = 0 ; - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:matchmediacon",&obj0)) SWIG_fail; -@@ -6703,9 +6712,9 @@ - SWIGINTERN PyObject *_wrap_selinux_getenforcemode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"OO:security_set_boolean",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_set_boolean" "', argument " "1"" of type '" "char const *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_local_path")) SWIG_fail; ++ { ++ result = (char *)selinux_file_context_local_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- ecode2 = SWIG_AsVal_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_set_boolean" "', argument " "2"" of type '" "int""'"); +- } +- arg2 = (int)(val2); +- result = (int)security_set_boolean((char const *)arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_commit_booleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_homedir_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - int result; - int temp1 ; - int res1 = SWIG_TMPOBJ ; -+ int result; ++ char *result = 0 ; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":selinux_getenforcemode")) SWIG_fail; -@@ -6726,8 +6735,8 @@ - SWIGINTERN PyObject *_wrap_selinux_getpolicytype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)":security_commit_booleans")) SWIG_fail; +- result = (int)security_commit_booleans(); +- resultobj = SWIG_From_int((int)(result)); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_homedir_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_homedir_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_class_mapping_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_media_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; +- char *arg2 = (char *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"OO:security_class_mapping_name_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_class_mapping_name_set" "', argument " "1"" of type '" "struct security_class_mapping *""'"); +- } +- arg1 = (struct security_class_mapping *)(argp1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_class_mapping_name_set" "', argument " "2"" of type '" "char const *""'"); +- } +- arg2 = (char *)(buf2); +- if (arg2) { +- size_t size = strlen((const char *)((const char *)(arg2))) + 1; +- arg1->name = (char const *)(char *)memcpy((char *)malloc((size)*sizeof(char)), arg2, sizeof(char)*(size)); +- } else { +- arg1->name = 0; ++ if (!PyArg_ParseTuple(args,(char *)":selinux_media_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_media_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- resultobj = SWIG_Py_Void(); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_class_mapping_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_x_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; + char *result = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"O:security_class_mapping_name_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_class_mapping_name_get" "', argument " "1"" of type '" "struct security_class_mapping *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_x_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_x_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct security_class_mapping *)(argp1); +- result = (char *) ((arg1)->name); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +@@ -6093,169 +6316,132 @@ + } + + +-SWIGINTERN PyObject *_wrap_security_class_mapping_perms_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_contexts_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; +- char **arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"OO:security_class_mapping_perms_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_class_mapping_perms_set" "', argument " "1"" of type '" "struct security_class_mapping *""'"); +- } +- arg1 = (struct security_class_mapping *)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_class_mapping_perms_set" "', argument " "2"" of type '" "char const *[sizeof(access_vector_t)*8+1]""'"); +- } +- arg2 = (char **)(argp2); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_contexts_path")) SWIG_fail; + { +- if (arg2) { +- size_t ii = 0; +- for (; ii < (size_t)sizeof(access_vector_t)*8+1; ++ii) arg1->perms[ii] = arg2[ii]; +- } else { +- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""perms""' of type '""char const *[sizeof(access_vector_t)*8+1]""'"); ++ result = (char *)selinux_contexts_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_class_mapping_perms_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_securetty_types_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; +- char **result = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"O:security_class_mapping_perms_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_class_mapping_perms_get" "', argument " "1"" of type '" "struct security_class_mapping *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_securetty_types_path")) SWIG_fail; ++ { ++ result = (char *)selinux_securetty_types_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct security_class_mapping *)(argp1); +- result = (char **)(char **) ((arg1)->perms); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0 ); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_new_security_class_mapping(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_booleans_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct security_class_mapping *result = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)":new_security_class_mapping")) SWIG_fail; +- result = (struct security_class_mapping *)calloc(1, sizeof(struct security_class_mapping)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_security_class_mapping, SWIG_POINTER_NEW | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_booleans_path")) SWIG_fail; ++ { ++ result = (char *)selinux_booleans_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_delete_security_class_mapping(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_customizable_types_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"O:delete_security_class_mapping",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_security_class_mapping" "', argument " "1"" of type '" "struct security_class_mapping *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_customizable_types_path")) SWIG_fail; ++ { ++ result = (char *)selinux_customizable_types_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct security_class_mapping *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *security_class_mapping_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_security_class_mapping, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_selinux_set_mapping(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_users_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - char **arg1 = (char **) 0 ; +- struct security_class_mapping *arg1 = (struct security_class_mapping *) 0 ; - int result; - char *temp1 = 0 ; -+ int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; - arg1 = &temp1; - if (!PyArg_ParseTuple(args,(char *)":selinux_getpolicytype")) SWIG_fail; -@@ -7023,10 +7032,10 @@ - SWIGINTERN PyObject *_wrap_selinux_check_passwd_access(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_set_mapping",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_class_mapping, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_set_mapping" "', argument " "1"" of type '" "struct security_class_mapping *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_users_path")) SWIG_fail; ++ { ++ result = (char *)selinux_users_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct security_class_mapping *)(argp1); +- result = (int)selinux_set_mapping(arg1); +- resultobj = SWIG_From_int((int)(result)); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_string_to_security_class(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_usersconf_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- security_class_t result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"O:string_to_security_class",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "string_to_security_class" "', argument " "1"" of type '" "char const *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_usersconf_path")) SWIG_fail; ++ { ++ result = (char *)selinux_usersconf_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- result = (security_class_t)string_to_security_class((char const *)arg1); +- resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_class_to_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_translations_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - access_vector_t arg1 ; +- security_class_t arg1 ; + char *result = 0 ; +- unsigned short val1 ; +- int ecode1 = 0 ; +- PyObject * obj0 = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"O:security_class_to_string",&obj0)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_class_to_string" "', argument " "1"" of type '" "security_class_t""'"); +- } +- arg1 = (security_class_t)(val1); +- result = (char *)security_class_to_string(arg1); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_translations_path")) SWIG_fail; ++ { ++ result = (char *)selinux_translations_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +@@ -6263,30 +6449,18 @@ + } + + +-SWIGINTERN PyObject *_wrap_security_av_perm_to_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_colors_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_class_t arg1 ; +- access_vector_t arg2 ; + char *result = 0 ; +- unsigned short val1 ; +- int ecode1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"OO:security_av_perm_to_string",&obj0,&obj1)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_av_perm_to_string" "', argument " "1"" of type '" "security_class_t""'"); +- } +- arg1 = (security_class_t)(val1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_av_perm_to_string" "', argument " "2"" of type '" "access_vector_t""'"); +- } +- arg2 = (access_vector_t)(val2); +- result = (char *)security_av_perm_to_string(arg1,arg2); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_colors_path")) SWIG_fail; ++ { ++ result = (char *)selinux_colors_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +@@ -6294,149 +6468,122 @@ + } + + +-SWIGINTERN PyObject *_wrap_string_to_av_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_netfilter_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_class_t arg1 ; +- char *arg2 = (char *) 0 ; +- access_vector_t result; +- unsigned short val1 ; +- int ecode1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; ++ char *result = 0 ; + +- if (!PyArg_ParseTuple(args,(char *)"OO:string_to_av_perm",&obj0,&obj1)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "string_to_av_perm" "', argument " "1"" of type '" "security_class_t""'"); +- } +- arg1 = (security_class_t)(val1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "string_to_av_perm" "', argument " "2"" of type '" "char const *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_netfilter_context_path")) SWIG_fail; ++ { ++ result = (char *)selinux_netfilter_context_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (char *)(buf2); +- result = (access_vector_t)string_to_av_perm(arg1,(char const *)arg2); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_security_av_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_class_t arg1 ; +- access_vector_t arg2 ; +- char **arg3 = (char **) 0 ; - int result; - unsigned int val1 ; +- unsigned short val1 ; +- int ecode1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- char *temp3 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; ++ char *result = 0 ; + +- arg3 = &temp3; +- if (!PyArg_ParseTuple(args,(char *)"OO:security_av_string",&obj0,&obj1)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "security_av_string" "', argument " "1"" of type '" "security_class_t""'"); +- } +- arg1 = (security_class_t)(val1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_av_string" "', argument " "2"" of type '" "access_vector_t""'"); +- } +- arg2 = (access_vector_t)(val2); +- result = (int)security_av_string(arg1,arg2,arg3); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg3) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); +- free(*arg3); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ if (!PyArg_ParseTuple(args,(char *)":selinux_path")) SWIG_fail; ++ { ++ result = (char *)selinux_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } ++ resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_print_access_vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_check_passwd_access(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- security_class_t arg1 ; +- access_vector_t arg2 ; +- unsigned short val1 ; ++ access_vector_t arg1 ; ++ unsigned int val1 ; int ecode1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_passwd_access",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); -@@ -7045,10 +7054,10 @@ - SWIGINTERN PyObject *_wrap_checkPasswdAccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"OO:print_access_vector",&obj0,&obj1)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_passwd_access",&obj0)) SWIG_fail; ++ ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "print_access_vector" "', argument " "1"" of type '" "security_class_t""'"); +- } +- arg1 = (security_class_t)(val1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "print_access_vector" "', argument " "2"" of type '" "access_vector_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "selinux_check_passwd_access" "', argument " "1"" of type '" "access_vector_t""'"); + } +- arg2 = (access_vector_t)(val2); +- print_access_vector(arg1,arg2); +- resultobj = SWIG_Py_Void(); ++ arg1 = (access_vector_t)(val1); ++ { ++ result = (int)selinux_check_passwd_access(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_set_matchpathcon_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_checkPasswdAccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - access_vector_t arg1 ; -- int result; +- unsigned int arg1 ; ++ access_vector_t arg1 ; unsigned int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:checkPasswdAccess",&obj0)) SWIG_fail; +- if (!PyArg_ParseTuple(args,(char *)"O:set_matchpathcon_flags",&obj0)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:checkPasswdAccess",&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); -@@ -7067,11 +7076,11 @@ - SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "set_matchpathcon_flags" "', argument " "1"" of type '" "unsigned int""'"); ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "checkPasswdAccess" "', argument " "1"" of type '" "access_vector_t""'"); + } +- arg1 = (unsigned int)(val1); +- set_matchpathcon_flags(arg1); +- resultobj = SWIG_Py_Void(); ++ arg1 = (access_vector_t)(val1); ++ { ++ result = (int)checkPasswdAccess(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); + return resultobj; + fail: + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_matchpathcon_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; +- char *arg1 = (char *) 0 ; - int result; ++ security_context_t arg1 = (security_context_t) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_securetty_context",&obj0)) SWIG_fail; +- if (!PyArg_ParseTuple(args,(char *)"O:matchpathcon_init",&obj0)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_securetty_context",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -7119,7 +7128,6 @@ + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_init" "', argument " "1"" of type '" "char const *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_check_securetty_context" "', argument " "1"" of type '" "security_context_t""'"); ++ } ++ arg1 = (security_context_t)(buf1); ++ { ++ result = (int)selinux_check_securetty_context(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- result = (int)matchpathcon_init((char const *)arg1); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +@@ -6446,234 +6593,201 @@ + } + + +-SWIGINTERN PyObject *_wrap_matchpathcon_init_prefix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_rpm_execcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; ++ unsigned int arg1 ; char *arg2 = (char *) 0 ; - char **arg3 ; - char **arg4 ; - int result; - unsigned int val1 ; - int ecode1 = 0 ; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; ++ char **arg3 ; ++ char **arg4 ; ++ unsigned int val1 ; ++ int ecode1 = 0 ; int res2 ; -@@ -7129,6 +7137,7 @@ + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; ++ PyObject * obj2 = 0 ; ++ PyObject * obj3 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OOOO:rpm_execcon",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); -@@ -7240,11 +7249,11 @@ - SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon_init_prefix",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_init_prefix" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); ++ if (!PyArg_ParseTuple(args,(char *)"OOOO:rpm_execcon",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; ++ ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); ++ if (!SWIG_IsOK(ecode1)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rpm_execcon" "', argument " "1"" of type '" "unsigned int""'"); ++ } ++ arg1 = (unsigned int)(val1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "matchpathcon_init_prefix" "', argument " "2"" of type '" "char const *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rpm_execcon" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); +- result = (int)matchpathcon_init_prefix((char const *)arg1,(char const *)arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_matchpathcon_fini(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- +- if (!PyArg_ParseTuple(args,(char *)":matchpathcon_fini")) SWIG_fail; +- matchpathcon_fini(); +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_matchpathcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- mode_t arg2 ; +- security_context_t *arg3 = (security_context_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- security_context_t temp3 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- arg3 = &temp3; +- if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon" "', argument " "1"" of type '" "char const *""'"); ++ { ++ int i, size; ++ PyObject * s; ++ ++ if (!PySequence_Check(obj2)) { ++ PyErr_SetString(PyExc_ValueError, "Expected a sequence"); ++ return NULL; ++ } ++ ++ size = PySequence_Size(obj2); ++ ++ arg3 = (char**) malloc(size + 1); ++ ++ for(i = 0; i < size; i++) { ++ if (!PyString_Check(PySequence_GetItem(obj2, i))) { ++ PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings"); ++ return NULL; ++ } ++ } ++ ++ for(i = 0; i < size; i++) { ++ s = PySequence_GetItem(obj2, i); ++ arg3[i] = (char*) malloc(PyString_Size(s) + 1); ++ strcpy(arg3[i], PyString_AsString(s)); ++ } ++ arg3[size] = NULL; ++ } ++ { ++ int i, size; ++ PyObject * s; ++ ++ if (!PySequence_Check(obj3)) { ++ PyErr_SetString(PyExc_ValueError, "Expected a sequence"); ++ return NULL; ++ } ++ ++ size = PySequence_Size(obj3); ++ ++ arg4 = (char**) malloc(size + 1); ++ ++ for(i = 0; i < size; i++) { ++ if (!PyString_Check(PySequence_GetItem(obj3, i))) { ++ PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings"); ++ return NULL; ++ } ++ } ++ ++ for(i = 0; i < size; i++) { ++ s = PySequence_GetItem(obj3, i); ++ arg4[i] = (char*) malloc(PyString_Size(s) + 1); ++ strcpy(arg4[i], PyString_AsString(s)); ++ } ++ arg4[size] = NULL; ++ } ++ { ++ result = (int)rpm_execcon(arg1,(char const *)arg2,(char *const (*))arg3,(char *const (*))arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon" "', argument " "2"" of type '" "mode_t""'"); +- } +- arg2 = (mode_t)(val2); +- result = (int)matchpathcon((char const *)arg1,arg2,arg3); + resultobj = SWIG_From_int((int)(result)); +- if (*arg3) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); +- freecon(*arg3); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ { ++ int i = 0; ++ while(arg3[i]) { ++ free(arg3[i]); ++ i++; ++ } ++ free(arg3); + } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ { ++ int i = 0; ++ while(arg4[i]) { ++ free(arg4[i]); ++ i++; ++ } ++ free(arg4); + } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); ++ { ++ int i = 0; ++ while(arg3[i]) { ++ free(arg3[i]); ++ i++; ++ } ++ free(arg3); ++ } ++ { ++ int i = 0; ++ while(arg4[i]) { ++ free(arg4[i]); ++ i++; ++ } ++ free(arg4); ++ } + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_matchpathcon_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; +- char *arg1 = (char *) 0 ; +- mode_t arg2 ; +- security_context_t *arg3 = (security_context_t *) 0 ; - int result; ++ security_context_t arg1 = (security_context_t) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- security_context_t temp3 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:is_context_customizable",&obj0)) SWIG_fail; +- arg3 = &temp3; +- if (!PyArg_ParseTuple(args,(char *)"OO:matchpathcon_index",&obj0,&obj1)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:is_context_customizable",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -7266,12 +7275,12 @@ - PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_trans_to_raw_context",&obj0)) SWIG_fail; -@@ -7302,12 +7311,12 @@ - PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_to_trans_context",&obj0)) SWIG_fail; -@@ -7339,13 +7348,13 @@ - char *arg1 = (char *) 0 ; - char **arg2 = (char **) 0 ; - char **arg3 = (char **) 0 ; + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_index" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon_index" "', argument " "2"" of type '" "mode_t""'"); +- } +- arg2 = (mode_t)(val2); +- result = (int)matchpathcon_index((char const *)arg1,arg2,arg3); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg3) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); +- freecon(*arg3); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_context_customizable" "', argument " "1"" of type '" "security_context_t""'"); + } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_matchpathcon_filespec_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- ino_t arg1 ; +- int arg2 ; +- char *arg3 = (char *) 0 ; - int result; +- void *argp1 ; +- int res1 = 0 ; +- int val2 ; +- int ecode2 = 0 ; +- int res3 ; +- char *buf3 = 0 ; +- int alloc3 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OOO:matchpathcon_filespec_add",&obj0,&obj1,&obj2)) SWIG_fail; ++ arg1 = (security_context_t)(buf1); + { +- res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_ino_t, 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_filespec_add" "', argument " "1"" of type '" "ino_t""'"); +- } +- if (!argp1) { +- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "matchpathcon_filespec_add" "', argument " "1"" of type '" "ino_t""'"); +- } else { +- arg1 = *((ino_t *)(argp1)); ++ result = (int)is_context_customizable(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; + } + } +- ecode2 = SWIG_AsVal_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon_filespec_add" "', argument " "2"" of type '" "int""'"); +- } +- arg2 = (int)(val2); +- res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); +- if (!SWIG_IsOK(res3)) { +- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "matchpathcon_filespec_add" "', argument " "3"" of type '" "char const *""'"); +- } +- arg3 = (char *)(buf3); +- result = (int)matchpathcon_filespec_add(arg1,arg2,(char const *)arg3); + resultobj = SWIG_From_int((int)(result)); +- if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); +- return resultobj; +-fail: +- if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_matchpathcon_filespec_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- +- if (!PyArg_ParseTuple(args,(char *)":matchpathcon_filespec_destroy")) SWIG_fail; +- matchpathcon_filespec_destroy(); +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_matchpathcon_filespec_eval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- +- if (!PyArg_ParseTuple(args,(char *)":matchpathcon_filespec_eval")) SWIG_fail; +- matchpathcon_filespec_eval(); +- resultobj = SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_matchpathcon_checkmatches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_trans_to_raw_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_context_t *arg2 = (security_context_t *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - char *temp2 = 0 ; - char *temp3 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; + int result; - arg2 = &temp2; - arg3 = &temp3; -@@ -7381,11 +7390,69 @@ - } - - -+SWIGINTERN PyObject *_wrap_getseuser(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { -+ PyObject *resultobj = 0; -+ char *arg1 = (char *) 0 ; -+ char *arg2 = (char *) 0 ; -+ char **arg3 = (char **) 0 ; -+ char **arg4 = (char **) 0 ; -+ int res1 ; -+ char *buf1 = 0 ; -+ int alloc1 = 0 ; -+ int res2 ; -+ char *buf2 = 0 ; -+ int alloc2 = 0 ; -+ char *temp3 = 0 ; -+ char *temp4 = 0 ; -+ PyObject * obj0 = 0 ; -+ PyObject * obj1 = 0 ; -+ int result; -+ -+ arg3 = &temp3; -+ arg4 = &temp4; -+ if (!PyArg_ParseTuple(args,(char *)"OO:getseuser",&obj0,&obj1)) SWIG_fail; -+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -+ if (!SWIG_IsOK(res1)) { -+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getseuser" "', argument " "1"" of type '" "char const *""'"); +- if (!PyArg_ParseTuple(args,(char *)"O:matchpathcon_checkmatches",&obj0)) SWIG_fail; ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_trans_to_raw_context",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_checkmatches" "', argument " "1"" of type '" "char *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_trans_to_raw_context" "', argument " "1"" of type '" "security_context_t""'"); + } -+ arg1 = (char *)(buf1); -+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); -+ if (!SWIG_IsOK(res2)) { -+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "getseuser" "', argument " "2"" of type '" "char const *""'"); ++ arg1 = (security_context_t)(buf1); ++ { ++ result = (int)selinux_trans_to_raw_context(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } -+ arg2 = (char *)(buf2); -+ result = (int)getseuser((char const *)arg1,(char const *)arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); -+ if (*arg3) { -+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); -+ free(*arg3); -+ } -+ else { -+ Py_INCREF(Py_None); -+ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); -+ } -+ if (*arg4) { -+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); -+ free(*arg4); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); -+ } -+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); -+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); -+ return resultobj; -+fail: -+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); -+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); -+ return NULL; -+} -+ -+ - SWIGINTERN PyObject *_wrap_selinux_file_context_cmp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) (security_context_t)0 ; - security_context_t arg2 = (security_context_t) (security_context_t)0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -7394,6 +7461,7 @@ - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:selinux_file_context_cmp",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -7422,7 +7490,6 @@ - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - mode_t arg2 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -7430,6 +7497,7 @@ - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:selinux_file_context_verify",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -7455,11 +7523,11 @@ - SWIGINTERN PyObject *_wrap_selinux_lsetfilecon_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"O:selinux_lsetfilecon_default",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -7519,10 +7587,10 @@ - SWIGINTERN PyObject *_wrap_security_id_ctx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct security_id *arg1 = (struct security_id *) 0 ; -- security_context_t result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ security_context_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:security_id_ctx_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); -@@ -7561,7 +7629,6 @@ - } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->refcnt = arg2; -- - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -7572,10 +7639,10 @@ - SWIGINTERN PyObject *_wrap_security_id_refcnt_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct security_id *arg1 = (struct security_id *) 0 ; -- unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:security_id_refcnt_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); -@@ -7596,7 +7663,7 @@ - struct security_id *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_security_id")) SWIG_fail; -- result = (struct security_id *)(struct security_id *) calloc(1, sizeof(struct security_id)); -+ result = (struct security_id *)calloc(1, sizeof(struct security_id)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_security_id, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -7618,7 +7685,6 @@ } - arg1 = (struct security_id *)(argp1); - free((char *) arg1); -- - resultobj = SWIG_Py_Void(); +- arg1 = (char *)(buf1); +- matchpathcon_checkmatches(arg1); +- resultobj = SWIG_Py_Void(); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -7628,7 +7694,7 @@ - - SWIGINTERN PyObject *security_id_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_security_id, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); +@@ -6682,25 +6796,31 @@ } -@@ -7637,11 +7703,11 @@ - PyObject *resultobj = 0; - security_id_t arg1 = (security_id_t) 0 ; - security_context_t *arg2 = (security_context_t *) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:avc_sid_to_context",&obj0)) SWIG_fail; -@@ -7670,11 +7736,11 @@ + + +-SWIGINTERN PyObject *_wrap_matchmediacon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_raw_to_trans_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_id_t arg1 = (security_id_t) 0 ; +- char *arg1 = (char *) 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - security_context_t temp2 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - arg2 = &temp2; - if (!PyArg_ParseTuple(args,(char *)"O:avc_sid_to_context_raw",&obj0)) SWIG_fail; -@@ -7703,12 +7769,12 @@ - PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; - security_id_t *arg2 = (security_id_t *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_id_t temp2 ; - PyObject * obj0 = 0 ; -+ int result; - - { - arg2 = &temp2; -@@ -7741,12 +7807,12 @@ - PyObject *resultobj = 0; - security_context_t arg1 = (security_context_t) 0 ; - security_id_t *arg2 = (security_id_t *) 0 ; -- int result; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_id_t temp2 ; - PyObject * obj0 = 0 ; -+ int result; - - { - arg2 = &temp2; -@@ -7778,10 +7844,10 @@ - SWIGINTERN PyObject *_wrap_sidget(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - security_id_t arg1 = (security_id_t) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; + security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"O:sidget",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); -@@ -7800,10 +7866,10 @@ - SWIGINTERN PyObject *_wrap_sidput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:matchmediacon",&obj0)) SWIG_fail; ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_to_trans_context",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchmediacon" "', argument " "1"" of type '" "char const *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_to_trans_context" "', argument " "1"" of type '" "security_context_t""'"); ++ } ++ arg1 = (security_context_t)(buf1); ++ { ++ result = (int)selinux_raw_to_trans_context(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (char *)(buf1); +- result = (int)matchmediacon((char const *)arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -6718,2048 +6838,40 @@ + } + + +-SWIGINTERN PyObject *_wrap_selinux_getenforcemode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_raw_context_to_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_id_t arg1 = (security_id_t) 0 ; +- int *arg1 = (int *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"O:sidput",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); -@@ -7823,12 +7889,12 @@ - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - security_id_t *arg2 = (security_id_t *) 0 ; +- int temp1 ; +- int res1 = SWIG_TMPOBJ ; +- +- arg1 = &temp1; +- if (!PyArg_ParseTuple(args,(char *)":selinux_getenforcemode")) SWIG_fail; +- result = (int)selinux_getenforcemode(arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (SWIG_IsTmpObj(res1)) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg1))); +- } else { +- int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ; +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_int, new_flags)); +- } +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_getpolicytype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char **arg1 = (char **) 0 ; - int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - security_id_t temp2 ; +- char *temp1 = 0 ; +- +- arg1 = &temp1; +- if (!PyArg_ParseTuple(args,(char *)":selinux_getpolicytype")) SWIG_fail; +- result = (int)selinux_getpolicytype(arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg1) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +- free(*arg1); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_policy_root(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_policy_root")) SWIG_fail; +- result = (char *)selinux_policy_root(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_binary_policy_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_binary_policy_path")) SWIG_fail; +- result = (char *)selinux_binary_policy_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_failsafe_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_failsafe_context_path")) SWIG_fail; +- result = (char *)selinux_failsafe_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_removable_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_removable_context_path")) SWIG_fail; +- result = (char *)selinux_removable_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_default_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_default_context_path")) SWIG_fail; +- result = (char *)selinux_default_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_user_contexts_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_user_contexts_path")) SWIG_fail; +- result = (char *)selinux_user_contexts_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_file_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_path")) SWIG_fail; +- result = (char *)selinux_file_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_file_context_homedir_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_homedir_path")) SWIG_fail; +- result = (char *)selinux_file_context_homedir_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_file_context_local_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_local_path")) SWIG_fail; +- result = (char *)selinux_file_context_local_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_homedir_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_homedir_context_path")) SWIG_fail; +- result = (char *)selinux_homedir_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_media_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_media_context_path")) SWIG_fail; +- result = (char *)selinux_media_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_x_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_x_context_path")) SWIG_fail; +- result = (char *)selinux_x_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_contexts_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_contexts_path")) SWIG_fail; +- result = (char *)selinux_contexts_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_securetty_types_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_securetty_types_path")) SWIG_fail; +- result = (char *)selinux_securetty_types_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_booleans_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_booleans_path")) SWIG_fail; +- result = (char *)selinux_booleans_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_customizable_types_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_customizable_types_path")) SWIG_fail; +- result = (char *)selinux_customizable_types_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_users_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_users_path")) SWIG_fail; +- result = (char *)selinux_users_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_usersconf_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_usersconf_path")) SWIG_fail; +- result = (char *)selinux_usersconf_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_translations_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_translations_path")) SWIG_fail; +- result = (char *)selinux_translations_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_colors_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_colors_path")) SWIG_fail; +- result = (char *)selinux_colors_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_netfilter_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_netfilter_context_path")) SWIG_fail; +- result = (char *)selinux_netfilter_context_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":selinux_path")) SWIG_fail; +- result = (char *)selinux_path(); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_check_passwd_access(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- access_vector_t arg1 ; +- int result; +- unsigned int val1 ; +- int ecode1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_passwd_access",&obj0)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "selinux_check_passwd_access" "', argument " "1"" of type '" "access_vector_t""'"); +- } +- arg1 = (access_vector_t)(val1); +- result = (int)selinux_check_passwd_access(arg1); +- resultobj = SWIG_From_int((int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_checkPasswdAccess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- access_vector_t arg1 ; +- int result; +- unsigned int val1 ; +- int ecode1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:checkPasswdAccess",&obj0)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "checkPasswdAccess" "', argument " "1"" of type '" "access_vector_t""'"); +- } +- arg1 = (access_vector_t)(val1); +- result = (int)checkPasswdAccess(arg1); +- resultobj = SWIG_From_int((int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_securetty_context",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_check_securetty_context" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)selinux_check_securetty_context(arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_set_selinuxmnt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:set_selinuxmnt",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_selinuxmnt" "', argument " "1"" of type '" "char *""'"); +- } +- arg1 = (char *)(buf1); +- set_selinuxmnt(arg1); +- resultobj = SWIG_Py_Void(); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_rpm_execcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- unsigned int arg1 ; +- char *arg2 = (char *) 0 ; +- char **arg3 ; +- char **arg4 ; +- int result; +- unsigned int val1 ; +- int ecode1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OOOO:rpm_execcon",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; +- ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); +- if (!SWIG_IsOK(ecode1)) { +- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rpm_execcon" "', argument " "1"" of type '" "unsigned int""'"); +- } +- arg1 = (unsigned int)(val1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rpm_execcon" "', argument " "2"" of type '" "char const *""'"); +- } +- arg2 = (char *)(buf2); +- { +- int i, size; +- PyObject * s; +- +- if (!PySequence_Check(obj2)) { +- PyErr_SetString(PyExc_ValueError, "Expected a sequence"); +- return NULL; +- } +- +- size = PySequence_Size(obj2); +- +- arg3 = (char**) malloc(size + 1); +- +- for(i = 0; i < size; i++) { +- if (!PyString_Check(PySequence_GetItem(obj2, i))) { +- PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings"); +- return NULL; +- } +- } +- +- for(i = 0; i < size; i++) { +- s = PySequence_GetItem(obj2, i); +- arg3[i] = (char*) malloc(PyString_Size(s) + 1); +- strcpy(arg3[i], PyString_AsString(s)); +- } +- arg3[size] = NULL; +- } +- { +- int i, size; +- PyObject * s; +- +- if (!PySequence_Check(obj3)) { +- PyErr_SetString(PyExc_ValueError, "Expected a sequence"); +- return NULL; +- } +- +- size = PySequence_Size(obj3); +- +- arg4 = (char**) malloc(size + 1); +- +- for(i = 0; i < size; i++) { +- if (!PyString_Check(PySequence_GetItem(obj3, i))) { +- PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings"); +- return NULL; +- } +- } +- +- for(i = 0; i < size; i++) { +- s = PySequence_GetItem(obj3, i); +- arg4[i] = (char*) malloc(PyString_Size(s) + 1); +- strcpy(arg4[i], PyString_AsString(s)); +- } +- arg4[size] = NULL; +- } +- result = (int)rpm_execcon(arg1,(char const *)arg2,(char *const (*))arg3,(char *const (*))arg4); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- { +- int i = 0; +- while(arg3[i]) { +- free(arg3[i]); +- i++; +- } +- free(arg3); +- } +- { +- int i = 0; +- while(arg4[i]) { +- free(arg4[i]); +- i++; +- } +- free(arg4); +- } +- return resultobj; +-fail: +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- { +- int i = 0; +- while(arg3[i]) { +- free(arg3[i]); +- i++; +- } +- free(arg3); +- } +- { +- int i = 0; +- while(arg4[i]) { +- free(arg4[i]); +- i++; +- } +- free(arg4); +- } +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:is_context_customizable",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_context_customizable" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)is_context_customizable(arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_trans_to_raw_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; +- +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_trans_to_raw_context",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_trans_to_raw_context" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)selinux_trans_to_raw_context(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_raw_to_trans_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; +- +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_to_trans_context",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_to_trans_context" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)selinux_raw_to_trans_context(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_raw_context_to_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- char **arg2 = (char **) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- char *temp2 = 0 ; +- PyObject * obj0 = 0 ; +- +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_context_to_color",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_context_to_color" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)selinux_raw_context_to_color(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- free(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_getseuserbyname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- char **arg2 = (char **) 0 ; +- char **arg3 = (char **) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- char *temp2 = 0 ; +- char *temp3 = 0 ; +- PyObject * obj0 = 0 ; +- +- arg2 = &temp2; +- arg3 = &temp3; +- if (!PyArg_ParseTuple(args,(char *)"O:getseuserbyname",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getseuserbyname" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- result = (int)getseuserbyname((char const *)arg1,arg2,arg3); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- free(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (*arg3) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); +- free(*arg3); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_file_context_cmp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) (security_context_t)0 ; +- security_context_t arg2 = (security_context_t) (security_context_t)0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_file_context_cmp",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_file_context_cmp" "', argument " "1"" of type '" "security_context_t const""'"); +- } +- arg1 = (security_context_t)(buf1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "selinux_file_context_cmp" "', argument " "2"" of type '" "security_context_t const""'"); +- } +- arg2 = (security_context_t)(buf2); +- result = (int)selinux_file_context_cmp(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_file_context_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- mode_t arg2 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:selinux_file_context_verify",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_file_context_verify" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "selinux_file_context_verify" "', argument " "2"" of type '" "mode_t""'"); +- } +- arg2 = (mode_t)(val2); +- result = (int)selinux_file_context_verify((char const *)arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_selinux_lsetfilecon_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:selinux_lsetfilecon_default",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_lsetfilecon_default" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- result = (int)selinux_lsetfilecon_default((char const *)arg1); +- resultobj = SWIG_From_int((int)(result)); +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_security_id_ctx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct security_id *arg1 = (struct security_id *) 0 ; +- security_context_t arg2 = (security_context_t) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- int res2 ; +- char *buf2 = 0 ; +- int alloc2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:security_id_ctx_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_id_ctx_set" "', argument " "1"" of type '" "struct security_id *""'"); +- } +- arg1 = (struct security_id *)(argp1); +- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_id_ctx_set" "', argument " "2"" of type '" "security_context_t""'"); +- } +- arg2 = (security_context_t)(buf2); +- if (arg1->ctx) free((char*)arg1->ctx); +- if (arg2) { +- size_t size = strlen((const char *)(arg2)) + 1; +- arg1->ctx = (security_context_t)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size)); +- } else { +- arg1->ctx = 0; +- } +- resultobj = SWIG_Py_Void(); +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- return resultobj; +-fail: +- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_security_id_ctx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct security_id *arg1 = (struct security_id *) 0 ; +- security_context_t result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:security_id_ctx_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_id_ctx_get" "', argument " "1"" of type '" "struct security_id *""'"); +- } +- arg1 = (struct security_id *)(argp1); +- result = (security_context_t) ((arg1)->ctx); +- resultobj = SWIG_FromCharPtr((const char *)result); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_security_id_refcnt_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct security_id *arg1 = (struct security_id *) 0 ; +- unsigned int arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:security_id_refcnt_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_id_refcnt_set" "', argument " "1"" of type '" "struct security_id *""'"); +- } +- arg1 = (struct security_id *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_id_refcnt_set" "', argument " "2"" of type '" "unsigned int""'"); +- } +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->refcnt = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_security_id_refcnt_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct security_id *arg1 = (struct security_id *) 0 ; +- unsigned int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:security_id_refcnt_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_id_refcnt_get" "', argument " "1"" of type '" "struct security_id *""'"); +- } +- arg1 = (struct security_id *)(argp1); +- result = (unsigned int) ((arg1)->refcnt); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_security_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct security_id *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_security_id")) SWIG_fail; +- result = (struct security_id *)calloc(1, sizeof(struct security_id)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_security_id, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_security_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct security_id *arg1 = (struct security_id *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_security_id",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_security_id" "', argument " "1"" of type '" "struct security_id *""'"); +- } +- arg1 = (struct security_id *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *security_id_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_security_id, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_sid_to_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_id_t arg1 = (security_id_t) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; +- +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:avc_sid_to_context",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_sid_to_context" "', argument " "1"" of type '" "security_id_t""'"); +- } +- arg1 = (security_id_t)(argp1); +- result = (int)avc_sid_to_context(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_sid_to_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_id_t arg1 = (security_id_t) 0 ; +- security_context_t *arg2 = (security_context_t *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- security_context_t temp2 = 0 ; +- PyObject * obj0 = 0 ; +- +- arg2 = &temp2; +- if (!PyArg_ParseTuple(args,(char *)"O:avc_sid_to_context_raw",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_sid_to_context_raw" "', argument " "1"" of type '" "security_id_t""'"); +- } +- arg1 = (security_id_t)(argp1); +- result = (int)avc_sid_to_context_raw(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +- freecon(*arg2); +- } +- else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_context_to_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_id_t *arg2 = (security_id_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_id_t temp2 ; +- PyObject * obj0 = 0 ; +- +- { +- arg2 = &temp2; +- } +- if (!PyArg_ParseTuple(args,(char *)"O:avc_context_to_sid",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)avc_context_to_sid(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- { +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(*arg2, SWIGTYPE_p_security_id, 0)); +- } else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_context_to_sid_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_context_t arg1 = (security_context_t) 0 ; +- security_id_t *arg2 = (security_id_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_id_t temp2 ; +- PyObject * obj0 = 0 ; +- +- { +- arg2 = &temp2; +- } +- if (!PyArg_ParseTuple(args,(char *)"O:avc_context_to_sid_raw",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid_raw" "', argument " "1"" of type '" "security_context_t""'"); +- } +- arg1 = (security_context_t)(buf1); +- result = (int)avc_context_to_sid_raw(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- { +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(*arg2, SWIGTYPE_p_security_id, 0)); +- } else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_sidget(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_id_t arg1 = (security_id_t) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:sidget",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sidget" "', argument " "1"" of type '" "security_id_t""'"); +- } +- arg1 = (security_id_t)(argp1); +- result = (int)sidget(arg1); +- resultobj = SWIG_From_int((int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_sidput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_id_t arg1 = (security_id_t) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:sidput",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sidput" "', argument " "1"" of type '" "security_id_t""'"); +- } +- arg1 = (security_id_t)(argp1); +- result = (int)sidput(arg1); +- resultobj = SWIG_From_int((int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_get_initial_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- security_id_t *arg2 = (security_id_t *) 0 ; +- int result; +- int res1 ; +- char *buf1 = 0 ; +- int alloc1 = 0 ; +- security_id_t temp2 ; +- PyObject * obj0 = 0 ; +- +- { +- arg2 = &temp2; +- } +- if (!PyArg_ParseTuple(args,(char *)"O:avc_get_initial_sid",&obj0)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_get_initial_sid" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- result = (int)avc_get_initial_sid((char const *)arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- { +- if (*arg2) { +- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(*arg2, SWIGTYPE_p_security_id, 0)); +- } else { +- Py_INCREF(Py_None); +- resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); +- } +- } +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return resultobj; +-fail: +- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_entry_ref_ae_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_entry_ref *arg1 = (struct avc_entry_ref *) 0 ; +- struct avc_entry *arg2 = (struct avc_entry *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_entry_ref_ae_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_entry_ref_ae_set" "', argument " "1"" of type '" "struct avc_entry_ref *""'"); +- } +- arg1 = (struct avc_entry_ref *)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_avc_entry, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_entry_ref_ae_set" "', argument " "2"" of type '" "struct avc_entry *""'"); +- } +- arg2 = (struct avc_entry *)(argp2); +- if (arg1) (arg1)->ae = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_entry_ref_ae_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_entry_ref *arg1 = (struct avc_entry_ref *) 0 ; +- struct avc_entry *result = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_entry_ref_ae_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_entry_ref_ae_get" "', argument " "1"" of type '" "struct avc_entry_ref *""'"); +- } +- arg1 = (struct avc_entry_ref *)(argp1); +- result = (struct avc_entry *) ((arg1)->ae); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_entry, 0 | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_avc_entry_ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_entry_ref *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_avc_entry_ref")) SWIG_fail; +- result = (struct avc_entry_ref *)calloc(1, sizeof(struct avc_entry_ref)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_entry_ref, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_avc_entry_ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_entry_ref *arg1 = (struct avc_entry_ref *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_avc_entry_ref",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_entry_ref, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_avc_entry_ref" "', argument " "1"" of type '" "struct avc_entry_ref *""'"); +- } +- arg1 = (struct avc_entry_ref *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *avc_entry_ref_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_avc_entry_ref, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_memory_callback_func_malloc_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; +- void *(*arg2)(size_t) = (void *(*)(size_t)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_memory_callback_func_malloc_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_memory_callback_func_malloc_set" "', argument " "1"" of type '" "struct avc_memory_callback *""'"); +- } +- arg1 = (struct avc_memory_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_size_t__p_void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_memory_callback_func_malloc_set" "', argument " "2"" of type '" "void *(*)(size_t)""'"); +- } +- } +- if (arg1) (arg1)->func_malloc = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_memory_callback_func_malloc_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; +- void *(*result)(size_t) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_memory_callback_func_malloc_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_memory_callback_func_malloc_get" "', argument " "1"" of type '" "struct avc_memory_callback *""'"); +- } +- arg1 = (struct avc_memory_callback *)(argp1); +- result = (void *(*)(size_t)) ((arg1)->func_malloc); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_size_t__p_void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_memory_callback_func_free_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; +- void (*arg2)(void *) = (void (*)(void *)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_memory_callback_func_free_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_memory_callback_func_free_set" "', argument " "1"" of type '" "struct avc_memory_callback *""'"); +- } +- arg1 = (struct avc_memory_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_memory_callback_func_free_set" "', argument " "2"" of type '" "void (*)(void *)""'"); +- } +- } +- if (arg1) (arg1)->func_free = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_memory_callback_func_free_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; +- void (*result)(void *) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_memory_callback_func_free_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_memory_callback_func_free_get" "', argument " "1"" of type '" "struct avc_memory_callback *""'"); +- } +- arg1 = (struct avc_memory_callback *)(argp1); +- result = (void (*)(void *)) ((arg1)->func_free); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_avc_memory_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_memory_callback *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_avc_memory_callback")) SWIG_fail; +- result = (struct avc_memory_callback *)calloc(1, sizeof(struct avc_memory_callback)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_memory_callback, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_avc_memory_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_avc_memory_callback",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_avc_memory_callback" "', argument " "1"" of type '" "struct avc_memory_callback *""'"); +- } +- arg1 = (struct avc_memory_callback *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *avc_memory_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_avc_memory_callback, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_log_callback_func_log_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; +- void (*arg2)(char const *,...) = (void (*)(char const *,...)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_log_callback_func_log_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_log_callback_func_log_set" "', argument " "1"" of type '" "struct avc_log_callback *""'"); +- } +- arg1 = (struct avc_log_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_q_const__char_v_______void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_log_callback_func_log_set" "', argument " "2"" of type '" "void (*)(char const *,...)""'"); +- } +- } +- if (arg1) (arg1)->func_log = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_log_callback_func_log_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; +- void (*result)(char const *,...) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_log_callback_func_log_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_log_callback_func_log_get" "', argument " "1"" of type '" "struct avc_log_callback *""'"); +- } +- arg1 = (struct avc_log_callback *)(argp1); +- result = (void (*)(char const *,...)) ((arg1)->func_log); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__char_v_______void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_log_callback_func_audit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; +- void (*arg2)(void *,security_class_t,char *,size_t) = (void (*)(void *,security_class_t,char *,size_t)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_log_callback_func_audit_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_log_callback_func_audit_set" "', argument " "1"" of type '" "struct avc_log_callback *""'"); +- } +- arg1 = (struct avc_log_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_log_callback_func_audit_set" "', argument " "2"" of type '" "void (*)(void *,security_class_t,char *,size_t)""'"); +- } +- } +- if (arg1) (arg1)->func_audit = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_log_callback_func_audit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; +- void (*result)(void *,security_class_t,char *,size_t) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_log_callback_func_audit_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_log_callback_func_audit_get" "', argument " "1"" of type '" "struct avc_log_callback *""'"); +- } +- arg1 = (struct avc_log_callback *)(argp1); +- result = (void (*)(void *,security_class_t,char *,size_t)) ((arg1)->func_audit); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void_unsigned_short_p_char_size_t__void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_avc_log_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_log_callback *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_avc_log_callback")) SWIG_fail; +- result = (struct avc_log_callback *)calloc(1, sizeof(struct avc_log_callback)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_log_callback, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_avc_log_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_avc_log_callback",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_avc_log_callback" "', argument " "1"" of type '" "struct avc_log_callback *""'"); +- } +- arg1 = (struct avc_log_callback *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *avc_log_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_avc_log_callback, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_thread_callback_func_create_thread_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; +- void *(*arg2)(void (*)(void)) = (void *(*)(void (*)(void))) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_thread_callback_func_create_thread_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_thread_callback_func_create_thread_set" "', argument " "1"" of type '" "struct avc_thread_callback *""'"); +- } +- arg1 = (struct avc_thread_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_f_void__void__p_void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_thread_callback_func_create_thread_set" "', argument " "2"" of type '" "void *(*)(void (*)(void))""'"); +- } +- } +- if (arg1) (arg1)->func_create_thread = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_thread_callback_func_create_thread_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; +- void *(*result)(void (*)(void)) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_thread_callback_func_create_thread_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_thread_callback_func_create_thread_get" "', argument " "1"" of type '" "struct avc_thread_callback *""'"); +- } +- arg1 = (struct avc_thread_callback *)(argp1); +- result = (void *(*)(void (*)(void))) ((arg1)->func_create_thread); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_f_void__void__p_void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_thread_callback_func_stop_thread_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; +- void (*arg2)(void *) = (void (*)(void *)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_thread_callback_func_stop_thread_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_thread_callback_func_stop_thread_set" "', argument " "1"" of type '" "struct avc_thread_callback *""'"); +- } +- arg1 = (struct avc_thread_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_thread_callback_func_stop_thread_set" "', argument " "2"" of type '" "void (*)(void *)""'"); +- } +- } +- if (arg1) (arg1)->func_stop_thread = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_thread_callback_func_stop_thread_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; +- void (*result)(void *) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_thread_callback_func_stop_thread_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_thread_callback_func_stop_thread_get" "', argument " "1"" of type '" "struct avc_thread_callback *""'"); +- } +- arg1 = (struct avc_thread_callback *)(argp1); +- result = (void (*)(void *)) ((arg1)->func_stop_thread); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_avc_thread_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_thread_callback *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_avc_thread_callback")) SWIG_fail; +- result = (struct avc_thread_callback *)calloc(1, sizeof(struct avc_thread_callback)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_thread_callback, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_avc_thread_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_avc_thread_callback",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_avc_thread_callback" "', argument " "1"" of type '" "struct avc_thread_callback *""'"); +- } +- arg1 = (struct avc_thread_callback *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *avc_thread_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_avc_thread_callback, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_alloc_lock_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void *(*arg2)(void) = (void *(*)(void)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_lock_callback_func_alloc_lock_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_alloc_lock_set" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_void__p_void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_lock_callback_func_alloc_lock_set" "', argument " "2"" of type '" "void *(*)(void)""'"); +- } +- } +- if (arg1) (arg1)->func_alloc_lock = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_alloc_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void *(*result)(void) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_alloc_lock_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_alloc_lock_get" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- result = (void *(*)(void)) ((arg1)->func_alloc_lock); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_void__p_void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_get_lock_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void (*arg2)(void *) = (void (*)(void *)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_lock_callback_func_get_lock_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_get_lock_set" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_lock_callback_func_get_lock_set" "', argument " "2"" of type '" "void (*)(void *)""'"); +- } +- } +- if (arg1) (arg1)->func_get_lock = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_get_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void (*result)(void *) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_get_lock_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_get_lock_get" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- result = (void (*)(void *)) ((arg1)->func_get_lock); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_release_lock_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void (*arg2)(void *) = (void (*)(void *)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_lock_callback_func_release_lock_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_release_lock_set" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_lock_callback_func_release_lock_set" "', argument " "2"" of type '" "void (*)(void *)""'"); +- } +- } +- if (arg1) (arg1)->func_release_lock = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_release_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void (*result)(void *) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_release_lock_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_release_lock_get" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- result = (void (*)(void *)) ((arg1)->func_release_lock); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_free_lock_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void (*arg2)(void *) = (void (*)(void *)) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_lock_callback_func_free_lock_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_free_lock_set" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- { +- int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__void); +- if (!SWIG_IsOK(res)) { +- SWIG_exception_fail(SWIG_ArgError(res), "in method '" "avc_lock_callback_func_free_lock_set" "', argument " "2"" of type '" "void (*)(void *)""'"); +- } +- } +- if (arg1) (arg1)->func_free_lock = arg2; +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_lock_callback_func_free_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void (*result)(void *) = 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_free_lock_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_lock_callback_func_free_lock_get" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- result = (void (*)(void *)) ((arg1)->func_free_lock); +- resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__void); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_avc_lock_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *result = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)":new_avc_lock_callback")) SWIG_fail; +- result = (struct avc_lock_callback *)calloc(1, sizeof(struct avc_lock_callback)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_lock_callback, SWIG_POINTER_NEW | 0 ); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_delete_avc_lock_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:delete_avc_lock_callback",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, SWIG_POINTER_DISOWN | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_avc_lock_callback" "', argument " "1"" of type '" "struct avc_lock_callback *""'"); +- } +- arg1 = (struct avc_lock_callback *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *avc_lock_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_avc_lock_callback, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- char *arg1 = (char *) 0 ; +- struct avc_memory_callback *arg2 = (struct avc_memory_callback *) 0 ; +- struct avc_log_callback *arg3 = (struct avc_log_callback *) 0 ; +- struct avc_thread_callback *arg4 = (struct avc_thread_callback *) 0 ; +- struct avc_lock_callback *arg5 = (struct avc_lock_callback *) 0 ; +- int result; ++ security_context_t arg1 = (security_context_t) 0 ; ++ char **arg2 = (char **) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- void *argp3 = 0 ; +- int res3 = 0 ; +- void *argp4 = 0 ; +- int res4 = 0 ; +- void *argp5 = 0 ; +- int res5 = 0 ; ++ char *temp2 = 0 ; + PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- PyObject * obj4 = 0 ; ++ int result; + +- if (!PyArg_ParseTuple(args,(char *)"OOOOO:avc_init",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; +- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_init" "', argument " "1"" of type '" "char const *""'"); +- } +- arg1 = (char *)(buf1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_init" "', argument " "2"" of type '" "struct avc_memory_callback const *""'"); ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_context_to_color",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); ++ if (!SWIG_IsOK(res1)) { ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_context_to_color" "', argument " "1"" of type '" "security_context_t""'"); + } +- arg2 = (struct avc_memory_callback *)(argp2); +- res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_avc_log_callback, 0 | 0 ); +- if (!SWIG_IsOK(res3)) { +- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "avc_init" "', argument " "3"" of type '" "struct avc_log_callback const *""'"); ++ arg1 = (security_context_t)(buf1); ++ { ++ result = (int)selinux_raw_context_to_color(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg3 = (struct avc_log_callback *)(argp3); +- res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); +- if (!SWIG_IsOK(res4)) { +- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "avc_init" "', argument " "4"" of type '" "struct avc_thread_callback const *""'"); ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ free(*arg2); + } +- arg4 = (struct avc_thread_callback *)(argp4); +- res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); +- if (!SWIG_IsOK(res5)) { +- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_init" "', argument " "5"" of type '" "struct avc_lock_callback const *""'"); ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } +- arg5 = (struct avc_lock_callback *)(argp5); +- result = (int)avc_init((char const *)arg1,(struct avc_memory_callback const *)arg2,(struct avc_log_callback const *)arg3,(struct avc_thread_callback const *)arg4,(struct avc_lock_callback const *)arg5); +- resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; + fail: +@@ -8768,584 +6880,574 @@ + } + + +-SWIGINTERN PyObject *_wrap_avc_open(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_getseuserbyname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- unsigned int arg2 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ char *arg1 = (char *) 0 ; ++ char **arg2 = (char **) 0 ; ++ char **arg3 = (char **) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ char *temp2 = 0 ; ++ char *temp3 = 0 ; PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; + int result; - { - arg2 = &temp2; -@@ -7880,7 +7946,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_open",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); ++ arg2 = &temp2; ++ arg3 = &temp3; ++ if (!PyArg_ParseTuple(args,(char *)"O:getseuserbyname",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_open" "', argument " "1"" of type '" "struct selinux_opt *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getseuserbyname" "', argument " "1"" of type '" "char const *""'"); ++ } ++ arg1 = (char *)(buf1); ++ { ++ result = (int)getseuserbyname((char const *)arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } } - arg2 = (struct avc_entry *)(argp2); - if (arg1) (arg1)->ae = arg2; +- arg1 = (struct selinux_opt *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_open" "', argument " "2"" of type '" "unsigned int""'"); +- } +- arg2 = (unsigned int)(val2); +- result = (int)avc_open(arg1,arg2); +- resultobj = SWIG_From_int((int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_cleanup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- +- if (!PyArg_ParseTuple(args,(char *)":avc_cleanup")) SWIG_fail; +- avc_cleanup(); +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- int result; +- +- if (!PyArg_ParseTuple(args,(char *)":avc_reset")) SWIG_fail; +- result = (int)avc_reset(); + resultobj = SWIG_From_int((int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)":avc_destroy")) SWIG_fail; +- avc_destroy(); +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_has_perm_noaudit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- security_id_t arg1 = (security_id_t) 0 ; +- security_id_t arg2 = (security_id_t) 0 ; +- security_class_t arg3 ; +- access_vector_t arg4 ; +- struct avc_entry_ref *arg5 = (struct avc_entry_ref *) 0 ; +- struct av_decision *arg6 = (struct av_decision *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- unsigned int val4 ; +- int ecode4 = 0 ; +- void *argp5 = 0 ; +- int res5 = 0 ; +- void *argp6 = 0 ; +- int res6 = 0 ; +- PyObject * obj0 = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- PyObject * obj4 = 0 ; +- PyObject * obj5 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"OOOOOO:avc_has_perm_noaudit",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_has_perm_noaudit" "', argument " "1"" of type '" "security_id_t""'"); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ free(*arg2); + } +- arg1 = (security_id_t)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_has_perm_noaudit" "', argument " "2"" of type '" "security_id_t""'"); ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } +- arg2 = (security_id_t)(argp2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_has_perm_noaudit" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); +- if (!SWIG_IsOK(ecode4)) { +- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "avc_has_perm_noaudit" "', argument " "4"" of type '" "access_vector_t""'"); +- } +- arg4 = (access_vector_t)(val4); +- res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); +- if (!SWIG_IsOK(res5)) { +- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_has_perm_noaudit" "', argument " "5"" of type '" "struct avc_entry_ref *""'"); ++ if (*arg3) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); ++ free(*arg3); + } +- arg5 = (struct avc_entry_ref *)(argp5); +- res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res6)) { +- SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "avc_has_perm_noaudit" "', argument " "6"" of type '" "struct av_decision *""'"); ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } +- arg6 = (struct av_decision *)(argp6); +- result = (int)avc_has_perm_noaudit(arg1,arg2,arg3,arg4,arg5,arg6); +- resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -7891,10 +7956,10 @@ - SWIGINTERN PyObject *_wrap_avc_entry_ref_ae_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_has_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_getseuser(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_entry_ref *arg1 = (struct avc_entry_ref *) 0 ; -- struct avc_entry *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- security_id_t arg1 = (security_id_t) 0 ; +- security_id_t arg2 = (security_id_t) 0 ; +- security_class_t arg3 ; +- access_vector_t arg4 ; +- struct avc_entry_ref *arg5 = (struct avc_entry_ref *) 0 ; +- void *arg6 = (void *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- unsigned int val4 ; +- int ecode4 = 0 ; +- void *argp5 = 0 ; +- int res5 = 0 ; +- int res6 ; ++ char *arg1 = (char *) 0 ; ++ char *arg2 = (char *) 0 ; ++ char **arg3 = (char **) 0 ; ++ char **arg4 = (char **) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; ++ char *temp3 = 0 ; ++ char *temp4 = 0 ; PyObject * obj0 = 0 ; -+ struct avc_entry *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_entry_ref_ae_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); -@@ -7915,7 +7980,7 @@ - struct avc_entry_ref *result = 0 ; + PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- PyObject * obj4 = 0 ; +- PyObject * obj5 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_avc_entry_ref")) SWIG_fail; -- result = (struct avc_entry_ref *)(struct avc_entry_ref *) calloc(1, sizeof(struct avc_entry_ref)); -+ result = (struct avc_entry_ref *)calloc(1, sizeof(struct avc_entry_ref)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_entry_ref, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -7937,7 +8002,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OOOOOO:avc_has_perm",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); ++ arg3 = &temp3; ++ arg4 = &temp4; ++ if (!PyArg_ParseTuple(args,(char *)"OO:getseuser",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_has_perm" "', argument " "1"" of type '" "security_id_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getseuser" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct avc_entry_ref *)(argp1); - free((char *) arg1); -- - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -7947,7 +8011,7 @@ - - SWIGINTERN PyObject *avc_entry_ref_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_avc_entry_ref, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); - } -@@ -7974,7 +8038,6 @@ - } +- arg1 = (security_id_t)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); ++ arg1 = (char *)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_has_perm" "', argument " "2"" of type '" "security_id_t""'"); +- } +- arg2 = (security_id_t)(argp2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_has_perm" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); +- if (!SWIG_IsOK(ecode4)) { +- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "avc_has_perm" "', argument " "4"" of type '" "access_vector_t""'"); +- } +- arg4 = (access_vector_t)(val4); +- res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); +- if (!SWIG_IsOK(res5)) { +- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_has_perm" "', argument " "5"" of type '" "struct avc_entry_ref *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "getseuser" "', argument " "2"" of type '" "char const *""'"); } - if (arg1) (arg1)->func_malloc = arg2; -- - resultobj = SWIG_Py_Void(); +- arg5 = (struct avc_entry_ref *)(argp5); +- res6 = SWIG_ConvertPtr(obj5,SWIG_as_voidptrptr(&arg6), 0, 0); +- if (!SWIG_IsOK(res6)) { +- SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "avc_has_perm" "', argument " "6"" of type '" "void *""'"); ++ arg2 = (char *)(buf2); ++ { ++ result = (int)getseuser((char const *)arg1,(char const *)arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- result = (int)avc_has_perm(arg1,arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_From_int((int)(result)); ++ if (*arg3) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); ++ free(*arg3); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (*arg4) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); ++ free(*arg4); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -7985,10 +8048,10 @@ - SWIGINTERN PyObject *_wrap_avc_memory_callback_func_malloc_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_audit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_file_context_cmp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; -- void *(*result)(size_t) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- security_id_t arg1 = (security_id_t) 0 ; +- security_id_t arg2 = (security_id_t) 0 ; +- security_class_t arg3 ; +- access_vector_t arg4 ; +- struct av_decision *arg5 = (struct av_decision *) 0 ; +- int arg6 ; +- void *arg7 = (void *) 0 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- unsigned int val4 ; +- int ecode4 = 0 ; +- void *argp5 = 0 ; +- int res5 = 0 ; +- int val6 ; +- int ecode6 = 0 ; +- int res7 ; ++ security_context_t arg1 = (security_context_t) (security_context_t)0 ; ++ security_context_t arg2 = (security_context_t) (security_context_t)0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ int res2 ; ++ char *buf2 = 0 ; ++ int alloc2 = 0 ; PyObject * obj0 = 0 ; -+ void *(*result)(size_t) = 0 ; + PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; +- PyObject * obj3 = 0 ; +- PyObject * obj4 = 0 ; +- PyObject * obj5 = 0 ; +- PyObject * obj6 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_memory_callback_func_malloc_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); -@@ -8026,7 +8089,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:avc_audit",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OO:selinux_file_context_cmp",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_audit" "', argument " "1"" of type '" "security_id_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_file_context_cmp" "', argument " "1"" of type '" "security_context_t const""'"); } - if (arg1) (arg1)->func_free = arg2; -- - resultobj = SWIG_Py_Void(); +- arg1 = (security_id_t)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); ++ arg1 = (security_context_t)(buf1); ++ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_audit" "', argument " "2"" of type '" "security_id_t""'"); +- } +- arg2 = (security_id_t)(argp2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_audit" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); +- if (!SWIG_IsOK(ecode4)) { +- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "avc_audit" "', argument " "4"" of type '" "access_vector_t""'"); +- } +- arg4 = (access_vector_t)(val4); +- res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_av_decision, 0 | 0 ); +- if (!SWIG_IsOK(res5)) { +- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_audit" "', argument " "5"" of type '" "struct av_decision *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "selinux_file_context_cmp" "', argument " "2"" of type '" "security_context_t const""'"); + } +- arg5 = (struct av_decision *)(argp5); +- ecode6 = SWIG_AsVal_int(obj5, &val6); +- if (!SWIG_IsOK(ecode6)) { +- SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "avc_audit" "', argument " "6"" of type '" "int""'"); +- } +- arg6 = (int)(val6); +- res7 = SWIG_ConvertPtr(obj6,SWIG_as_voidptrptr(&arg7), 0, 0); +- if (!SWIG_IsOK(res7)) { +- SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "avc_audit" "', argument " "7"" of type '" "void *""'"); ++ arg2 = (security_context_t)(buf2); ++ { ++ result = (int)selinux_file_context_cmp(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- avc_audit(arg1,arg2,arg3,arg4,arg5,arg6,arg7); +- resultobj = SWIG_Py_Void(); ++ resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: -@@ -8037,10 +8099,10 @@ - SWIGINTERN PyObject *_wrap_avc_memory_callback_func_free_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); ++ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_compute_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_file_context_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_memory_callback *arg1 = (struct avc_memory_callback *) 0 ; -- void (*result)(void *) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- security_id_t arg1 = (security_id_t) 0 ; +- security_id_t arg2 = (security_id_t) 0 ; +- security_class_t arg3 ; +- security_id_t *arg4 = (security_id_t *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_id_t temp4 ; ++ char *arg1 = (char *) 0 ; ++ mode_t arg2 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ unsigned int val2 ; ++ int ecode2 = 0 ; PyObject * obj0 = 0 ; -+ void (*result)(void *) = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_memory_callback_func_free_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); -@@ -8061,7 +8123,7 @@ - struct avc_memory_callback *result = 0 ; + PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_avc_memory_callback")) SWIG_fail; -- result = (struct avc_memory_callback *)(struct avc_memory_callback *) calloc(1, sizeof(struct avc_memory_callback)); -+ result = (struct avc_memory_callback *)calloc(1, sizeof(struct avc_memory_callback)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_memory_callback, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -8083,7 +8145,6 @@ +- { +- arg4 = &temp4; +- } +- if (!PyArg_ParseTuple(args,(char *)"OOO:avc_compute_create",&obj0,&obj1,&obj2)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OO:selinux_file_context_verify",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_compute_create" "', argument " "1"" of type '" "security_id_t""'"); +- } +- arg1 = (security_id_t)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_compute_create" "', argument " "2"" of type '" "security_id_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_file_context_verify" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct avc_memory_callback *)(argp1); - free((char *) arg1); -- - resultobj = SWIG_Py_Void(); +- arg2 = (security_id_t)(argp2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_compute_create" "', argument " "3"" of type '" "security_class_t""'"); ++ arg1 = (char *)(buf1); ++ ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); ++ if (!SWIG_IsOK(ecode2)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "selinux_file_context_verify" "', argument " "2"" of type '" "mode_t""'"); + } +- arg3 = (security_class_t)(val3); +- result = (int)avc_compute_create(arg1,arg2,arg3,arg4); ++ arg2 = (mode_t)(val2); ++ { ++ result = (int)selinux_file_context_verify((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -8093,7 +8154,7 @@ - - SWIGINTERN PyObject *avc_memory_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_avc_memory_callback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; } -@@ -8120,7 +8181,6 @@ - } - } - if (arg1) (arg1)->func_log = arg2; -- - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -8131,10 +8191,10 @@ - SWIGINTERN PyObject *_wrap_avc_log_callback_func_log_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + + +-SWIGINTERN PyObject *_wrap_avc_compute_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_selinux_lsetfilecon_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; -- void (*result)(char const *,...) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- security_id_t arg1 = (security_id_t) 0 ; +- security_id_t arg2 = (security_id_t) 0 ; +- security_class_t arg3 ; +- security_id_t *arg4 = (security_id_t *) 0 ; +- int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- void *argp2 = 0 ; +- int res2 = 0 ; +- unsigned short val3 ; +- int ecode3 = 0 ; +- security_id_t temp4 ; ++ char *arg1 = (char *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; PyObject * obj0 = 0 ; -+ void (*result)(char const *,...) = 0 ; +- PyObject * obj1 = 0 ; +- PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_log_callback_func_log_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, 0 | 0 ); -@@ -8172,7 +8232,6 @@ - } +- { +- arg4 = &temp4; +- } +- if (!PyArg_ParseTuple(args,(char *)"OOO:avc_compute_member",&obj0,&obj1,&obj2)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"O:selinux_lsetfilecon_default",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_compute_member" "', argument " "1"" of type '" "security_id_t""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_lsetfilecon_default" "', argument " "1"" of type '" "char const *""'"); } - if (arg1) (arg1)->func_audit = arg2; -- - resultobj = SWIG_Py_Void(); +- arg1 = (security_id_t)(argp1); +- res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_compute_member" "', argument " "2"" of type '" "security_id_t""'"); ++ arg1 = (char *)(buf1); ++ { ++ result = (int)selinux_lsetfilecon_default((char const *)arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg2 = (security_id_t)(argp2); +- ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); +- if (!SWIG_IsOK(ecode3)) { +- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_compute_member" "', argument " "3"" of type '" "security_class_t""'"); +- } +- arg3 = (security_class_t)(val3); +- result = (int)avc_compute_member(arg1,arg2,arg3,arg4); + resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -8183,10 +8242,10 @@ - SWIGINTERN PyObject *_wrap_avc_log_callback_func_audit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_lookups_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_sid_to_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_log_callback *arg1 = (struct avc_log_callback *) 0 ; -- void (*result)(void *,security_class_t,char *,size_t) = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; ++ security_id_t arg1 = (security_id_t) 0 ; ++ security_context_t *arg2 = (security_context_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; -+ void (*result)(void *,security_class_t,char *,size_t) = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_log_callback_func_audit_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_log_callback, 0 | 0 ); -@@ -8207,7 +8266,7 @@ - struct avc_log_callback *result = 0 ; +- PyObject * obj1 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_avc_log_callback")) SWIG_fail; -- result = (struct avc_log_callback *)(struct avc_log_callback *) calloc(1, sizeof(struct avc_log_callback)); -+ result = (struct avc_log_callback *)calloc(1, sizeof(struct avc_log_callback)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_log_callback, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -8229,7 +8288,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_entry_lookups_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:avc_sid_to_context",&obj0)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_lookups_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_sid_to_context" "', argument " "1"" of type '" "security_id_t""'"); ++ } ++ arg1 = (security_id_t)(argp1); ++ { ++ result = (int)avc_sid_to_context(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); } - arg1 = (struct avc_log_callback *)(argp1); - free((char *) arg1); +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_entry_lookups_set" "', argument " "2"" of type '" "unsigned int""'"); +- } +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->entry_lookups = arg2; - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); return resultobj; fail: -@@ -8239,7 +8297,7 @@ - - SWIGINTERN PyObject *avc_log_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_avc_log_callback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); + return NULL; } -@@ -8266,7 +8324,6 @@ - } - } - if (arg1) (arg1)->func_create_thread = arg2; -- - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -8277,10 +8334,10 @@ - SWIGINTERN PyObject *_wrap_avc_thread_callback_func_create_thread_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_lookups_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_sid_to_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; -- void *(*result)(void (*)(void)) = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int result; ++ security_id_t arg1 = (security_id_t) 0 ; ++ security_context_t *arg2 = (security_context_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; ++ security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; -+ void *(*result)(void (*)(void)) = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_thread_callback_func_create_thread_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); -@@ -8318,7 +8375,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_lookups_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ arg2 = &temp2; ++ if (!PyArg_ParseTuple(args,(char *)"O:avc_sid_to_context_raw",&obj0)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_lookups_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_sid_to_context_raw" "', argument " "1"" of type '" "security_id_t""'"); ++ } ++ arg1 = (security_id_t)(argp1); ++ { ++ result = (int)avc_sid_to_context_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); ++ freecon(*arg2); ++ } ++ else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); } - if (arg1) (arg1)->func_stop_thread = arg2; -- - resultobj = SWIG_Py_Void(); +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->entry_lookups); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); return resultobj; fail: -@@ -8329,10 +8385,10 @@ - SWIGINTERN PyObject *_wrap_avc_thread_callback_func_stop_thread_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_hits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_context_to_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_thread_callback *arg1 = (struct avc_thread_callback *) 0 ; -- void (*result)(void *) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_id_t *arg2 = (security_id_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ security_id_t temp2 ; PyObject * obj0 = 0 ; -+ void (*result)(void *) = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_thread_callback_func_stop_thread_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); -@@ -8353,7 +8409,7 @@ - struct avc_thread_callback *result = 0 ; +- PyObject * obj1 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_avc_thread_callback")) SWIG_fail; -- result = (struct avc_thread_callback *)(struct avc_thread_callback *) calloc(1, sizeof(struct avc_thread_callback)); -+ result = (struct avc_thread_callback *)calloc(1, sizeof(struct avc_thread_callback)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_thread_callback, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -8375,7 +8431,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_entry_hits_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ { ++ arg2 = &temp2; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"O:avc_context_to_sid",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_hits_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid" "', argument " "1"" of type '" "security_context_t""'"); } - arg1 = (struct avc_thread_callback *)(argp1); - free((char *) arg1); +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_entry_hits_set" "', argument " "2"" of type '" "unsigned int""'"); +- } +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->entry_hits = arg2; - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ arg1 = (security_context_t)(buf1); ++ { ++ result = (int)avc_context_to_sid(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ { ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(*arg2, SWIGTYPE_p_security_id, 0)); ++ } else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -8385,7 +8440,7 @@ - - SWIGINTERN PyObject *avc_thread_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_avc_thread_callback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; } -@@ -8412,7 +8467,6 @@ - } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_hits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_context_to_sid_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int result; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ security_context_t arg1 = (security_context_t) 0 ; ++ security_id_t *arg2 = (security_id_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ security_id_t temp2 ; + PyObject * obj0 = 0 ; ++ int result; + +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_hits_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ { ++ arg2 = &temp2; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"O:avc_context_to_sid_raw",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_hits_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid_raw" "', argument " "1"" of type '" "security_context_t""'"); } - if (arg1) (arg1)->func_alloc_lock = arg2; -- - resultobj = SWIG_Py_Void(); +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->entry_hits); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg1 = (security_context_t)(buf1); ++ { ++ result = (int)avc_context_to_sid_raw(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ { ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(*arg2, SWIGTYPE_p_security_id, 0)); ++ } else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -8423,10 +8477,10 @@ - SWIGINTERN PyObject *_wrap_avc_lock_callback_func_alloc_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_misses_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_sidget(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; -- void *(*result)(void) = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; ++ security_id_t arg1 = (security_id_t) 0 ; void *argp1 = 0 ; int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; PyObject * obj0 = 0 ; -+ void *(*result)(void) = 0 ; +- PyObject * obj1 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_alloc_lock_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); -@@ -8464,7 +8518,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_entry_misses_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"O:sidget",&obj0)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_misses_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sidget" "', argument " "1"" of type '" "security_id_t""'"); } - if (arg1) (arg1)->func_get_lock = arg2; +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_entry_misses_set" "', argument " "2"" of type '" "unsigned int""'"); +- } +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->entry_misses = arg2; - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ arg1 = (security_id_t)(argp1); ++ { ++ result = (int)sidget(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -8475,10 +8528,10 @@ - SWIGINTERN PyObject *_wrap_avc_lock_callback_func_get_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_misses_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_sidput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; -- void (*result)(void *) = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int result; ++ security_id_t arg1 = (security_id_t) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; -+ void (*result)(void *) = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_get_lock_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); -@@ -8516,7 +8569,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_misses_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"O:sidput",&obj0)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_misses_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sidput" "', argument " "1"" of type '" "security_id_t""'"); } - if (arg1) (arg1)->func_release_lock = arg2; -- - resultobj = SWIG_Py_Void(); +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->entry_misses); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg1 = (security_id_t)(argp1); ++ { ++ result = (int)sidput(arg1); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -8527,10 +8579,10 @@ - SWIGINTERN PyObject *_wrap_avc_lock_callback_func_release_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_discards_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_get_initial_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; -- void (*result)(void *) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; +- void *argp1 = 0 ; +- int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ char *arg1 = (char *) 0 ; ++ security_id_t *arg2 = (security_id_t *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ security_id_t temp2 ; PyObject * obj0 = 0 ; -+ void (*result)(void *) = 0 ; +- PyObject * obj1 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_release_lock_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); -@@ -8568,7 +8620,6 @@ - } +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_entry_discards_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ { ++ arg2 = &temp2; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"O:avc_get_initial_sid",&obj0)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_discards_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_get_initial_sid" "', argument " "1"" of type '" "char const *""'"); } - if (arg1) (arg1)->func_free_lock = arg2; +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_entry_discards_set" "', argument " "2"" of type '" "unsigned int""'"); +- } +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->entry_discards = arg2; - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ arg1 = (char *)(buf1); ++ { ++ result = (int)avc_get_initial_sid((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ { ++ if (*arg2) { ++ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj(*arg2, SWIGTYPE_p_security_id, 0)); ++ } else { ++ Py_INCREF(Py_None); ++ resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); ++ } ++ } ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -8579,10 +8630,10 @@ - SWIGINTERN PyObject *_wrap_avc_lock_callback_func_free_lock_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_discards_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_lock_callback *arg1 = (struct avc_lock_callback *) 0 ; -- void (*result)(void *) = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int result; +- void *argp1 = 0 ; +- int res1 = 0 ; ++ char *arg1 = (char *) 0 ; ++ struct avc_memory_callback *arg2 = (struct avc_memory_callback *) 0 ; ++ struct avc_log_callback *arg3 = (struct avc_log_callback *) 0 ; ++ struct avc_thread_callback *arg4 = (struct avc_thread_callback *) 0 ; ++ struct avc_lock_callback *arg5 = (struct avc_lock_callback *) 0 ; ++ int res1 ; ++ char *buf1 = 0 ; ++ int alloc1 = 0 ; ++ void *argp2 = 0 ; ++ int res2 = 0 ; ++ void *argp3 = 0 ; ++ int res3 = 0 ; ++ void *argp4 = 0 ; ++ int res4 = 0 ; ++ void *argp5 = 0 ; ++ int res5 = 0 ; PyObject * obj0 = 0 ; -+ void (*result)(void *) = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_lock_callback_func_free_lock_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); -@@ -8603,7 +8654,7 @@ - struct avc_lock_callback *result = 0 ; ++ PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ PyObject * obj3 = 0 ; ++ PyObject * obj4 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_avc_lock_callback")) SWIG_fail; -- result = (struct avc_lock_callback *)(struct avc_lock_callback *) calloc(1, sizeof(struct avc_lock_callback)); -+ result = (struct avc_lock_callback *)calloc(1, sizeof(struct avc_lock_callback)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_lock_callback, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -8625,7 +8676,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_discards_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OOOOO:avc_init",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; ++ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_entry_discards_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_init" "', argument " "1"" of type '" "char const *""'"); } - arg1 = (struct avc_lock_callback *)(argp1); - free((char *) arg1); -- - resultobj = SWIG_Py_Void(); +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->entry_discards); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg1 = (char *)(buf1); ++ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_avc_memory_callback, 0 | 0 ); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_init" "', argument " "2"" of type '" "struct avc_memory_callback const *""'"); ++ } ++ arg2 = (struct avc_memory_callback *)(argp2); ++ res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_avc_log_callback, 0 | 0 ); ++ if (!SWIG_IsOK(res3)) { ++ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "avc_init" "', argument " "3"" of type '" "struct avc_log_callback const *""'"); ++ } ++ arg3 = (struct avc_log_callback *)(argp3); ++ res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_avc_thread_callback, 0 | 0 ); ++ if (!SWIG_IsOK(res4)) { ++ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "avc_init" "', argument " "4"" of type '" "struct avc_thread_callback const *""'"); ++ } ++ arg4 = (struct avc_thread_callback *)(argp4); ++ res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_avc_lock_callback, 0 | 0 ); ++ if (!SWIG_IsOK(res5)) { ++ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_init" "', argument " "5"" of type '" "struct avc_lock_callback const *""'"); ++ } ++ arg5 = (struct avc_lock_callback *)(argp5); ++ { ++ result = (int)avc_init((char const *)arg1,(struct avc_memory_callback const *)arg2,(struct avc_log_callback const *)arg3,(struct avc_thread_callback const *)arg4,(struct avc_lock_callback const *)arg5); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: -@@ -8635,7 +8685,7 @@ - - SWIGINTERN PyObject *avc_lock_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_avc_lock_callback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); ++ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; } -@@ -8647,7 +8697,6 @@ - struct avc_log_callback *arg3 = (struct avc_log_callback *) 0 ; - struct avc_thread_callback *arg4 = (struct avc_thread_callback *) 0 ; - struct avc_lock_callback *arg5 = (struct avc_lock_callback *) 0 ; -- int result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; -@@ -8664,6 +8713,7 @@ - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:avc_init",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); -@@ -8705,13 +8755,13 @@ + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_lookups_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_open(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; ++ struct selinux_opt *arg1 = (struct selinux_opt *) 0 ; unsigned int arg2 ; -- int result; void *argp1 = 0 ; int res1 = 0 ; - unsigned int val2 ; +@@ -9353,268 +7455,292 @@ int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + int result; - if (!PyArg_ParseTuple(args,(char *)"OO:avc_open",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); -@@ -8777,7 +8827,6 @@ - access_vector_t arg4 ; - struct avc_entry_ref *arg5 = (struct avc_entry_ref *) 0 ; - struct av_decision *arg6 = (struct av_decision *) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; -@@ -8796,6 +8845,7 @@ - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:avc_has_perm_noaudit",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); -@@ -8844,7 +8894,6 @@ - access_vector_t arg4 ; - struct avc_entry_ref *arg5 = (struct avc_entry_ref *) 0 ; - void *arg6 = (void *) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; -@@ -8862,6 +8911,7 @@ - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; -+ int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:avc_has_perm",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); -@@ -8980,7 +9030,6 @@ - security_id_t arg2 = (security_id_t) 0 ; - security_class_t arg3 ; - security_id_t *arg4 = (security_id_t *) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; -@@ -8991,6 +9040,7 @@ - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; -+ int result; - - { - arg4 = &temp4; -@@ -9025,7 +9075,6 @@ - security_id_t arg2 = (security_id_t) 0 ; - security_class_t arg3 ; - security_id_t *arg4 = (security_id_t *) 0 ; -- int result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; -@@ -9036,6 +9085,7 @@ - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; -+ int result; - - { - arg4 = &temp4; -@@ -9087,7 +9137,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_cav_lookups_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OO:avc_open",&obj0,&obj1)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_selinux_opt, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_lookups_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_open" "', argument " "1"" of type '" "struct selinux_opt *""'"); + } +- arg1 = (struct avc_cache_stats *)(argp1); ++ arg1 = (struct selinux_opt *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_cav_lookups_set" "', argument " "2"" of type '" "unsigned int""'"); ++ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_open" "', argument " "2"" of type '" "unsigned int""'"); } arg2 = (unsigned int)(val2); - if (arg1) (arg1)->entry_lookups = arg2; +- if (arg1) (arg1)->cav_lookups = arg2; - - resultobj = SWIG_Py_Void(); +- resultobj = SWIG_Py_Void(); ++ { ++ result = (int)avc_open(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -9098,10 +9147,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_lookups_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_lookups_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ unsigned int result; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_lookups_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9140,7 +9189,6 @@ - } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->entry_hits = arg2; -- - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_lookups_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_lookups_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ if (!PyArg_ParseTuple(args,(char *)":avc_reset")) SWIG_fail; ++ { ++ result = (int)avc_reset(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->cav_lookups); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -9151,10 +9199,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_hits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_hits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_has_perm_noaudit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; -- unsigned int result; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; ++ security_id_t arg1 = (security_id_t) 0 ; ++ security_id_t arg2 = (security_id_t) 0 ; ++ security_class_t arg3 ; ++ access_vector_t arg4 ; ++ struct avc_entry_ref *arg5 = (struct avc_entry_ref *) 0 ; ++ struct av_decision *arg6 = (struct av_decision *) 0 ; void *argp1 = 0 ; int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ void *argp2 = 0 ; ++ int res2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ unsigned int val4 ; ++ int ecode4 = 0 ; ++ void *argp5 = 0 ; ++ int res5 = 0 ; ++ void *argp6 = 0 ; ++ int res6 = 0 ; PyObject * obj0 = 0 ; -+ unsigned int result; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ PyObject * obj3 = 0 ; ++ PyObject * obj4 = 0 ; ++ PyObject * obj5 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_hits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9193,7 +9241,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_cav_hits_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OOOOOO:avc_has_perm_noaudit",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_hits_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_has_perm_noaudit" "', argument " "1"" of type '" "security_id_t""'"); + } +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_cav_hits_set" "', argument " "2"" of type '" "unsigned int""'"); ++ arg1 = (security_id_t)(argp1); ++ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_has_perm_noaudit" "', argument " "2"" of type '" "security_id_t""'"); ++ } ++ arg2 = (security_id_t)(argp2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_has_perm_noaudit" "', argument " "3"" of type '" "security_class_t""'"); } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->entry_misses = arg2; +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->cav_hits = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -9204,10 +9251,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_misses_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_hits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_misses_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9246,7 +9293,6 @@ - } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->entry_discards = arg2; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_hits_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_hits_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ arg3 = (security_class_t)(val3); ++ ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); ++ if (!SWIG_IsOK(ecode4)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "avc_has_perm_noaudit" "', argument " "4"" of type '" "access_vector_t""'"); ++ } ++ arg4 = (access_vector_t)(val4); ++ res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); ++ if (!SWIG_IsOK(res5)) { ++ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_has_perm_noaudit" "', argument " "5"" of type '" "struct avc_entry_ref *""'"); ++ } ++ arg5 = (struct avc_entry_ref *)(argp5); ++ res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_av_decision, 0 | 0 ); ++ if (!SWIG_IsOK(res6)) { ++ SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "avc_has_perm_noaudit" "', argument " "6"" of type '" "struct av_decision *""'"); + } +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->cav_hits); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg6 = (struct av_decision *)(argp6); ++ { ++ result = (int)avc_has_perm_noaudit(arg1,arg2,arg3,arg4,arg5,arg6); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -9257,10 +9303,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_entry_discards_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_probes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_has_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; -- unsigned int result; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; ++ security_id_t arg1 = (security_id_t) 0 ; ++ security_id_t arg2 = (security_id_t) 0 ; ++ security_class_t arg3 ; ++ access_vector_t arg4 ; ++ struct avc_entry_ref *arg5 = (struct avc_entry_ref *) 0 ; ++ void *arg6 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ void *argp2 = 0 ; ++ int res2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ unsigned int val4 ; ++ int ecode4 = 0 ; ++ void *argp5 = 0 ; ++ int res5 = 0 ; ++ int res6 ; PyObject * obj0 = 0 ; -+ unsigned int result; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ PyObject * obj3 = 0 ; ++ PyObject * obj4 = 0 ; ++ PyObject * obj5 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_entry_discards_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9299,7 +9345,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_cav_probes_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ if (!PyArg_ParseTuple(args,(char *)"OOOOOO:avc_has_perm",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_probes_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_has_perm" "', argument " "1"" of type '" "security_id_t""'"); + } +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_cav_probes_set" "', argument " "2"" of type '" "unsigned int""'"); ++ arg1 = (security_id_t)(argp1); ++ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_has_perm" "', argument " "2"" of type '" "security_id_t""'"); ++ } ++ arg2 = (security_id_t)(argp2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_has_perm" "', argument " "3"" of type '" "security_class_t""'"); } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->cav_lookups = arg2; +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->cav_probes = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -9310,10 +9355,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_lookups_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_probes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_lookups_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9352,7 +9397,6 @@ - } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->cav_hits = arg2; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_probes_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_probes_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ arg3 = (security_class_t)(val3); ++ ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); ++ if (!SWIG_IsOK(ecode4)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "avc_has_perm" "', argument " "4"" of type '" "access_vector_t""'"); ++ } ++ arg4 = (access_vector_t)(val4); ++ res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_avc_entry_ref, 0 | 0 ); ++ if (!SWIG_IsOK(res5)) { ++ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "avc_has_perm" "', argument " "5"" of type '" "struct avc_entry_ref *""'"); + } +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->cav_probes); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); ++ arg5 = (struct avc_entry_ref *)(argp5); ++ res6 = SWIG_ConvertPtr(obj5,SWIG_as_voidptrptr(&arg6), 0, 0); ++ if (!SWIG_IsOK(res6)) { ++ SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "avc_has_perm" "', argument " "6"" of type '" "void *""'"); ++ } ++ { ++ result = (int)avc_has_perm(arg1,arg2,arg3,arg4,arg5,arg6); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -9363,10 +9407,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_hits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_misses_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_compute_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; -- unsigned int result; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- unsigned int arg2 ; ++ security_id_t arg1 = (security_id_t) 0 ; ++ security_id_t arg2 = (security_id_t) 0 ; ++ security_class_t arg3 ; ++ security_id_t *arg4 = (security_id_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; +- unsigned int val2 ; +- int ecode2 = 0 ; ++ void *argp2 = 0 ; ++ int res2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_id_t temp4 ; PyObject * obj0 = 0 ; -+ unsigned int result; + PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_hits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9405,7 +9449,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"OO:avc_cache_stats_cav_misses_set",&obj0,&obj1)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); ++ { ++ arg4 = &temp4; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"OOO:avc_compute_create",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_misses_set" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_compute_create" "', argument " "1"" of type '" "security_id_t""'"); + } +- arg1 = (struct avc_cache_stats *)(argp1); +- ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); +- if (!SWIG_IsOK(ecode2)) { +- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "avc_cache_stats_cav_misses_set" "', argument " "2"" of type '" "unsigned int""'"); ++ arg1 = (security_id_t)(argp1); ++ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_compute_create" "', argument " "2"" of type '" "security_id_t""'"); ++ } ++ arg2 = (security_id_t)(argp2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_compute_create" "', argument " "3"" of type '" "security_class_t""'"); } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->cav_probes = arg2; +- arg2 = (unsigned int)(val2); +- if (arg1) (arg1)->cav_misses = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; - fail: -@@ -9416,10 +9459,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_probes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_misses_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; -+ unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_probes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9458,7 +9501,6 @@ - } - arg2 = (unsigned int)(val2); - if (arg1) (arg1)->cav_misses = arg2; +- void *argp1 = 0 ; +- int res1 = 0 ; +- PyObject * obj0 = 0 ; +- +- if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_misses_get",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); +- if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_cache_stats_cav_misses_get" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)avc_compute_create(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } + } +- arg1 = (struct avc_cache_stats *)(argp1); +- result = (unsigned int) ((arg1)->cav_misses); +- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_new_avc_cache_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- struct avc_cache_stats *result = 0 ; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)":new_avc_cache_stats")) SWIG_fail; +- result = (struct avc_cache_stats *)calloc(1, sizeof(struct avc_cache_stats)); +- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_cache_stats, SWIG_POINTER_NEW | 0 ); ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -9469,10 +9511,10 @@ - SWIGINTERN PyObject *_wrap_avc_cache_stats_cav_misses_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return NULL; + } + + +-SWIGINTERN PyObject *_wrap_delete_avc_cache_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { ++SWIGINTERN PyObject *_wrap_avc_compute_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; -- unsigned int result; +- struct avc_cache_stats *arg1 = (struct avc_cache_stats *) 0 ; ++ security_id_t arg1 = (security_id_t) 0 ; ++ security_id_t arg2 = (security_id_t) 0 ; ++ security_class_t arg3 ; ++ security_id_t *arg4 = (security_id_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; ++ void *argp2 = 0 ; ++ int res2 = 0 ; ++ unsigned short val3 ; ++ int ecode3 = 0 ; ++ security_id_t temp4 ; PyObject * obj0 = 0 ; -+ unsigned int result; - - if (!PyArg_ParseTuple(args,(char *)"O:avc_cache_stats_cav_misses_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, 0 | 0 ); -@@ -9493,7 +9535,7 @@ - struct avc_cache_stats *result = 0 ; ++ PyObject * obj1 = 0 ; ++ PyObject * obj2 = 0 ; ++ int result; - if (!PyArg_ParseTuple(args,(char *)":new_avc_cache_stats")) SWIG_fail; -- result = (struct avc_cache_stats *)(struct avc_cache_stats *) calloc(1, sizeof(struct avc_cache_stats)); -+ result = (struct avc_cache_stats *)calloc(1, sizeof(struct avc_cache_stats)); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_cache_stats, SWIG_POINTER_NEW | 0 ); - return resultobj; - fail: -@@ -9515,7 +9557,6 @@ +- if (!PyArg_ParseTuple(args,(char *)"O:delete_avc_cache_stats",&obj0)) SWIG_fail; +- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_avc_cache_stats, SWIG_POINTER_DISOWN | 0 ); ++ { ++ arg4 = &temp4; ++ } ++ if (!PyArg_ParseTuple(args,(char *)"OOO:avc_compute_member",&obj0,&obj1,&obj2)) SWIG_fail; ++ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_id, 0 | 0 ); + if (!SWIG_IsOK(res1)) { +- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_avc_cache_stats" "', argument " "1"" of type '" "struct avc_cache_stats *""'"); ++ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_compute_member" "', argument " "1"" of type '" "security_id_t""'"); } - arg1 = (struct avc_cache_stats *)(argp1); - free((char *) arg1); +- arg1 = (struct avc_cache_stats *)(argp1); +- free((char *) arg1); +- +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *avc_cache_stats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *obj; +- if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; +- SWIG_TypeNewClientData(SWIGTYPE_p_avc_cache_stats, SWIG_NewClientData(obj)); +- return SWIG_Py_Void(); +-} +- +-SWIGINTERN PyObject *_wrap_avc_av_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; +- +- if (!PyArg_ParseTuple(args,(char *)":avc_av_stats")) SWIG_fail; +- avc_av_stats(); +- resultobj = SWIG_Py_Void(); +- return resultobj; +-fail: +- return NULL; +-} +- +- +-SWIGINTERN PyObject *_wrap_avc_sid_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +- PyObject *resultobj = 0; - - resultobj = SWIG_Py_Void(); +- if (!PyArg_ParseTuple(args,(char *)":avc_sid_stats")) SWIG_fail; +- avc_sid_stats(); +- resultobj = SWIG_Py_Void(); ++ arg1 = (security_id_t)(argp1); ++ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_id, 0 | 0 ); ++ if (!SWIG_IsOK(res2)) { ++ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "avc_compute_member" "', argument " "2"" of type '" "security_id_t""'"); ++ } ++ arg2 = (security_id_t)(argp2); ++ ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); ++ if (!SWIG_IsOK(ecode3)) { ++ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "avc_compute_member" "', argument " "3"" of type '" "security_class_t""'"); ++ } ++ arg3 = (security_class_t)(val3); ++ { ++ result = (int)avc_compute_member(arg1,arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } ++ resultobj = SWIG_From_int((int)(result)); return resultobj; fail: -@@ -9525,7 +9566,7 @@ - - SWIGINTERN PyObject *avc_cache_stats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; -- if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; -+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_avc_cache_stats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); - } -@@ -9571,12 +9612,12 @@ + return NULL; +@@ -9626,7 +7752,13 @@ + char *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":selinux_default_type_path")) SWIG_fail; +- result = (char *)selinux_default_type_path(); ++ { ++ result = (char *)selinux_default_type_path(); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; + fail: +@@ -9638,12 +7770,12 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; char **arg2 = (char **) 0 ; @@ -2798,7 +9718,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:get_default_type",&obj0)) SWIG_fail; -@@ -9608,7 +9649,6 @@ +@@ -9652,7 +7784,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_default_type" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)get_default_type((char const *)arg1,arg2); ++ { ++ result = (int)get_default_type((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -9675,7 +7813,6 @@ char *arg1 = (char *) 0 ; security_context_t arg2 = (security_context_t) 0 ; security_context_t **arg3 = (security_context_t **) 0 ; @@ -2806,7 +9741,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -9618,6 +9658,7 @@ +@@ -9685,6 +7822,7 @@ security_context_t *temp3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -2814,7 +9749,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel { arg3 = &temp3; -@@ -9672,7 +9713,6 @@ +@@ -9700,7 +7838,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "get_ordered_context_list" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)get_ordered_context_list((char const *)arg1,arg2,arg3); ++ { ++ result = (int)get_ordered_context_list((char const *)arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + { + PyObject* plist; +@@ -9739,7 +7883,6 @@ char *arg2 = (char *) 0 ; security_context_t arg3 = (security_context_t) 0 ; security_context_t **arg4 = (security_context_t **) 0 ; @@ -2822,7 +9772,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -9686,6 +9726,7 @@ +@@ -9753,6 +7896,7 @@ PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -2830,7 +9780,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel { arg4 = &temp4; -@@ -9746,7 +9787,6 @@ +@@ -9773,7 +7917,13 @@ + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "get_ordered_context_list_with_level" "', argument " "3"" of type '" "security_context_t""'"); + } + arg3 = (security_context_t)(buf3); +- result = (int)get_ordered_context_list_with_level((char const *)arg1,(char const *)arg2,arg3,arg4); ++ { ++ result = (int)get_ordered_context_list_with_level((char const *)arg1,(char const *)arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + { + PyObject* plist; +@@ -9813,7 +7963,6 @@ char *arg1 = (char *) 0 ; security_context_t arg2 = (security_context_t) 0 ; security_context_t *arg3 = (security_context_t *) 0 ; @@ -2838,7 +9803,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -9756,6 +9796,7 @@ +@@ -9823,6 +7972,7 @@ security_context_t temp3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -2846,7 +9811,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg3 = &temp3; if (!PyArg_ParseTuple(args,(char *)"OO:get_default_context",&obj0,&obj1)) SWIG_fail; -@@ -9795,7 +9836,6 @@ +@@ -9836,7 +7986,13 @@ + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "get_default_context" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); +- result = (int)get_default_context((char const *)arg1,arg2,arg3); ++ { ++ result = (int)get_default_context((char const *)arg1,arg2,arg3); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg3) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg3)); +@@ -9862,7 +8018,6 @@ char *arg2 = (char *) 0 ; security_context_t arg3 = (security_context_t) 0 ; security_context_t *arg4 = (security_context_t *) 0 ; @@ -2854,7 +9834,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -9809,6 +9849,7 @@ +@@ -9876,6 +8031,7 @@ PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -2862,7 +9842,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg4 = &temp4; if (!PyArg_ParseTuple(args,(char *)"OOO:get_default_context_with_level",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -9855,7 +9896,6 @@ +@@ -9894,7 +8050,13 @@ + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "get_default_context_with_level" "', argument " "3"" of type '" "security_context_t""'"); + } + arg3 = (security_context_t)(buf3); +- result = (int)get_default_context_with_level((char const *)arg1,(char const *)arg2,arg3,arg4); ++ { ++ result = (int)get_default_context_with_level((char const *)arg1,(char const *)arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +@@ -9922,7 +8084,6 @@ char *arg2 = (char *) 0 ; security_context_t arg3 = (security_context_t) 0 ; security_context_t *arg4 = (security_context_t *) 0 ; @@ -2870,7 +9865,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -9869,6 +9909,7 @@ +@@ -9936,6 +8097,7 @@ PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -2878,7 +9873,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg4 = &temp4; if (!PyArg_ParseTuple(args,(char *)"OOO:get_default_context_with_role",&obj0,&obj1,&obj2)) SWIG_fail; -@@ -9916,7 +9957,6 @@ +@@ -9954,7 +8116,13 @@ + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "get_default_context_with_role" "', argument " "3"" of type '" "security_context_t""'"); + } + arg3 = (security_context_t)(buf3); +- result = (int)get_default_context_with_role((char const *)arg1,(char const *)arg2,arg3,arg4); ++ { ++ result = (int)get_default_context_with_role((char const *)arg1,(char const *)arg2,arg3,arg4); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg4) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg4)); +@@ -9983,7 +8151,6 @@ char *arg3 = (char *) 0 ; security_context_t arg4 = (security_context_t) 0 ; security_context_t *arg5 = (security_context_t *) 0 ; @@ -2886,7 +9896,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; -@@ -9934,6 +9974,7 @@ +@@ -10001,6 +8168,7 @@ PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; @@ -2894,7 +9904,22 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg5 = &temp5; if (!PyArg_ParseTuple(args,(char *)"OOOO:get_default_context_with_rolelevel",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; -@@ -9985,9 +10026,9 @@ +@@ -10024,7 +8192,13 @@ + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "get_default_context_with_rolelevel" "', argument " "4"" of type '" "security_context_t""'"); + } + arg4 = (security_context_t)(buf4); +- result = (int)get_default_context_with_rolelevel((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5); ++ { ++ result = (int)get_default_context_with_rolelevel((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg5) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg5)); +@@ -10052,14 +8226,20 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -2905,7 +9930,19 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg1 = &temp1; arg2 = &temp2; -@@ -10020,12 +10061,12 @@ + if (!PyArg_ParseTuple(args,(char *)":query_user_context")) SWIG_fail; +- result = (int)query_user_context(arg1,arg2); ++ { ++ result = (int)query_user_context(arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); +@@ -10087,12 +8267,12 @@ PyObject *resultobj = 0; char *arg1 = (char *) 0 ; security_context_t *arg2 = (security_context_t *) 0 ; @@ -2919,49 +9956,344 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libsel arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:manual_user_enter_context",&obj0)) SWIG_fail; -@@ -10218,6 +10259,7 @@ +@@ -10101,7 +8281,13 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "manual_user_enter_context" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); +- result = (int)manual_user_enter_context((char const *)arg1,arg2); ++ { ++ result = (int)manual_user_enter_context((char const *)arg1,arg2); ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++ } + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); +@@ -10160,37 +8346,6 @@ + { (char *)"fsetfilecon_raw", _wrap_fsetfilecon_raw, METH_VARARGS, NULL}, + { (char *)"getpeercon", _wrap_getpeercon, METH_VARARGS, NULL}, + { (char *)"getpeercon_raw", _wrap_getpeercon_raw, METH_VARARGS, NULL}, +- { (char *)"av_decision_allowed_set", _wrap_av_decision_allowed_set, METH_VARARGS, NULL}, +- { (char *)"av_decision_allowed_get", _wrap_av_decision_allowed_get, METH_VARARGS, NULL}, +- { (char *)"av_decision_decided_set", _wrap_av_decision_decided_set, METH_VARARGS, NULL}, +- { (char *)"av_decision_decided_get", _wrap_av_decision_decided_get, METH_VARARGS, NULL}, +- { (char *)"av_decision_auditallow_set", _wrap_av_decision_auditallow_set, METH_VARARGS, NULL}, +- { (char *)"av_decision_auditallow_get", _wrap_av_decision_auditallow_get, METH_VARARGS, NULL}, +- { (char *)"av_decision_auditdeny_set", _wrap_av_decision_auditdeny_set, METH_VARARGS, NULL}, +- { (char *)"av_decision_auditdeny_get", _wrap_av_decision_auditdeny_get, METH_VARARGS, NULL}, +- { (char *)"av_decision_seqno_set", _wrap_av_decision_seqno_set, METH_VARARGS, NULL}, +- { (char *)"av_decision_seqno_get", _wrap_av_decision_seqno_get, METH_VARARGS, NULL}, +- { (char *)"new_av_decision", _wrap_new_av_decision, METH_VARARGS, NULL}, +- { (char *)"delete_av_decision", _wrap_delete_av_decision, METH_VARARGS, NULL}, +- { (char *)"av_decision_swigregister", av_decision_swigregister, METH_VARARGS, NULL}, +- { (char *)"selinux_opt_type_set", _wrap_selinux_opt_type_set, METH_VARARGS, NULL}, +- { (char *)"selinux_opt_type_get", _wrap_selinux_opt_type_get, METH_VARARGS, NULL}, +- { (char *)"selinux_opt_value_set", _wrap_selinux_opt_value_set, METH_VARARGS, NULL}, +- { (char *)"selinux_opt_value_get", _wrap_selinux_opt_value_get, METH_VARARGS, NULL}, +- { (char *)"new_selinux_opt", _wrap_new_selinux_opt, METH_VARARGS, NULL}, +- { (char *)"delete_selinux_opt", _wrap_delete_selinux_opt, METH_VARARGS, NULL}, +- { (char *)"selinux_opt_swigregister", selinux_opt_swigregister, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_func_log_set", _wrap_selinux_callback_func_log_set, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_func_log_get", _wrap_selinux_callback_func_log_get, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_func_audit_set", _wrap_selinux_callback_func_audit_set, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_func_audit_get", _wrap_selinux_callback_func_audit_get, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_func_validate_set", _wrap_selinux_callback_func_validate_set, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_func_validate_get", _wrap_selinux_callback_func_validate_get, METH_VARARGS, NULL}, +- { (char *)"new_selinux_callback", _wrap_new_selinux_callback, METH_VARARGS, NULL}, +- { (char *)"delete_selinux_callback", _wrap_delete_selinux_callback, METH_VARARGS, NULL}, +- { (char *)"selinux_callback_swigregister", selinux_callback_swigregister, METH_VARARGS, NULL}, +- { (char *)"selinux_get_callback", _wrap_selinux_get_callback, METH_VARARGS, NULL}, +- { (char *)"selinux_set_callback", _wrap_selinux_set_callback, METH_VARARGS, NULL}, + { (char *)"security_compute_av", _wrap_security_compute_av, METH_VARARGS, NULL}, + { (char *)"security_compute_av_raw", _wrap_security_compute_av_raw, METH_VARARGS, NULL}, + { (char *)"security_compute_create", _wrap_security_compute_create, METH_VARARGS, NULL}, +@@ -10206,13 +8361,6 @@ + { (char *)"security_get_initial_context_raw", _wrap_security_get_initial_context_raw, METH_VARARGS, NULL}, + { (char *)"selinux_mkload_policy", _wrap_selinux_mkload_policy, METH_VARARGS, NULL}, + { (char *)"selinux_init_load_policy", _wrap_selinux_init_load_policy, METH_VARARGS, NULL}, +- { (char *)"SELboolean_name_set", _wrap_SELboolean_name_set, METH_VARARGS, NULL}, +- { (char *)"SELboolean_name_get", _wrap_SELboolean_name_get, METH_VARARGS, NULL}, +- { (char *)"SELboolean_value_set", _wrap_SELboolean_value_set, METH_VARARGS, NULL}, +- { (char *)"SELboolean_value_get", _wrap_SELboolean_value_get, METH_VARARGS, NULL}, +- { (char *)"new_SELboolean", _wrap_new_SELboolean, METH_VARARGS, NULL}, +- { (char *)"delete_SELboolean", _wrap_delete_SELboolean, METH_VARARGS, NULL}, +- { (char *)"SELboolean_swigregister", SELboolean_swigregister, METH_VARARGS, NULL}, + { (char *)"security_set_boolean_list", _wrap_security_set_boolean_list, METH_VARARGS, NULL}, + { (char *)"security_load_booleans", _wrap_security_load_booleans, METH_VARARGS, NULL}, + { (char *)"security_check_context", _wrap_security_check_context, METH_VARARGS, NULL}, +@@ -10228,30 +8376,16 @@ + { (char *)"security_get_boolean_active", _wrap_security_get_boolean_active, METH_VARARGS, NULL}, + { (char *)"security_set_boolean", _wrap_security_set_boolean, METH_VARARGS, NULL}, + { (char *)"security_commit_booleans", _wrap_security_commit_booleans, METH_VARARGS, NULL}, +- { (char *)"security_class_mapping_name_set", _wrap_security_class_mapping_name_set, METH_VARARGS, NULL}, +- { (char *)"security_class_mapping_name_get", _wrap_security_class_mapping_name_get, METH_VARARGS, NULL}, +- { (char *)"security_class_mapping_perms_set", _wrap_security_class_mapping_perms_set, METH_VARARGS, NULL}, +- { (char *)"security_class_mapping_perms_get", _wrap_security_class_mapping_perms_get, METH_VARARGS, NULL}, +- { (char *)"new_security_class_mapping", _wrap_new_security_class_mapping, METH_VARARGS, NULL}, +- { (char *)"delete_security_class_mapping", _wrap_delete_security_class_mapping, METH_VARARGS, NULL}, +- { (char *)"security_class_mapping_swigregister", security_class_mapping_swigregister, METH_VARARGS, NULL}, +- { (char *)"selinux_set_mapping", _wrap_selinux_set_mapping, METH_VARARGS, NULL}, + { (char *)"string_to_security_class", _wrap_string_to_security_class, METH_VARARGS, NULL}, + { (char *)"security_class_to_string", _wrap_security_class_to_string, METH_VARARGS, NULL}, + { (char *)"security_av_perm_to_string", _wrap_security_av_perm_to_string, METH_VARARGS, NULL}, + { (char *)"string_to_av_perm", _wrap_string_to_av_perm, METH_VARARGS, NULL}, + { (char *)"security_av_string", _wrap_security_av_string, METH_VARARGS, NULL}, +- { (char *)"print_access_vector", _wrap_print_access_vector, METH_VARARGS, NULL}, +- { (char *)"set_matchpathcon_flags", _wrap_set_matchpathcon_flags, METH_VARARGS, NULL}, + { (char *)"matchpathcon_init", _wrap_matchpathcon_init, METH_VARARGS, NULL}, + { (char *)"matchpathcon_init_prefix", _wrap_matchpathcon_init_prefix, METH_VARARGS, NULL}, +- { (char *)"matchpathcon_fini", _wrap_matchpathcon_fini, METH_VARARGS, NULL}, + { (char *)"matchpathcon", _wrap_matchpathcon, METH_VARARGS, NULL}, + { (char *)"matchpathcon_index", _wrap_matchpathcon_index, METH_VARARGS, NULL}, + { (char *)"matchpathcon_filespec_add", _wrap_matchpathcon_filespec_add, METH_VARARGS, NULL}, +- { (char *)"matchpathcon_filespec_destroy", _wrap_matchpathcon_filespec_destroy, METH_VARARGS, NULL}, +- { (char *)"matchpathcon_filespec_eval", _wrap_matchpathcon_filespec_eval, METH_VARARGS, NULL}, +- { (char *)"matchpathcon_checkmatches", _wrap_matchpathcon_checkmatches, METH_VARARGS, NULL}, + { (char *)"matchmediacon", _wrap_matchmediacon, METH_VARARGS, NULL}, + { (char *)"selinux_getenforcemode", _wrap_selinux_getenforcemode, METH_VARARGS, NULL}, + { (char *)"selinux_getpolicytype", _wrap_selinux_getpolicytype, METH_VARARGS, NULL}, +@@ -10280,23 +8414,16 @@ + { (char *)"selinux_check_passwd_access", _wrap_selinux_check_passwd_access, METH_VARARGS, NULL}, + { (char *)"checkPasswdAccess", _wrap_checkPasswdAccess, METH_VARARGS, NULL}, + { (char *)"selinux_check_securetty_context", _wrap_selinux_check_securetty_context, METH_VARARGS, NULL}, +- { (char *)"set_selinuxmnt", _wrap_set_selinuxmnt, METH_VARARGS, NULL}, + { (char *)"rpm_execcon", _wrap_rpm_execcon, METH_VARARGS, NULL}, + { (char *)"is_context_customizable", _wrap_is_context_customizable, METH_VARARGS, NULL}, { (char *)"selinux_trans_to_raw_context", _wrap_selinux_trans_to_raw_context, METH_VARARGS, NULL}, { (char *)"selinux_raw_to_trans_context", _wrap_selinux_raw_to_trans_context, METH_VARARGS, NULL}, + { (char *)"selinux_raw_context_to_color", _wrap_selinux_raw_context_to_color, METH_VARARGS, NULL}, { (char *)"getseuserbyname", _wrap_getseuserbyname, METH_VARARGS, NULL}, + { (char *)"getseuser", _wrap_getseuser, METH_VARARGS, NULL}, { (char *)"selinux_file_context_cmp", _wrap_selinux_file_context_cmp, METH_VARARGS, NULL}, { (char *)"selinux_file_context_verify", _wrap_selinux_file_context_verify, METH_VARARGS, NULL}, { (char *)"selinux_lsetfilecon_default", _wrap_selinux_lsetfilecon_default, METH_VARARGS, NULL}, -@@ -10513,7 +10555,7 @@ - SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; -- int found; -+ int found, init; - - clientdata = clientdata; - -@@ -10523,6 +10565,9 @@ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; -+ init = 1; -+ } else { -+ init = 0; - } - - /* Try and load any already created modules */ -@@ -10551,6 +10596,12 @@ - module_head->next = &swig_module; - } - -+ /* When multiple interpeters are used, a module could have already been initialized in -+ a different interpreter, but not yet have a pointer in this interpreter. -+ In this case, we do not want to continue adding types... everything should be -+ set up already */ -+ if (init == 0) return; -+ - /* Now work on filling in swig_module.types */ - #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -diff --exclude-from=exclude -N -u -r nsalibselinux/src/seusers.c libselinux-2.0.76/src/seusers.c +- { (char *)"security_id_ctx_set", _wrap_security_id_ctx_set, METH_VARARGS, NULL}, +- { (char *)"security_id_ctx_get", _wrap_security_id_ctx_get, METH_VARARGS, NULL}, +- { (char *)"security_id_refcnt_set", _wrap_security_id_refcnt_set, METH_VARARGS, NULL}, +- { (char *)"security_id_refcnt_get", _wrap_security_id_refcnt_get, METH_VARARGS, NULL}, +- { (char *)"new_security_id", _wrap_new_security_id, METH_VARARGS, NULL}, +- { (char *)"delete_security_id", _wrap_delete_security_id, METH_VARARGS, NULL}, +- { (char *)"security_id_swigregister", security_id_swigregister, METH_VARARGS, NULL}, + { (char *)"avc_sid_to_context", _wrap_avc_sid_to_context, METH_VARARGS, NULL}, + { (char *)"avc_sid_to_context_raw", _wrap_avc_sid_to_context_raw, METH_VARARGS, NULL}, + { (char *)"avc_context_to_sid", _wrap_avc_context_to_sid, METH_VARARGS, NULL}, +@@ -10304,74 +8431,13 @@ + { (char *)"sidget", _wrap_sidget, METH_VARARGS, NULL}, + { (char *)"sidput", _wrap_sidput, METH_VARARGS, NULL}, + { (char *)"avc_get_initial_sid", _wrap_avc_get_initial_sid, METH_VARARGS, NULL}, +- { (char *)"avc_entry_ref_ae_set", _wrap_avc_entry_ref_ae_set, METH_VARARGS, NULL}, +- { (char *)"avc_entry_ref_ae_get", _wrap_avc_entry_ref_ae_get, METH_VARARGS, NULL}, +- { (char *)"new_avc_entry_ref", _wrap_new_avc_entry_ref, METH_VARARGS, NULL}, +- { (char *)"delete_avc_entry_ref", _wrap_delete_avc_entry_ref, METH_VARARGS, NULL}, +- { (char *)"avc_entry_ref_swigregister", avc_entry_ref_swigregister, METH_VARARGS, NULL}, +- { (char *)"avc_memory_callback_func_malloc_set", _wrap_avc_memory_callback_func_malloc_set, METH_VARARGS, NULL}, +- { (char *)"avc_memory_callback_func_malloc_get", _wrap_avc_memory_callback_func_malloc_get, METH_VARARGS, NULL}, +- { (char *)"avc_memory_callback_func_free_set", _wrap_avc_memory_callback_func_free_set, METH_VARARGS, NULL}, +- { (char *)"avc_memory_callback_func_free_get", _wrap_avc_memory_callback_func_free_get, METH_VARARGS, NULL}, +- { (char *)"new_avc_memory_callback", _wrap_new_avc_memory_callback, METH_VARARGS, NULL}, +- { (char *)"delete_avc_memory_callback", _wrap_delete_avc_memory_callback, METH_VARARGS, NULL}, +- { (char *)"avc_memory_callback_swigregister", avc_memory_callback_swigregister, METH_VARARGS, NULL}, +- { (char *)"avc_log_callback_func_log_set", _wrap_avc_log_callback_func_log_set, METH_VARARGS, NULL}, +- { (char *)"avc_log_callback_func_log_get", _wrap_avc_log_callback_func_log_get, METH_VARARGS, NULL}, +- { (char *)"avc_log_callback_func_audit_set", _wrap_avc_log_callback_func_audit_set, METH_VARARGS, NULL}, +- { (char *)"avc_log_callback_func_audit_get", _wrap_avc_log_callback_func_audit_get, METH_VARARGS, NULL}, +- { (char *)"new_avc_log_callback", _wrap_new_avc_log_callback, METH_VARARGS, NULL}, +- { (char *)"delete_avc_log_callback", _wrap_delete_avc_log_callback, METH_VARARGS, NULL}, +- { (char *)"avc_log_callback_swigregister", avc_log_callback_swigregister, METH_VARARGS, NULL}, +- { (char *)"avc_thread_callback_func_create_thread_set", _wrap_avc_thread_callback_func_create_thread_set, METH_VARARGS, NULL}, +- { (char *)"avc_thread_callback_func_create_thread_get", _wrap_avc_thread_callback_func_create_thread_get, METH_VARARGS, NULL}, +- { (char *)"avc_thread_callback_func_stop_thread_set", _wrap_avc_thread_callback_func_stop_thread_set, METH_VARARGS, NULL}, +- { (char *)"avc_thread_callback_func_stop_thread_get", _wrap_avc_thread_callback_func_stop_thread_get, METH_VARARGS, NULL}, +- { (char *)"new_avc_thread_callback", _wrap_new_avc_thread_callback, METH_VARARGS, NULL}, +- { (char *)"delete_avc_thread_callback", _wrap_delete_avc_thread_callback, METH_VARARGS, NULL}, +- { (char *)"avc_thread_callback_swigregister", avc_thread_callback_swigregister, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_alloc_lock_set", _wrap_avc_lock_callback_func_alloc_lock_set, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_alloc_lock_get", _wrap_avc_lock_callback_func_alloc_lock_get, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_get_lock_set", _wrap_avc_lock_callback_func_get_lock_set, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_get_lock_get", _wrap_avc_lock_callback_func_get_lock_get, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_release_lock_set", _wrap_avc_lock_callback_func_release_lock_set, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_release_lock_get", _wrap_avc_lock_callback_func_release_lock_get, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_free_lock_set", _wrap_avc_lock_callback_func_free_lock_set, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_func_free_lock_get", _wrap_avc_lock_callback_func_free_lock_get, METH_VARARGS, NULL}, +- { (char *)"new_avc_lock_callback", _wrap_new_avc_lock_callback, METH_VARARGS, NULL}, +- { (char *)"delete_avc_lock_callback", _wrap_delete_avc_lock_callback, METH_VARARGS, NULL}, +- { (char *)"avc_lock_callback_swigregister", avc_lock_callback_swigregister, METH_VARARGS, NULL}, + { (char *)"avc_init", _wrap_avc_init, METH_VARARGS, NULL}, + { (char *)"avc_open", _wrap_avc_open, METH_VARARGS, NULL}, +- { (char *)"avc_cleanup", _wrap_avc_cleanup, METH_VARARGS, NULL}, + { (char *)"avc_reset", _wrap_avc_reset, METH_VARARGS, NULL}, +- { (char *)"avc_destroy", _wrap_avc_destroy, METH_VARARGS, NULL}, + { (char *)"avc_has_perm_noaudit", _wrap_avc_has_perm_noaudit, METH_VARARGS, NULL}, + { (char *)"avc_has_perm", _wrap_avc_has_perm, METH_VARARGS, NULL}, +- { (char *)"avc_audit", _wrap_avc_audit, METH_VARARGS, NULL}, + { (char *)"avc_compute_create", _wrap_avc_compute_create, METH_VARARGS, NULL}, + { (char *)"avc_compute_member", _wrap_avc_compute_member, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_lookups_set", _wrap_avc_cache_stats_entry_lookups_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_lookups_get", _wrap_avc_cache_stats_entry_lookups_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_hits_set", _wrap_avc_cache_stats_entry_hits_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_hits_get", _wrap_avc_cache_stats_entry_hits_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_misses_set", _wrap_avc_cache_stats_entry_misses_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_misses_get", _wrap_avc_cache_stats_entry_misses_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_discards_set", _wrap_avc_cache_stats_entry_discards_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_entry_discards_get", _wrap_avc_cache_stats_entry_discards_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_lookups_set", _wrap_avc_cache_stats_cav_lookups_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_lookups_get", _wrap_avc_cache_stats_cav_lookups_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_hits_set", _wrap_avc_cache_stats_cav_hits_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_hits_get", _wrap_avc_cache_stats_cav_hits_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_probes_set", _wrap_avc_cache_stats_cav_probes_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_probes_get", _wrap_avc_cache_stats_cav_probes_get, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_misses_set", _wrap_avc_cache_stats_cav_misses_set, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_cav_misses_get", _wrap_avc_cache_stats_cav_misses_get, METH_VARARGS, NULL}, +- { (char *)"new_avc_cache_stats", _wrap_new_avc_cache_stats, METH_VARARGS, NULL}, +- { (char *)"delete_avc_cache_stats", _wrap_delete_avc_cache_stats, METH_VARARGS, NULL}, +- { (char *)"avc_cache_stats_swigregister", avc_cache_stats_swigregister, METH_VARARGS, NULL}, +- { (char *)"avc_av_stats", _wrap_avc_av_stats, METH_VARARGS, NULL}, +- { (char *)"avc_sid_stats", _wrap_avc_sid_stats, METH_VARARGS, NULL}, + { (char *)"selinux_default_type_path", _wrap_selinux_default_type_path, METH_VARARGS, NULL}, + { (char *)"get_default_type", _wrap_get_default_type, METH_VARARGS, NULL}, + { (char *)"get_ordered_context_list", _wrap_get_ordered_context_list, METH_VARARGS, NULL}, +@@ -10389,64 +8455,38 @@ + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + + static swig_type_info _swigt__p_SELboolean = {"_p_SELboolean", "SELboolean *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_av_decision = {"_p_av_decision", "struct av_decision *|av_decision *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_cache_stats = {"_p_avc_cache_stats", "struct avc_cache_stats *|avc_cache_stats *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_entry = {"_p_avc_entry", "struct avc_entry *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_entry_ref = {"_p_avc_entry_ref", "struct avc_entry_ref *|avc_entry_ref *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_lock_callback = {"_p_avc_lock_callback", "struct avc_lock_callback *|avc_lock_callback *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_log_callback = {"_p_avc_log_callback", "struct avc_log_callback *|avc_log_callback *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_memory_callback = {"_p_avc_memory_callback", "struct avc_memory_callback *|avc_memory_callback *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_avc_thread_callback = {"_p_avc_thread_callback", "struct avc_thread_callback *|avc_thread_callback *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_av_decision = {"_p_av_decision", "struct av_decision *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_avc_entry_ref = {"_p_avc_entry_ref", "struct avc_entry_ref *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_avc_lock_callback = {"_p_avc_lock_callback", "struct avc_lock_callback *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_avc_log_callback = {"_p_avc_log_callback", "struct avc_log_callback *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_avc_memory_callback = {"_p_avc_memory_callback", "struct avc_memory_callback *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_avc_thread_callback = {"_p_avc_thread_callback", "struct avc_thread_callback *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_int_p_q_const__char_v_______int = {"_p_f_int_p_q_const__char_v_______int", "int (*)(int,char const *,...)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_p_f_void__void__p_void = {"_p_f_p_f_void__void__p_void", "void *(*)(void (*)(void))", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_p_p_char__int = {"_p_f_p_p_char__int", "int (*)(char **)|int (*)(security_context_t *)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_p_q_const__char_v_______void = {"_p_f_p_q_const__char_v_______void", "void (*)(char const *,...)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "void (*)(void *)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_p_void_unsigned_short_p_char_size_t__int = {"_p_f_p_void_unsigned_short_p_char_size_t__int", "int (*)(void *,unsigned short,char *,size_t)|int (*)(void *,security_class_t,char *,size_t)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_p_void_unsigned_short_p_char_size_t__void = {"_p_f_p_void_unsigned_short_p_char_size_t__void", "void (*)(void *,unsigned short,char *,size_t)|void (*)(void *,security_class_t,char *,size_t)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_size_t__p_void = {"_p_f_size_t__p_void", "void *(*)(size_t)", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_f_void__p_void = {"_p_f_void__p_void", "void *(*)(void)", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_ino_t = {"_p_ino_t", "ino_t *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **|security_context_t *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_p_p_char = {"_p_p_p_char", "char ***|security_context_t **", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_p_security_id = {"_p_p_security_id", "struct security_id **|security_id_t *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_security_class_mapping = {"_p_security_class_mapping", "struct security_class_mapping *|security_class_mapping *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_security_id = {"_p_security_id", "security_id_t|struct security_id *|security_id *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_selinux_callback = {"_p_selinux_callback", "union selinux_callback *|selinux_callback *", 0, 0, (void*)0, 0}; +-static swig_type_info _swigt__p_selinux_opt = {"_p_selinux_opt", "struct selinux_opt *|selinux_opt *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_security_id = {"_p_security_id", "security_id_t|struct security_id *", 0, 0, (void*)0, 0}; ++static swig_type_info _swigt__p_selinux_opt = {"_p_selinux_opt", "struct selinux_opt *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|access_vector_t *|mode_t *|pid_t *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "security_class_t *|unsigned short *", 0, 0, (void*)0, 0}; + + static swig_type_info *swig_type_initial[] = { + &_swigt__p_SELboolean, + &_swigt__p_av_decision, +- &_swigt__p_avc_cache_stats, +- &_swigt__p_avc_entry, + &_swigt__p_avc_entry_ref, + &_swigt__p_avc_lock_callback, + &_swigt__p_avc_log_callback, + &_swigt__p_avc_memory_callback, + &_swigt__p_avc_thread_callback, + &_swigt__p_char, +- &_swigt__p_f_int_p_q_const__char_v_______int, +- &_swigt__p_f_p_f_void__void__p_void, +- &_swigt__p_f_p_p_char__int, +- &_swigt__p_f_p_q_const__char_v_______void, +- &_swigt__p_f_p_void__void, +- &_swigt__p_f_p_void_unsigned_short_p_char_size_t__int, +- &_swigt__p_f_p_void_unsigned_short_p_char_size_t__void, +- &_swigt__p_f_size_t__p_void, +- &_swigt__p_f_void__p_void, + &_swigt__p_ino_t, + &_swigt__p_int, + &_swigt__p_p_char, + &_swigt__p_p_p_char, + &_swigt__p_p_security_id, +- &_swigt__p_security_class_mapping, + &_swigt__p_security_id, +- &_swigt__p_selinux_callback, + &_swigt__p_selinux_opt, + &_swigt__p_unsigned_int, + &_swigt__p_unsigned_short, +@@ -10454,31 +8494,18 @@ + + static swig_cast_info _swigc__p_SELboolean[] = { {&_swigt__p_SELboolean, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_av_decision[] = { {&_swigt__p_av_decision, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_avc_cache_stats[] = { {&_swigt__p_avc_cache_stats, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_avc_entry[] = { {&_swigt__p_avc_entry, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_avc_entry_ref[] = { {&_swigt__p_avc_entry_ref, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_avc_lock_callback[] = { {&_swigt__p_avc_lock_callback, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_avc_log_callback[] = { {&_swigt__p_avc_log_callback, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_avc_memory_callback[] = { {&_swigt__p_avc_memory_callback, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_avc_thread_callback[] = { {&_swigt__p_avc_thread_callback, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_int_p_q_const__char_v_______int[] = { {&_swigt__p_f_int_p_q_const__char_v_______int, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_p_f_void__void__p_void[] = { {&_swigt__p_f_p_f_void__void__p_void, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_p_p_char__int[] = { {&_swigt__p_f_p_p_char__int, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_p_q_const__char_v_______void[] = { {&_swigt__p_f_p_q_const__char_v_______void, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_p_void__void[] = { {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_p_void_unsigned_short_p_char_size_t__int[] = { {&_swigt__p_f_p_void_unsigned_short_p_char_size_t__int, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_p_void_unsigned_short_p_char_size_t__void[] = { {&_swigt__p_f_p_void_unsigned_short_p_char_size_t__void, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_size_t__p_void[] = { {&_swigt__p_f_size_t__p_void, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_f_void__p_void[] = { {&_swigt__p_f_void__p_void, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_ino_t[] = { {&_swigt__p_ino_t, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_p_p_char[] = { {&_swigt__p_p_p_char, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_p_security_id[] = { {&_swigt__p_p_security_id, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_security_class_mapping[] = { {&_swigt__p_security_class_mapping, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_security_id[] = { {&_swigt__p_security_id, 0, 0, 0},{0, 0, 0, 0}}; +-static swig_cast_info _swigc__p_selinux_callback[] = { {&_swigt__p_selinux_callback, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_selinux_opt[] = { {&_swigt__p_selinux_opt, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}; +@@ -10486,31 +8513,18 @@ + static swig_cast_info *swig_cast_initial[] = { + _swigc__p_SELboolean, + _swigc__p_av_decision, +- _swigc__p_avc_cache_stats, +- _swigc__p_avc_entry, + _swigc__p_avc_entry_ref, + _swigc__p_avc_lock_callback, + _swigc__p_avc_log_callback, + _swigc__p_avc_memory_callback, + _swigc__p_avc_thread_callback, + _swigc__p_char, +- _swigc__p_f_int_p_q_const__char_v_______int, +- _swigc__p_f_p_f_void__void__p_void, +- _swigc__p_f_p_p_char__int, +- _swigc__p_f_p_q_const__char_v_______void, +- _swigc__p_f_p_void__void, +- _swigc__p_f_p_void_unsigned_short_p_char_size_t__int, +- _swigc__p_f_p_void_unsigned_short_p_char_size_t__void, +- _swigc__p_f_size_t__p_void, +- _swigc__p_f_void__p_void, + _swigc__p_ino_t, + _swigc__p_int, + _swigc__p_p_char, + _swigc__p_p_p_char, + _swigc__p_p_security_id, +- _swigc__p_security_class_mapping, + _swigc__p_security_id, +- _swigc__p_selinux_callback, + _swigc__p_selinux_opt, + _swigc__p_unsigned_int, + _swigc__p_unsigned_short, +diff --exclude-from=exclude -N -u -r nsalibselinux/src/seusers.c libselinux-2.0.77/src/seusers.c --- nsalibselinux/src/seusers.c 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/src/seusers.c 2008-12-16 09:36:39.000000000 -0500 ++++ libselinux-2.0.77/src/seusers.c 2009-02-18 14:18:54.000000000 -0500 @@ -243,3 +243,67 @@ *r_level = NULL; return 0; @@ -3030,9 +10362,9 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/seusers.c libselinux-2.0. + + return (ret ? getseuserbyname(username, r_seuser, r_level) : ret); +} -diff --exclude-from=exclude -N -u -r nsalibselinux/utils/getdefaultcon.c libselinux-2.0.76/utils/getdefaultcon.c +diff --exclude-from=exclude -N -u -r nsalibselinux/utils/getdefaultcon.c libselinux-2.0.77/utils/getdefaultcon.c --- nsalibselinux/utils/getdefaultcon.c 2008-08-28 09:34:24.000000000 -0400 -+++ libselinux-2.0.76/utils/getdefaultcon.c 2008-12-02 09:33:14.000000000 -0500 ++++ libselinux-2.0.77/utils/getdefaultcon.c 2009-02-18 14:18:54.000000000 -0500 @@ -22,8 +22,9 @@ security_context_t usercon = NULL, cur_context = NULL; char *user = NULL, *level = NULL, *role=NULL, *seuser=NULL, *dlevel=NULL; @@ -3078,3 +10410,59 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/utils/getdefaultcon.c libseli - return 0; + return ret >= 0; } +diff --exclude-from=exclude -N -u -r nsalibselinux/utils/Makefile libselinux-2.0.77/utils/Makefile +--- nsalibselinux/utils/Makefile 2008-08-28 09:34:24.000000000 -0400 ++++ libselinux-2.0.77/utils/Makefile 2009-02-18 14:18:54.000000000 -0500 +@@ -2,28 +2,33 @@ + PREFIX ?= $(DESTDIR)/usr + LIBDIR ?= $(PREFIX)/lib + BINDIR ?= $(PREFIX)/sbin ++_BINDIR ?= $(DESTDIR)/sbin + + CFLAGS ?= -Wall + override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS) + LDLIBS += -L../src -lselinux -L$(LIBDIR) + + TARGETS=$(patsubst %.c,%,$(wildcard *.c)) ++ ++ + ifeq ($(DISABLE_AVC),y) + UNUSED_TARGETS+=compute_av compute_create compute_member compute_relabel + endif + ifeq ($(DISABLE_BOOL),y) + UNUSED_TARGETS+=getsebool togglesebool + endif +-TARGETS:= $(filter-out $(UNUSED_TARGETS), $(TARGETS)) ++TARGETS:= $(filter-out $(UNUSED_TARGETS) matchpathcon, $(TARGETS)) + +-all: $(TARGETS) ++all: $(TARGETS) matchpathcon + + install: all + -mkdir -p $(BINDIR) + install -m 755 $(TARGETS) $(BINDIR) +- ++ -mkdir -p $(_BINDIR) ++ install -m 755 matchpathcon $(_BINDIR) ++ (cd $(BINDIR); ln -fs ../../sbin/matchpathcon) + clean: +- rm -f $(TARGETS) *.o ++ rm -f $(TARGETS) *.o *~ + + indent: + ../../scripts/Lindent $(wildcard *.[ch]) +diff --exclude-from=exclude -N -u -r nsalibselinux/utils/matchpathcon.c libselinux-2.0.77/utils/matchpathcon.c +--- nsalibselinux/utils/matchpathcon.c 2008-10-28 10:06:51.000000000 -0400 ++++ libselinux-2.0.77/utils/matchpathcon.c 2009-02-18 14:18:54.000000000 -0500 +@@ -101,6 +101,11 @@ + for (i = optind; i < argc; i++) { + int mode = 0; + struct stat buf; ++ int len = strlen(argv[i]); ++ if (len > 1 && argv[i][len - 1 ] == '/') { ++ argv[i][len - 1 ] = '\0'; ++ } ++ + if (lstat(argv[i], &buf) == 0) + mode = buf.st_mode; + diff --git a/libselinux.spec b/libselinux.spec index 741ed0b..646fb12 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -4,8 +4,8 @@ Summary: SELinux library and simple utilities Name: libselinux -Version: 2.0.76 -Release: 5%{?dist} +Version: 2.0.78 +Release: 1%{?dist} License: Public Domain Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz @@ -127,6 +127,7 @@ exit 0 %defattr(-,root,root,-) /%{_lib}/libselinux.so.* /var/run/setrans +/sbin/matchpathcon %files utils %defattr(-,root,root,-) @@ -163,7 +164,31 @@ exit 0 %{ruby_sitearch}/selinux.so %changelog -* Tue Dec 16 2008 Dan Walsh - 2.0.76-5 +* Mon Mar 2 2009 Dan Walsh - 2.0.78-1 +- Update to upstream + * Fix incorrect conversion in discover_class code. + +* Wed Feb 25 2009 Fedora Release Engineering - 2.0.77-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 18 2009 Dan Walsh - 2.0.77-5 +- Add + - selinux_virtual_domain_context_path + - selinux_virtual_image_context_path + +* Tue Jan 6 2009 Dan Walsh - 2.0.77-3 +- Throw exeptions in python swig bindings on failures + +* Tue Jan 6 2009 Dan Walsh - 2.0.77-2 +- Fix restorecon python code + +* Tue Jan 6 2009 Dan Walsh - 2.0.77-1 +- Update to upstream + +* Tue Dec 16 2008 Dan Walsh - 2.0.76-6 +- Strip trailing / for matchpathcon + +* Tue Dec 16 2008 Dan Walsh l - 2.0.76-5 - Fix segfault if seusers file does not work * Fri Dec 12 2008 Dan Walsh - 2.0.76-4 diff --git a/sources b/sources index 5a2c847..331df86 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6829e79d3103683961d82c419bdb4e86 libselinux-2.0.76.tgz +c34327ec14643572f284589a2c72dcaa libselinux-2.0.78.tgz