* libselinux swig wrapper breakage
@ 2006-02-20 4:12 Chris PeBenito
2006-02-20 7:22 ` Ivan Gyurdiev
0 siblings, 1 reply; 3+ messages in thread
From: Chris PeBenito @ 2006-02-20 4:12 UTC (permalink / raw)
To: SELinux Mail List
[-- Attachment #1: Type: text/plain, Size: 681 bytes --]
I was testing a few functions from the libselinux swig wrapper (cvs
selinux-usr) and ran in to problems:
>>> import selinux
>>> selinux.setexeccon('user_u:user_r:user_spamassassin_t')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: argument number 1: a 'security_context_t *' is expected, 'str(user_u:user_r:user_spamassassin_t)' is received
>>> selinux.getexeccon()
Segmentation fault
--
Chris PeBenito
<pebenito@gentoo.org>
Developer,
Hardened Gentoo Linux
Embedded Gentoo Linux
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A CB00 BC8E E42D E6AF 9243
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: libselinux swig wrapper breakage
2006-02-20 4:12 libselinux swig wrapper breakage Chris PeBenito
@ 2006-02-20 7:22 ` Ivan Gyurdiev
2006-02-20 7:31 ` Ivan Gyurdiev
0 siblings, 1 reply; 3+ messages in thread
From: Ivan Gyurdiev @ 2006-02-20 7:22 UTC (permalink / raw)
To: Chris PeBenito; +Cc: SELinux Mail List
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> TypeError: argument number 1: a 'security_context_t *' is expected, 'str(user_u:user_r:user_spamassassin_t)' is received
>
You're passing a string into something that expects a security_context_t.
That won't work - it fails, because security_context_t is an opaque
type, and swig has no idea that it represents a char*. It would know
that if selinux.h was included in the interface file. However, the swig
bindings for selinux take the approach of listing all the functions
manually (and omitting the public definition of security_context_t as a
char*).
--
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] 3+ messages in thread
* Re: libselinux swig wrapper breakage
2006-02-20 7:22 ` Ivan Gyurdiev
@ 2006-02-20 7:31 ` Ivan Gyurdiev
0 siblings, 0 replies; 3+ messages in thread
From: Ivan Gyurdiev @ 2006-02-20 7:31 UTC (permalink / raw)
To: Chris PeBenito; +Cc: SELinux Mail List
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> TypeError: argument number 1: a 'security_context_t *' is expected,
>> 'str(user_u:user_r:user_spamassassin_t)' is received
>>
> You're passing a string into something that expects a security_context_t.
>
> That won't work - it fails, because security_context_t is an opaque
> type, and swig has no idea that it represents a char*. It would know
> that if selinux.h was included in the interface file. However, the
> swig bindings for selinux take the approach of listing all the
> functions manually (and omitting the public definition of
> security_context_t as a char*).
Well, selinux.h is included in the bindings, but it isn't processed,
which is what I meant...
%{ #include %} is an inline declaration at a particular section of the
wrappers (I forget which one is default).
%include indicates the file should be processed by swig, and wrappers
generated.
--
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] 3+ messages in thread
end of thread, other threads:[~2006-02-20 7:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20 4:12 libselinux swig wrapper breakage Chris PeBenito
2006-02-20 7:22 ` Ivan Gyurdiev
2006-02-20 7:31 ` Ivan Gyurdiev
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.