libselinux/libselinux-rhat.patch

1573 lines
71 KiB
Diff
Raw Normal View History

diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h
index 0725b57..f110dcf 100644
--- a/libselinux/include/selinux/selinux.h
+++ b/libselinux/include/selinux/selinux.h
@@ -482,6 +482,7 @@ extern const char *selinux_file_context_path(void);
extern const char *selinux_file_context_homedir_path(void);
extern const char *selinux_file_context_local_path(void);
extern const char *selinux_file_context_subs_path(void);
+extern const char *selinux_file_context_subs_dist_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);
@@ -514,6 +515,9 @@ extern int selinux_check_securetty_context(const security_context_t tty_context)
which performs the initial mount of selinuxfs. */
void set_selinuxmnt(char *mnt);
+/* clear selinuxmnt variable and free allocated memory */
+void fini_selinuxmnt(void);
+
/* Execute a helper for rpm in an appropriate security context. */
extern int rpm_execcon(unsigned int verified,
const char *filename,
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index bf665ab..ccd08ae 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -1,10 +1,11 @@
# Installation directories.
+PYTHON ?= python
PREFIX ?= $(DESTDIR)/usr
LIBDIR ?= $(PREFIX)/lib
SHLIBDIR ?= $(DESTDIR)/lib
INCLUDEDIR ?= $(PREFIX)/include
-PYLIBVER ?= $(shell python -c 'import sys;print "python%d.%d" % sys.version_info[0:2]')
-PYINC ?= /usr/include/$(PYLIBVER)
+PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])')
+PYINC ?= $(shell pkg-config --cflags `basename $(PYTHON)`)
PYLIB ?= /usr/lib/$(PYLIBVER)
PYTHONLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
RUBYLIBVER ?= $(shell ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
@@ -23,13 +24,13 @@ SWIGIF= selinuxswig_python.i selinuxswig_python_exception.i
SWIGRUBYIF= selinuxswig_ruby.i
SWIGCOUT= selinuxswig_wrap.c
SWIGRUBYCOUT= selinuxswig_ruby_wrap.c
-SWIGLOBJ:= $(patsubst %.c,%.lo,$(SWIGCOUT))
+SWIGLOBJ:= $(patsubst %.c,$(PYPREFIX)%.lo,$(SWIGCOUT))
SWIGRUBYLOBJ:= $(patsubst %.c,%.lo,$(SWIGRUBYCOUT))
-SWIGSO=_selinux.so
+SWIGSO=$(PYPREFIX)_selinux.so
SWIGFILES=$(SWIGSO) selinux.py selinuxswig_python_exception.i
SWIGRUBYSO=_rubyselinux.so
LIBSO=$(TARGET).$(LIBVERSION)
-AUDIT2WHYSO=audit2why.so
+AUDIT2WHYSO=$(PYPREFIX)audit2why.so
ifeq ($(DISABLE_AVC),y)
UNUSED_SRCS+=avc.c avc_internal.c avc_sidtab.c mapping.c stringrep.c checkAccess.c
@@ -70,7 +71,7 @@ $(LIBA): $(OBJS)
$(RANLIB) $@
$(SWIGLOBJ): $(SWIGCOUT)
- $(CC) $(filter-out -Werror,$(CFLAGS)) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
+ $(CC) $(filter-out -Werror,$(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
$(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
$(CC) $(filter-out -Werror,$(CFLAGS)) -I$(RUBYINC) -fPIC -DSHARED -c -o $@ $<
@@ -91,10 +92,10 @@ $(LIBPC): $(LIBPC).in
selinuxswig_python_exception.i: ../include/selinux/selinux.h
bash exception.sh > $@
-audit2why.lo: audit2why.c
- $(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
+$(PYPREFIX)audit2why.lo: audit2why.c
+ $(CC) $(CFLAGS) $(PYINC) -fPIC -DSHARED -c -o $@ $<
-$(AUDIT2WHYSO): audit2why.lo
+$(AUDIT2WHYSO): $(PYPREFIX)audit2why.lo
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux ${LIBDIR}/libsepol.a -L$(LIBDIR) -Wl,-soname,$@
%.o: %.c policy.h
@@ -123,8 +124,8 @@ install: all
install-pywrap: pywrap
test -d $(PYTHONLIBDIR)/site-packages/selinux || install -m 755 -d $(PYTHONLIBDIR)/site-packages/selinux
- install -m 755 $(SWIGSO) $(PYTHONLIBDIR)/site-packages/selinux
- install -m 755 $(AUDIT2WHYSO) $(PYTHONLIBDIR)/site-packages/selinux
+ install -m 755 $(SWIGSO) $(PYTHONLIBDIR)/site-packages/selinux/_selinux.so
+ install -m 755 $(AUDIT2WHYSO) $(PYTHONLIBDIR)/site-packages/selinux/audit2why.so
install -m 644 selinux.py $(PYTHONLIBDIR)/site-packages/selinux/__init__.py
install-rubywrap: rubywrap
diff --git a/libselinux/src/audit2why.c b/libselinux/src/audit2why.c
index 691bc67..12e8614 100644
--- a/libselinux/src/audit2why.c
+++ b/libselinux/src/audit2why.c
@@ -1,3 +1,6 @@
+/* Workaround for http://bugs.python.org/issue4835 */
+#define SIZEOF_SOCKET_T SIZEOF_INT
+
#include <Python.h>
#include <unistd.h>
#include <stdlib.h>
@@ -255,6 +258,8 @@ static int __policy_init(const char *init_path)
2010-06-25 21:05:56 +00:00
fclose(fp);
sepol_set_policydb(&avc->policydb->p);
avc->handle = sepol_handle_create();
+ /* Turn off messages */
+ sepol_msg_set_callback(avc->handle, NULL, NULL);
rc = sepol_bool_count(avc->handle,
avc->policydb, &cnt);
@@ -287,8 +292,10 @@ static int __policy_init(const char *init_path)
static PyObject *init(PyObject *self __attribute__((unused)), PyObject *args) {
int result;
char *init_path=NULL;
- if (PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path))
- result = __policy_init(init_path);
2010-06-25 21:05:56 +00:00
+ if (!PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path)) {
+ return NULL;
+ }
+ result = __policy_init(init_path);
return Py_BuildValue("i", result);
}
@@ -353,7 +360,11 @@ static PyObject *analyze(PyObject *self __attribute__((unused)) , PyObject *args
strObj = PyList_GetItem(listObj, i); /* Can't fail */
/* make it a string */
+#if PY_MAJOR_VERSION >= 3
2010-06-25 21:05:56 +00:00
+ permstr = _PyUnicode_AsString( strObj );
+#else
permstr = PyString_AsString( strObj );
+#endif
perm = string_to_av_perm(tclass, permstr);
if (!perm) {
@@ -423,10 +434,39 @@ static PyMethodDef audit2whyMethods[] = {
{NULL, NULL, 0, NULL} /* Sentinel */
};
+#if PY_MAJOR_VERSION >= 3
+/* Module-initialization logic specific to Python 3 */
+struct module_state {
+ /* empty for now */
+};
+static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "audit2why",
+ NULL,
+ sizeof(struct module_state),
+ audit2whyMethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit_audit2why(void)
+#else
PyMODINIT_FUNC
initaudit2why(void)
+#endif
{
- PyObject *m = Py_InitModule("audit2why", audit2whyMethods);
+ PyObject *m;
+#if PY_MAJOR_VERSION >= 3
+ m = PyModule_Create(&moduledef);
+ if (m == NULL) {
+ return NULL;
+ }
+#else
+ m = Py_InitModule("audit2why", audit2whyMethods);
+#endif
PyModule_AddIntConstant(m,"UNKNOWN", UNKNOWN);
PyModule_AddIntConstant(m,"BADSCON", BADSCON);
PyModule_AddIntConstant(m,"BADTCON", BADTCON);
@@ -440,4 +480,8 @@ initaudit2why(void)
PyModule_AddIntConstant(m,"BOOLEAN", BOOLEAN);
PyModule_AddIntConstant(m,"CONSTRAINT", CONSTRAINT);
PyModule_AddIntConstant(m,"RBAC", RBAC);
+
+#if PY_MAJOR_VERSION >= 3
+ return m;
+#endif
}
diff --git a/libselinux/src/callbacks.c b/libselinux/src/callbacks.c
index b245364..7c47222 100644
--- a/libselinux/src/callbacks.c
+++ b/libselinux/src/callbacks.c
@@ -16,6 +16,7 @@ default_selinux_log(int type __attribute__((unused)), const char *fmt, ...)
2008-07-09 20:57:21 +00:00
{
int rc;
va_list ap;
+ if (is_selinux_enabled() == 0) return 0;
va_start(ap, fmt);
rc = vfprintf(stderr, fmt, ap);
va_end(ap);
diff --git a/libselinux/src/file_path_suffixes.h b/libselinux/src/file_path_suffixes.h
index ccf43e1..0b00156 100644
--- a/libselinux/src/file_path_suffixes.h
+++ b/libselinux/src/file_path_suffixes.h
@@ -23,4 +23,5 @@ S_(BINPOLICY, "/policy/policy")
S_(VIRTUAL_DOMAIN, "/contexts/virtual_domain_context")
S_(VIRTUAL_IMAGE, "/contexts/virtual_image_context")
S_(FILE_CONTEXT_SUBS, "/contexts/files/file_contexts.subs")
+ S_(FILE_CONTEXT_SUBS_DIST, "/contexts/files/file_contexts.subs_dist")
S_(SEPGSQL_CONTEXTS, "/contexts/sepgsql_contexts")
diff --git a/libselinux/src/init.c b/libselinux/src/init.c
index 1dd9838..a948920 100644
--- a/libselinux/src/init.c
+++ b/libselinux/src/init.c
@@ -96,12 +96,14 @@ static void init_selinuxmnt(void)
return;
}
-static void fini_selinuxmnt(void)
+void fini_selinuxmnt(void)
{
free(selinux_mnt);
selinux_mnt = NULL;
}
+hidden_def(fini_selinuxmnt)
+
void set_selinuxmnt(char *mnt)
{
selinux_mnt = strdup(mnt);
diff --git a/libselinux/src/label.c b/libselinux/src/label.c
index 2fd19c5..ba316df 100644
--- a/libselinux/src/label.c
+++ b/libselinux/src/label.c
@@ -56,12 +56,11 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src)
return NULL;
}
-static struct selabel_sub *selabel_subs_init(void)
+static struct selabel_sub *selabel_subs_init(const char *path,struct selabel_sub *list)
{
char buf[1024];
- FILE *cfg = fopen(selinux_file_context_subs_path(), "r");
+ FILE *cfg = fopen(path, "r");
struct selabel_sub *sub;
- struct selabel_sub *list = NULL;
if (cfg) {
while (fgets_unlocked(buf, sizeof(buf) - 1, cfg)) {
@@ -160,7 +159,10 @@ struct selabel_handle *selabel_open(unsigned int backend,
memset(rec, 0, sizeof(*rec));
rec->backend = backend;
rec->validating = selabel_is_validate_set(opts, nopts);
- rec->subs = selabel_subs_init();
+
+ rec->subs = NULL;
+ rec->subs = selabel_subs_init(selinux_file_context_subs_dist_path(), rec->subs);
+ rec->subs = selabel_subs_init(selinux_file_context_subs_path(), rec->subs);
if ((*initfuncs[backend])(rec, opts, nopts)) {
free(rec);
diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
index 36ce029..83d2143 100644
--- a/libselinux/src/load_policy.c
+++ b/libselinux/src/load_policy.c
@@ -329,7 +329,7 @@ int selinux_init_load_policy(int *enforce)
selinux_getenforcemode(&seconfig);
/* Check for an override of the mode via the kernel command line. */
- rc = mount("none", "/proc", "proc", 0, 0);
+ rc = mount("proc", "/proc", "proc", 0, 0);
cfg = fopen("/proc/cmdline", "r");
if (cfg) {
char *tmp;
@@ -369,7 +369,7 @@ int selinux_init_load_policy(int *enforce)
* Check for the existence of SELinux via selinuxfs, and
* mount it if present for use in the calls below.
*/
- if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0 && errno != EBUSY) {
+ if (mount("selinuxfs", SELINUXMNT, "selinuxfs", 0, 0) < 0 && errno != EBUSY) {
if (errno == ENODEV) {
/*
* SELinux was disabled in the kernel, either
@@ -398,6 +398,7 @@ int selinux_init_load_policy(int *enforce)
if (rc == 0) {
/* Successfully disabled, so umount selinuxfs too. */
umount(SELINUXMNT);
+ fini_selinuxmnt();
}
/*
* If we failed to disable, SELinux will still be
diff --git a/libselinux/src/matchpathcon.c b/libselinux/src/matchpathcon.c
index f3e45af..da5cab9 100644
--- a/libselinux/src/matchpathcon.c
+++ b/libselinux/src/matchpathcon.c
@@ -2,6 +2,7 @@
#include <string.h>
#include <errno.h>
#include <stdio.h>
+#include <syslog.h>
#include "selinux_internal.h"
#include "label_internal.h"
#include "callbacks.h"
@@ -17,6 +18,7 @@ static __thread int con_array_used;
static pthread_once_t once = PTHREAD_ONCE_INIT;
static pthread_key_t destructor_key;
+static int destructor_key_initialized = 0;
static int add_array_elt(char *con)
{
@@ -60,7 +62,7 @@ static void
{
va_list ap;
va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
+ vsyslog(LOG_ERR, fmt, ap);
va_end(ap);
}
@@ -292,12 +294,14 @@ static void matchpathcon_thread_destructor(void __attribute__((unused)) *ptr)
void __attribute__((destructor)) matchpathcon_lib_destructor(void)
{
- __selinux_key_delete(destructor_key);
+ if (destructor_key_initialized)
+ __selinux_key_delete(destructor_key);
}
static void matchpathcon_init_once(void)
{
- __selinux_key_create(&destructor_key, matchpathcon_thread_destructor);
+ if (__selinux_key_create(&destructor_key, matchpathcon_thread_destructor) == 0)
+ destructor_key_initialized = 1;
}
int matchpathcon_init_prefix(const char *path, const char *subset)
2011-02-01 22:40:11 +00:00
diff --git a/libselinux/src/selinux.py b/libselinux/src/selinux.py
index fd63a4f..705012c 100644
--- a/libselinux/src/selinux.py
+++ b/libselinux/src/selinux.py
@@ -1,5 +1,5 @@
# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.40
+# Version 2.0.1
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
@@ -79,6 +79,14 @@ def restorecon(path, recursive=False):
map(restorecon, [os.path.join(dirname, fname)
for fname in fnames]), None)
+def chcon(path, context, recursive=False):
+ """ Set the SELinux context on a given path """
+ lsetfilecon(path, context)
+ if recursive:
+ for root, dirs, files in os.walk(path):
+ for name in files + dirs:
+ lsetfilecon(os.path.join(root,name), context)
+
def copytree(src, dest):
""" An SELinux-friendly shutil.copytree method """
shutil.copytree(src, dest)
@@ -1588,6 +1596,7 @@ get_default_type = _selinux.get_default_type
SELABEL_CTX_FILE = _selinux.SELABEL_CTX_FILE
SELABEL_CTX_MEDIA = _selinux.SELABEL_CTX_MEDIA
SELABEL_CTX_X = _selinux.SELABEL_CTX_X
+SELABEL_CTX_DB = _selinux.SELABEL_CTX_DB
SELABEL_OPT_UNUSED = _selinux.SELABEL_OPT_UNUSED
SELABEL_OPT_VALIDATE = _selinux.SELABEL_OPT_VALIDATE
SELABEL_OPT_BASEONLY = _selinux.SELABEL_OPT_BASEONLY
@@ -1621,6 +1630,15 @@ SELABEL_X_EVENT = _selinux.SELABEL_X_EVENT
SELABEL_X_SELN = _selinux.SELABEL_X_SELN
SELABEL_X_POLYPROP = _selinux.SELABEL_X_POLYPROP
SELABEL_X_POLYSELN = _selinux.SELABEL_X_POLYSELN
+SELABEL_DB_DATABASE = _selinux.SELABEL_DB_DATABASE
+SELABEL_DB_SCHEMA = _selinux.SELABEL_DB_SCHEMA
+SELABEL_DB_TABLE = _selinux.SELABEL_DB_TABLE
+SELABEL_DB_COLUMN = _selinux.SELABEL_DB_COLUMN
+SELABEL_DB_SEQUENCE = _selinux.SELABEL_DB_SEQUENCE
+SELABEL_DB_VIEW = _selinux.SELABEL_DB_VIEW
+SELABEL_DB_PROCEDURE = _selinux.SELABEL_DB_PROCEDURE
+SELABEL_DB_BLOB = _selinux.SELABEL_DB_BLOB
+SELABEL_DB_TUPLE = _selinux.SELABEL_DB_TUPLE
def is_selinux_enabled():
return _selinux.is_selinux_enabled()
@@ -2201,6 +2219,10 @@ def selinux_x_context_path():
return _selinux.selinux_x_context_path()
selinux_x_context_path = _selinux.selinux_x_context_path
+def selinux_sepgsql_context_path():
+ return _selinux.selinux_sepgsql_context_path()
+selinux_sepgsql_context_path = _selinux.selinux_sepgsql_context_path
+
def selinux_contexts_path():
return _selinux.selinux_contexts_path()
selinux_contexts_path = _selinux.selinux_contexts_path
diff --git a/libselinux/src/selinux_config.c b/libselinux/src/selinux_config.c
index e040959..f4c33df 100644
--- a/libselinux/src/selinux_config.c
+++ b/libselinux/src/selinux_config.c
@@ -45,7 +45,8 @@
#define VIRTUAL_IMAGE 22
#define FILE_CONTEXT_SUBS 23
#define SEPGSQL_CONTEXTS 24
-#define NEL 25
+#define FILE_CONTEXT_SUBS_DIST 25
+#define NEL 26
/* Part of one-time lazy init */
static pthread_once_t once = PTHREAD_ONCE_INIT;
@@ -423,6 +424,12 @@ const char * selinux_file_context_subs_path(void) {
hidden_def(selinux_file_context_subs_path)
+const char * selinux_file_context_subs_dist_path(void) {
+ return get_path(FILE_CONTEXT_SUBS_DIST);
+}
+
+hidden_def(selinux_file_context_subs_dist_path)
+
const char *selinux_sepgsql_context_path()
{
return get_path(SEPGSQL_CONTEXTS);
diff --git a/libselinux/src/selinux_internal.h b/libselinux/src/selinux_internal.h
index fdddfaf..806e87c 100644
--- a/libselinux/src/selinux_internal.h
+++ b/libselinux/src/selinux_internal.h
@@ -3,6 +3,7 @@
#include "dso.h"
hidden_proto(selinux_mkload_policy)
+ hidden_proto(fini_selinuxmnt)
hidden_proto(set_selinuxmnt)
hidden_proto(security_disable)
hidden_proto(security_policyvers)
@@ -65,6 +66,7 @@ hidden_proto(selinux_mkload_policy)
hidden_proto(selinux_file_context_path)
hidden_proto(selinux_file_context_homedir_path)
hidden_proto(selinux_file_context_local_path)
+ hidden_proto(selinux_file_context_subs_dist_path)
hidden_proto(selinux_file_context_subs_path)
hidden_proto(selinux_netfilter_context_path)
hidden_proto(selinux_homedir_context_path)
@@ -114,10 +116,7 @@ extern int selinux_page_size hidden;
/* Pthread key macros */
#define __selinux_key_create(KEY, DESTRUCTOR) \
- do { \
- if (pthread_key_create != NULL) \
- pthread_key_create(KEY, DESTRUCTOR); \
- } while (0)
+ (pthread_key_create != NULL ? pthread_key_create(KEY, DESTRUCTOR) : -1)
#define __selinux_key_delete(KEY) \
do { \
diff --git a/libselinux/src/selinuxswig_python.i b/libselinux/src/selinuxswig_python.i
index dea0e80..bb227e9 100644
--- a/libselinux/src/selinuxswig_python.i
+++ b/libselinux/src/selinuxswig_python.i
@@ -45,7 +45,7 @@ def install(src, dest):
PyObject* list = PyList_New(*$2);
int i;
for (i = 0; i < *$2; i++) {
- PyList_SetItem(list, i, PyString_FromString((*$1)[i]));
+ PyList_SetItem(list, i, PyBytes_FromString((*$1)[i]));
}
$result = SWIG_Python_AppendOutput($result, list);
}
@@ -74,7 +74,9 @@ def install(src, dest):
len++;
plist = PyList_New(len);
for (i = 0; i < len; i++) {
- PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
+ PyList_SetItem(plist, i,
+ PyBytes_FromString((*$1)[i])
+ );
}
} else {
plist = PyList_New(0);
@@ -91,7 +93,9 @@ def install(src, dest):
if (*$1) {
plist = PyList_New(result);
for (i = 0; i < result; i++) {
- PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
+ PyList_SetItem(plist, i,
+ PyBytes_FromString((*$1)[i])
+ );
}
} else {
plist = PyList_New(0);
@@ -144,16 +148,20 @@ def install(src, dest):
$1 = (char**) malloc(size + 1);
for(i = 0; i < size; i++) {
- if (!PyString_Check(PySequence_GetItem($input, i))) {
- PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings");
+ if (!PyBytes_Check(PySequence_GetItem($input, i))) {
+ PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
+
return NULL;
}
+
}
for(i = 0; i < size; i++) {
s = PySequence_GetItem($input, i);
- $1[i] = (char*) malloc(PyString_Size(s) + 1);
- strcpy($1[i], PyString_AsString(s));
+
+ $1[i] = (char*) malloc(PyBytes_Size(s) + 1);
+ strcpy($1[i], PyBytes_AsString(s));
+
}
$1[size] = NULL;
}
2011-02-01 22:40:11 +00:00
diff --git a/libselinux/src/selinuxswig_wrap.c b/libselinux/src/selinuxswig_wrap.c
index e0884f6..b131d2e 100644
2011-02-01 22:40:11 +00:00
--- a/libselinux/src/selinuxswig_wrap.c
+++ b/libselinux/src/selinuxswig_wrap.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.40
+ * Version 2.0.1
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
@@ -177,7 +177,7 @@
/*
Flags/methods for returning states.
- The SWIG conversion methods, as ConvertPtr, return and integer
+ The SWIG conversion methods, as ConvertPtr, return an integer
that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes).
@@ -1064,9 +1064,6 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
/* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
* pyrun.swg
*
* This file contains the runtime support for Python modules
@@ -1113,8 +1110,18 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
-#define SWIG_fail goto fail
+#define SWIG_fail goto fail
+/*
+ * Python 2.7 and newer and Python 3.1 and newer should use Capsules API instead of
+ * CObjects API.
+ */
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
+ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0))
+#define USE_CAPSULES
+#define TYPE_POINTER_NAME \
+ ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
+#endif
/* Runtime API implementation */
@@ -2047,10 +2054,13 @@ _SWIG_This(void)
return SWIG_Python_str_FromChar("this");
}
+static PyObject *swig_this = NULL;
+
SWIGRUNTIME PyObject *
SWIG_This(void)
{
- static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
+ if (swig_this == NULL)
+ swig_this = _SWIG_This();
return swig_this;
}
@@ -2154,7 +2164,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
int newmemory = 0;
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
if (newmemory == SWIG_CAST_NEW_MEMORY) {
- assert(own);
+ assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
if (own)
*own = *own | SWIG_CAST_NEW_MEMORY;
}
@@ -2424,8 +2434,12 @@ SWIG_Python_GetModule(void) {
#ifdef SWIG_LINK_RUNTIME
type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
#else
+#ifdef USE_CAPSULES
+ type_pointer = PyCapsule_Import(TYPE_POINTER_NAME, 0);
+#else
type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+#endif
if (PyErr_Occurred()) {
PyErr_Clear();
type_pointer = (void *)0;
@@ -2470,9 +2484,14 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
SWIGRUNTIME void
SWIG_Python_DestroyModule(void *vptr)
{
+ size_t i;
+#ifdef USE_CAPSULES
+ swig_module_info *swig_module =
+ (swig_module_info *) PyCapsule_GetPointer((PyObject *)vptr, TYPE_POINTER_NAME);
+#else
swig_module_info *swig_module = (swig_module_info *) vptr;
+#endif
swig_type_info **types = swig_module->types;
- size_t i;
for (i =0; i < swig_module->size; ++i) {
swig_type_info *ty = types[i];
if (ty->owndata) {
@@ -2481,6 +2500,7 @@ SWIG_Python_DestroyModule(void *vptr)
}
}
Py_DECREF(SWIG_This());
+ swig_this = NULL;
}
SWIGRUNTIME void
@@ -2494,9 +2514,18 @@ SWIG_Python_SetModule(swig_module_info *swig_module) {
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
swig_empty_runtime_method_table);
#endif
+#ifdef USE_CAPSULES
+ PyObject *pointer = PyCapsule_New((void *)swig_module, TYPE_POINTER_NAME,
+ (PyCapsule_Destructor)SWIG_Python_DestroyModule);
+#else
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+#endif
if (pointer && module) {
+#ifdef USE_CAPSULES
+ PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
+#else
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+#endif
} else {
Py_XDECREF(pointer);
}
@@ -2517,12 +2546,20 @@ SWIG_Python_TypeQuery(const char *type)
PyObject *obj = PyDict_GetItem(cache, key);
swig_type_info *descriptor;
if (obj) {
+#ifdef USE_CAPSULES
+ descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, type);
+#else
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+#endif
} else {
swig_module_info *swig_module = SWIG_Python_GetModule();
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
if (descriptor) {
+#ifdef USE_CAPSULES
+ obj = PyCapsule_New(descriptor, type, NULL);
+#else
obj = PyCObject_FromVoidPtr(descriptor, NULL);
+#endif
PyDict_SetItem(cache, key, obj);
Py_DECREF(obj);
}
@@ -2717,7 +2754,7 @@ static swig_module_info swig_module = {swig_types, 34, 0, 0, 0, 0};
#endif
#define SWIG_name "_selinux"
-#define SWIGVERSION 0x010340
+#define SWIGVERSION 0x020001
#define SWIG_VERSION SWIGVERSION
@@ -3345,7 +3382,7 @@ fail:
SWIGINTERN PyObject *_wrap_avc_context_to_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
security_id_t *arg2 = (security_id_t *) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -3360,7 +3397,7 @@ SWIGINTERN PyObject *_wrap_avc_context_to_sid(PyObject *SWIGUNUSEDPARM(self), Py
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
result = (int)avc_context_to_sid(arg1,arg2);
@@ -3383,7 +3420,7 @@ fail:
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_context_t arg1 = (security_context_t) (security_context_t)0 ;
security_id_t *arg2 = (security_id_t *) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -3398,7 +3435,7 @@ SWIGINTERN PyObject *_wrap_avc_context_to_sid_raw(PyObject *SWIGUNUSEDPARM(self)
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
result = (int)avc_context_to_sid_raw(arg1,arg2);
@@ -5641,7 +5678,9 @@ SWIGINTERN PyObject *_wrap_get_ordered_context_list(PyObject *SWIGUNUSEDPARM(sel
if (*arg3) {
plist = PyList_New(result);
for (i = 0; i < result; i++) {
- PyList_SetItem(plist, i, PyString_FromString((*arg3)[i]));
+ PyList_SetItem(plist, i,
+ PyBytes_FromString((*arg3)[i])
+ );
}
} else {
plist = PyList_New(0);
@@ -5714,7 +5753,9 @@ SWIGINTERN PyObject *_wrap_get_ordered_context_list_with_level(PyObject *SWIGUNU
if (*arg4) {
plist = PyList_New(result);
for (i = 0; i < result; i++) {
- PyList_SetItem(plist, i, PyString_FromString((*arg4)[i]));
+ PyList_SetItem(plist, i,
+ PyBytes_FromString((*arg4)[i])
+ );
}
} else {
plist = PyList_New(0);
@@ -6390,7 +6431,7 @@ fail:
SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6400,7 +6441,7 @@ SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args
if (!PyArg_ParseTuple(args,(char *)"O:setcon",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6421,7 +6462,7 @@ fail:
SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6431,7 +6472,7 @@ SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *
if (!PyArg_ParseTuple(args,(char *)"O:setcon_raw",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6650,7 +6691,7 @@ fail:
SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6660,7 +6701,7 @@ SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *
if (!PyArg_ParseTuple(args,(char *)"O:setexeccon",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6681,7 +6722,7 @@ fail:
SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6691,7 +6732,7 @@ SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObje
if (!PyArg_ParseTuple(args,(char *)"O:setexeccon_raw",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6772,7 +6813,7 @@ fail:
SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6782,7 +6823,7 @@ SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObje
if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6803,7 +6844,7 @@ fail:
SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6813,7 +6854,7 @@ SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), Py
if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon_raw",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6894,7 +6935,7 @@ fail:
SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6904,7 +6945,7 @@ SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObj
if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -6925,7 +6966,7 @@ fail:
SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6935,7 +6976,7 @@ SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), P
if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon_raw",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -7016,7 +7057,7 @@ fail:
SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -7026,7 +7067,7 @@ SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyOb
if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -7047,7 +7088,7 @@ fail:
SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -7057,7 +7098,7 @@ SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self),
if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon_raw",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -8514,8 +8555,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_av(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
access_vector_t arg4 ;
struct av_decision *arg5 = (struct av_decision *) 0 ;
@@ -8541,12 +8582,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av(PyObject *SWIGUNUSEDPARM(self), P
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 '" "security_compute_av" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av" "', 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 '" "security_compute_av" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8584,8 +8625,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_av_raw(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
access_vector_t arg4 ;
struct av_decision *arg5 = (struct av_decision *) 0 ;
@@ -8611,12 +8652,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av_raw(PyObject *SWIGUNUSEDPARM(self
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 '" "security_compute_av_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_raw" "', 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 '" "security_compute_av_raw" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_raw" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8654,8 +8695,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_av_flags(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
access_vector_t arg4 ;
struct av_decision *arg5 = (struct av_decision *) 0 ;
@@ -8681,12 +8722,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av_flags(PyObject *SWIGUNUSEDPARM(se
if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_flags",&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 '" "security_compute_av_flags" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_flags" "', 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 '" "security_compute_av_flags" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_flags" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8724,8 +8765,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_av_flags_raw(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
access_vector_t arg4 ;
struct av_decision *arg5 = (struct av_decision *) 0 ;
@@ -8751,12 +8792,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av_flags_raw(PyObject *SWIGUNUSEDPAR
if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_flags_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 '" "security_compute_av_flags_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_flags_raw" "', 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 '" "security_compute_av_flags_raw" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_flags_raw" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8794,8 +8835,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_create(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
security_context_t *arg4 = (security_context_t *) 0 ;
int res1 ;
@@ -8816,12 +8857,12 @@ SWIGINTERN PyObject *_wrap_security_compute_create(PyObject *SWIGUNUSEDPARM(self
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 '" "security_compute_create" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create" "', 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 '" "security_compute_create" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8857,8 +8898,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_create_raw(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
security_context_t *arg4 = (security_context_t *) 0 ;
int res1 ;
@@ -8879,12 +8920,12 @@ SWIGINTERN PyObject *_wrap_security_compute_create_raw(PyObject *SWIGUNUSEDPARM(
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 '" "security_compute_create_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create_raw" "', 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 '" "security_compute_create_raw" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create_raw" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8920,8 +8961,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_relabel(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
security_context_t *arg4 = (security_context_t *) 0 ;
int res1 ;
@@ -8942,12 +8983,12 @@ SWIGINTERN PyObject *_wrap_security_compute_relabel(PyObject *SWIGUNUSEDPARM(sel
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel" "', 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 '" "security_compute_relabel" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -8983,8 +9024,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_relabel_raw(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
security_context_t *arg4 = (security_context_t *) 0 ;
int res1 ;
@@ -9005,12 +9046,12 @@ SWIGINTERN PyObject *_wrap_security_compute_relabel_raw(PyObject *SWIGUNUSEDPARM
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel_raw" "', 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 '" "security_compute_relabel_raw" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel_raw" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -9046,8 +9087,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_member(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
security_context_t *arg4 = (security_context_t *) 0 ;
int res1 ;
@@ -9068,12 +9109,12 @@ SWIGINTERN PyObject *_wrap_security_compute_member(PyObject *SWIGUNUSEDPARM(self
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member" "', 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 '" "security_compute_member" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -9109,8 +9150,8 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_member_raw(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_context_t arg1 = (security_context_t) (security_context_t)0 ;
+ security_context_t arg2 = (security_context_t) (security_context_t)0 ;
security_class_t arg3 ;
security_context_t *arg4 = (security_context_t *) 0 ;
int res1 ;
@@ -9131,12 +9172,12 @@ SWIGINTERN PyObject *_wrap_security_compute_member_raw(PyObject *SWIGUNUSEDPARM(
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member_raw" "', 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 '" "security_compute_member_raw" "', argument " "2"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member_raw" "', argument " "2"" of type '" "security_context_t const""'");
}
arg2 = (security_context_t)(buf2);
ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
@@ -9172,7 +9213,7 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
char *arg2 = (char *) 0 ;
security_context_t **arg3 = (security_context_t **) 0 ;
int res1 ;
@@ -9192,7 +9233,7 @@ SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self),
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
@@ -9217,7 +9258,9 @@ SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self),
len++;
plist = PyList_New(len);
for (i = 0; i < len; i++) {
- PyList_SetItem(plist, i, PyString_FromString((*arg3)[i]));
+ PyList_SetItem(plist, i,
+ PyBytes_FromString((*arg3)[i])
+ );
}
} else {
plist = PyList_New(0);
@@ -9243,7 +9286,7 @@ fail:
SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
char *arg2 = (char *) 0 ;
security_context_t **arg3 = (security_context_t **) 0 ;
int res1 ;
@@ -9263,7 +9306,7 @@ SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(se
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 '" "security_compute_user_raw" "', argument " "1"" of type '" "security_context_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
@@ -9288,7 +9331,9 @@ SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(se
len++;
plist = PyList_New(len);
for (i = 0; i < len; i++) {
- PyList_SetItem(plist, i, PyString_FromString((*arg3)[i]));
+ PyList_SetItem(plist, i,
+ PyBytes_FromString((*arg3)[i])
+ );
}
} else {
plist = PyList_New(0);
@@ -9721,7 +9766,7 @@ fail:
SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -9731,7 +9776,7 @@ SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self)
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -9752,7 +9797,7 @@ fail:
SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -9762,7 +9807,7 @@ SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(s
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -9783,7 +9828,7 @@ fail:
SWIGINTERN PyObject *_wrap_security_canonicalize_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
security_context_t *arg2 = (security_context_t *) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -9796,7 +9841,7 @@ SWIGINTERN PyObject *_wrap_security_canonicalize_context(PyObject *SWIGUNUSEDPAR
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -9825,7 +9870,7 @@ fail:
SWIGINTERN PyObject *_wrap_security_canonicalize_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
security_context_t *arg2 = (security_context_t *) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -9838,7 +9883,7 @@ SWIGINTERN PyObject *_wrap_security_canonicalize_context_raw(PyObject *SWIGUNUSE
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context_raw" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -9994,7 +10039,7 @@ SWIGINTERN PyObject *_wrap_security_get_boolean_names(PyObject *SWIGUNUSEDPARM(s
PyObject* list = PyList_New(*arg2);
int i;
for (i = 0; i < *arg2; i++) {
- PyList_SetItem(list, i, PyString_FromString((*arg1)[i]));
+ PyList_SetItem(list, i, PyBytes_FromString((*arg1)[i]));
}
resultobj = SWIG_Python_AppendOutput(resultobj, list);
}
@@ -11129,6 +11174,19 @@ fail:
}
+SWIGINTERN PyObject *_wrap_selinux_sepgsql_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":selinux_sepgsql_context_path")) SWIG_fail;
+ result = (char *)selinux_sepgsql_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 ;
@@ -11317,7 +11375,7 @@ fail:
SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -11327,7 +11385,7 @@ SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDP
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_check_securetty_context" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -11412,16 +11470,20 @@ SWIGINTERN PyObject *_wrap_rpm_execcon(PyObject *SWIGUNUSEDPARM(self), PyObject
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");
+ if (!PyBytes_Check(PySequence_GetItem(obj2, i))) {
+ PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
+
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[i] = (char*) malloc(PyBytes_Size(s) + 1);
+ strcpy(arg3[i], PyBytes_AsString(s));
+
}
arg3[size] = NULL;
}
@@ -11439,16 +11501,20 @@ SWIGINTERN PyObject *_wrap_rpm_execcon(PyObject *SWIGUNUSEDPARM(self), PyObject
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");
+ if (!PyBytes_Check(PySequence_GetItem(obj3, i))) {
+ PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
+
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[i] = (char*) malloc(PyBytes_Size(s) + 1);
+ strcpy(arg4[i], PyBytes_AsString(s));
+
}
arg4[size] = NULL;
}
@@ -11502,7 +11568,7 @@ fail:
SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -11512,7 +11578,7 @@ SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_context_customizable" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -11533,7 +11599,7 @@ fail:
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 arg1 = (security_context_t) (security_context_t)0 ;
security_context_t *arg2 = (security_context_t *) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -11546,7 +11612,7 @@ SWIGINTERN PyObject *_wrap_selinux_trans_to_raw_context(PyObject *SWIGUNUSEDPARM
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_trans_to_raw_context" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -11575,7 +11641,7 @@ fail:
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 arg1 = (security_context_t) (security_context_t)0 ;
security_context_t *arg2 = (security_context_t *) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -11588,7 +11654,7 @@ SWIGINTERN PyObject *_wrap_selinux_raw_to_trans_context(PyObject *SWIGUNUSEDPARM
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_to_trans_context" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -11617,7 +11683,7 @@ fail:
SWIGINTERN PyObject *_wrap_selinux_raw_context_to_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- security_context_t arg1 = (security_context_t) 0 ;
+ security_context_t arg1 = (security_context_t) (security_context_t)0 ;
char **arg2 = (char **) 0 ;
int res1 ;
char *buf1 = 0 ;
@@ -11630,7 +11696,7 @@ SWIGINTERN PyObject *_wrap_selinux_raw_context_to_color(PyObject *SWIGUNUSEDPARM
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""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_context_to_color" "', argument " "1"" of type '" "security_context_t const""'");
}
arg1 = (security_context_t)(buf1);
{
@@ -12172,6 +12238,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"selinux_virtual_domain_context_path", _wrap_selinux_virtual_domain_context_path, METH_VARARGS, NULL},
{ (char *)"selinux_virtual_image_context_path", _wrap_selinux_virtual_image_context_path, METH_VARARGS, NULL},
{ (char *)"selinux_x_context_path", _wrap_selinux_x_context_path, METH_VARARGS, NULL},
+ { (char *)"selinux_sepgsql_context_path", _wrap_selinux_sepgsql_context_path, METH_VARARGS, NULL},
{ (char *)"selinux_contexts_path", _wrap_selinux_contexts_path, METH_VARARGS, NULL},
{ (char *)"selinux_securetty_types_path", _wrap_selinux_securetty_types_path, METH_VARARGS, NULL},
{ (char *)"selinux_booleans_path", _wrap_selinux_booleans_path, METH_VARARGS, NULL},
@@ -12185,7 +12252,7 @@ static PyMethodDef SwigMethods[] = {
{ (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 *)"set_selinuxmnto", _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},
2011-02-01 22:40:11 +00:00
@@ -12868,15 +12935,15 @@ extern "C" {
}
}
if (ci) {
- size_t shift = (ci->ptype) - types;
- swig_type_info *ty = types_initial[shift];
- size_t ldoc = (c - methods[i].ml_doc);
- size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
- char *ndoc = (char*)malloc(ldoc + lptr + 10);
- if (ndoc) {
- char *buff = ndoc;
- void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
- if (ptr) {
+ void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+ if (ptr) {
+ size_t shift = (ci->ptype) - types;
+ swig_type_info *ty = types_initial[shift];
+ size_t ldoc = (c - methods[i].ml_doc);
+ size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+ char *ndoc = (char*)malloc(ldoc + lptr + 10);
+ if (ndoc) {
+ char *buff = ndoc;
strncpy(buff, methods[i].ml_doc, ldoc);
buff += ldoc;
strncpy(buff, "swig_ptr: ", 10);
@@ -14079,6 +14146,7 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "SELABEL_CTX_FILE",SWIG_From_int((int)(0)));
SWIG_Python_SetConstant(d, "SELABEL_CTX_MEDIA",SWIG_From_int((int)(1)));
SWIG_Python_SetConstant(d, "SELABEL_CTX_X",SWIG_From_int((int)(2)));
+ SWIG_Python_SetConstant(d, "SELABEL_CTX_DB",SWIG_From_int((int)(3)));
SWIG_Python_SetConstant(d, "SELABEL_OPT_UNUSED",SWIG_From_int((int)(0)));
SWIG_Python_SetConstant(d, "SELABEL_OPT_VALIDATE",SWIG_From_int((int)(1)));
SWIG_Python_SetConstant(d, "SELABEL_OPT_BASEONLY",SWIG_From_int((int)(2)));
@@ -14092,6 +14160,15 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "SELABEL_X_SELN",SWIG_From_int((int)(5)));
SWIG_Python_SetConstant(d, "SELABEL_X_POLYPROP",SWIG_From_int((int)(6)));
SWIG_Python_SetConstant(d, "SELABEL_X_POLYSELN",SWIG_From_int((int)(7)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_DATABASE",SWIG_From_int((int)(1)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_SCHEMA",SWIG_From_int((int)(2)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_TABLE",SWIG_From_int((int)(3)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_COLUMN",SWIG_From_int((int)(4)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_SEQUENCE",SWIG_From_int((int)(5)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_VIEW",SWIG_From_int((int)(6)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_PROCEDURE",SWIG_From_int((int)(7)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_BLOB",SWIG_From_int((int)(8)));
+ SWIG_Python_SetConstant(d, "SELABEL_DB_TUPLE",SWIG_From_int((int)(9)));
SWIG_Python_SetConstant(d, "SELINUX_AVD_FLAGS_PERMISSIVE",SWIG_From_int((int)(0x0001)));
SWIG_Python_SetConstant(d, "SELINUX_CB_LOG",SWIG_From_int((int)(0)));
SWIG_Python_SetConstant(d, "SELINUX_CB_AUDIT",SWIG_From_int((int)(1)));
diff --git a/libselinux/src/setrans_client.c b/libselinux/src/setrans_client.c
index 4bdbe08..e074142 100644
--- a/libselinux/src/setrans_client.c
+++ b/libselinux/src/setrans_client.c
@@ -35,6 +35,7 @@ static __thread security_context_t prev_r2c_raw = NULL;
static pthread_once_t once = PTHREAD_ONCE_INIT;
static pthread_key_t destructor_key;
+static int destructor_key_initialized = 0;
static __thread char destructor_initialized;
/*
@@ -254,7 +255,8 @@ static void setrans_thread_destructor(void __attribute__((unused)) *unused)
void __attribute__((destructor)) setrans_lib_destructor(void)
{
- __selinux_key_delete(destructor_key);
+ if (destructor_key_initialized)
+ __selinux_key_delete(destructor_key);
}
static inline void init_thread_destructor(void)
@@ -267,7 +269,9 @@ static inline void init_thread_destructor(void)
static void init_context_translations(void)
{
- __selinux_key_create(&destructor_key, setrans_thread_destructor);
+ if (__selinux_key_create(&destructor_key, setrans_thread_destructor) == 0)
+ destructor_key_initialized = 1;
+
mls_enabled = is_selinux_mls_enabled();
}