2007-05-18 14:52:28 +00:00
|
|
|
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-2.0.15/src/selinuxswig.i
|
|
|
|
--- nsalibselinux/src/selinuxswig.i 2007-05-18 09:58:34.000000000 -0400
|
|
|
|
+++ libselinux-2.0.15/src/selinuxswig.i 2007-05-15 15:07:02.000000000 -0400
|
|
|
|
@@ -41,6 +40,36 @@
|
|
|
|
$1 = (security_context_t)PyString_AsString($input);
|
|
|
|
}
|
|
|
|
|
|
|
|
+%typemap(python,argout) security_context_t ** {
|
|
|
|
+ int i;
|
|
|
|
+ PyObject *security_context_string;
|
|
|
|
+
|
|
|
|
+ PyObject *list_security_context = PyList_New(0); // Create the list.
|
|
|
|
+ if (list_security_context) {
|
|
|
|
+ security_context_t *p_security_context_t = *arg3;
|
|
|
|
+ for (i=0; i < result; i++) {
|
|
|
|
+ security_context_string = PyString_FromString(strdup((char *)p_security_context_t[i]));
|
|
|
|
+ if (PyList_Append(list_security_context, security_context_string) < 0) {
|
|
|
|
+ PyErr_SetString(PyExc_MemoryError,"typemap(argout) security_context_t **: Fail to insert item in list.");
|
|
|
|
+ Py_DECREF(list_security_context);
|
|
|
|
+ $result = SWIG_From_int(STATUS_ERR);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ freeconary(p_security_context_t);
|
|
|
|
+ }
|
2007-04-23 14:38:02 +00:00
|
|
|
+ else {
|
2007-05-18 14:52:28 +00:00
|
|
|
+ PyErr_SetString(PyExc_MemoryError,"typemap(argout) security_context_t **: Fail to create list.");
|
|
|
|
+ $result = SWIG_From_int(STATUS_ERR);
|
2007-04-23 14:38:02 +00:00
|
|
|
+ }
|
|
|
|
+
|
2007-05-18 14:52:28 +00:00
|
|
|
+ %append_output(list_security_context);
|
2007-04-23 14:38:02 +00:00
|
|
|
+}
|
|
|
|
+
|
2007-05-18 14:52:28 +00:00
|
|
|
+%typemap(in, numinputs=0) security_context_t **(security_context_t *temp=NULL) {
|
|
|
|
+ $1 = &temp;
|
2007-04-23 14:38:02 +00:00
|
|
|
+}
|
|
|
|
+
|
2007-05-18 14:52:28 +00:00
|
|
|
%typedef unsigned mode_t;
|
2007-04-23 14:38:02 +00:00
|
|
|
|
2007-05-18 14:52:28 +00:00
|
|
|
%include "../include/selinux/get_context_list.h"
|