* libselinux patch to add interfaces in avc.h to python bindings
@ 2008-06-11 16:43 Daniel J Walsh
2008-06-11 19:05 ` Stephen Smalley
0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Walsh @ 2008-06-11 16:43 UTC (permalink / raw)
To: SE Linux
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: libselinux-rhat.patch --]
[-- Type: text/plain, Size: 1642 bytes --]
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-2.0.64/src/selinuxswig.i
--- nsalibselinux/src/selinuxswig.i 2008-05-06 14:33:15.000000000 -0400
+++ libselinux-2.0.64/src/selinuxswig.i 2008-05-07 13:08:06.000000000 -0400
@@ -5,6 +5,7 @@
%module selinux
%{
#include "selinux/selinux.h"
+ #include "../include/selinux/avc.h"
#include "../include/selinux/selinux.h"
#include "../include/selinux/get_default_type.h"
#include "../include/selinux/get_context_list.h"
@@ -47,6 +48,10 @@
%ignore set_matchpathcon_invalidcon;
%ignore set_matchpathcon_canoncon;
+%ignore avc_add_callback;
+
%include "../include/selinux/selinux.h"
+%include "../include/selinux/avc.h"
%include "../include/selinux/get_default_type.h"
%include "../include/selinux/get_context_list.h"
+
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libselinux-2.0.64/src/selinuxswig_python.i
--- nsalibselinux/src/selinuxswig_python.i 2007-10-01 09:54:35.000000000 -0400
+++ libselinux-2.0.64/src/selinuxswig_python.i 2008-05-07 13:08:06.000000000 -0400
@@ -16,6 +16,20 @@
$result = SWIG_Python_AppendOutput($result, list);
}
+/* return a sid along with the result */
+%typemap(argout) (security_id_t * sid) {
+ if (*$1) {
+ %append_output(SWIG_NewPointerObj(*$1, $descriptor(security_id_t), 0));
+ } else {
+ Py_INCREF(Py_None);
+ %append_output(Py_None);
+ }
+}
+
+%typemap(in,numinputs=0) security_id_t *(security_id_t temp) {
+ $1 = &temp;
+}
+
/* Makes security_compute_user() return a Python list of contexts */
%typemap(argout) (security_context_t **con) {
PyObject* plist;
[-- Attachment #3: libselinux-rhat.patch.sig --]
[-- Type: application/pgp-signature, Size: 72 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: libselinux patch to add interfaces in avc.h to python bindings
2008-06-11 16:43 libselinux patch to add interfaces in avc.h to python bindings Daniel J Walsh
@ 2008-06-11 19:05 ` Stephen Smalley
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2008-06-11 19:05 UTC (permalink / raw)
To: Daniel J Walsh; +Cc: SE Linux
On Wed, 2008-06-11 at 12:43 -0400, Daniel J Walsh wrote:
> plain text document attachment (libselinux-rhat.patch)
> diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-2.0.64/src/selinuxswig.i
> --- nsalibselinux/src/selinuxswig.i 2008-05-06 14:33:15.000000000 -0400
> +++ libselinux-2.0.64/src/selinuxswig.i 2008-05-07 13:08:06.000000000 -0400
> @@ -5,6 +5,7 @@
> %module selinux
> %{
> #include "selinux/selinux.h"
> + #include "../include/selinux/avc.h"
> #include "../include/selinux/selinux.h"
> #include "../include/selinux/get_default_type.h"
> #include "../include/selinux/get_context_list.h"
> @@ -47,6 +48,10 @@
> %ignore set_matchpathcon_invalidcon;
> %ignore set_matchpathcon_canoncon;
>
> +%ignore avc_add_callback;
> +
> %include "../include/selinux/selinux.h"
> +%include "../include/selinux/avc.h"
> %include "../include/selinux/get_default_type.h"
> %include "../include/selinux/get_context_list.h"
> +
> diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libselinux-2.0.64/src/selinuxswig_python.i
> --- nsalibselinux/src/selinuxswig_python.i 2007-10-01 09:54:35.000000000 -0400
> +++ libselinux-2.0.64/src/selinuxswig_python.i 2008-05-07 13:08:06.000000000 -0400
> @@ -16,6 +16,20 @@
> $result = SWIG_Python_AppendOutput($result, list);
> }
>
> +/* return a sid along with the result */
> +%typemap(argout) (security_id_t * sid) {
> + if (*$1) {
> + %append_output(SWIG_NewPointerObj(*$1, $descriptor(security_id_t), 0));
> + } else {
> + Py_INCREF(Py_None);
> + %append_output(Py_None);
> + }
> +}
> +
> +%typemap(in,numinputs=0) security_id_t *(security_id_t temp) {
> + $1 = &temp;
> +}
> +
> /* Makes security_compute_user() return a Python list of contexts */
> %typemap(argout) (security_context_t **con) {
> PyObject* plist;
Thanks, merged.
--
Stephen Smalley
National Security Agency
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-11 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11 16:43 libselinux patch to add interfaces in avc.h to python bindings Daniel J Walsh
2008-06-11 19:05 ` Stephen Smalley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.