Skip to contentSkip to conversation

Fix set* functions parameter

PATCH In review Glauber de Oliveira Costa 2 participants 2 messages May 2, 2006 – May 8, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix set* functions parameter

In general, functions in the set* family (like setcon and setfilecon) receives a security_context_t as a parameter. This patch includes the correspondent typemap for it, allowing those functions to be sucessfully called.

Index: selinuxswig.i
===================================================================
RCS file: /cvsroot/selinux/nsa/selinux-usr/libselinux/src/selinuxswig.i,v retrieving revision 1.3

selinuxswig.i +4 -0
diff -u -p -r1.3 selinuxswig.i
@@ -30,6 +30,10 @@
 }
 %typemap(argout) security_context_t * {
 	$result = t_output_helper($result, PyString_FromString(*$1));
+} 
+
+%typemap(in) security_context_t {
+	$1 = (security_context_t)PyString_AsString($input);
 }
 
 extern int is_selinux_enabled(void);
#1 lore raw
Quoted 3 lines · Glauber de Oliveira Costa

In general, functions in the set* family (like setcon and setfilecon) receives a security_context_t as a parameter. This patch includes the correspondent typemap for it, allowing those functions to be sucessfully called.

Thanks, merged as part of Dan's larger libselinux patch.

Signature · 8 lines
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 [email protected] with
the words "unsubscribe selinux" without quotes as the message.