selinux June 2009 archive
Main Archive Page > Month Archives  > selinux archives
selinux: Re: This patch fixes the exception handling in libselin

Re: This patch fixes the exception handling in libselinux-python bindings

From: Joshua Brindle <method_at_nospam>
Date: Thu Jun 18 2009 - 14:23:02 GMT
To: Daniel J Walsh <dwalsh@redhat.com>


Daniel J Walsh wrote:
> On 05/19/2009 12:16 PM, Chad Sellers wrote:
>> On 5/18/09 2:10 PM, "Daniel J Walsh"<dwalsh@redhat.com> wrote:
>>
>>> Basically we need to search for all interfaces that return an int and
>>> set those up as python exception handlers.
>>
>> I presume this supercedes the patch submitted on March 4 titled "Patch to
>> python bindings" which used a single generic exception handler. Is that
>> correct? Why the switch from a generic exception handler to a shell
>> script
>> to generate lots of specific exception handlers?
>>
>> Thanks,
>> Chad
>>
>>
>> --
>> 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.
> Yes, that patch caused certain interfaces to not work if they did not
> return int.
>

This doesn't strike me as the best way to handle it. Assuming all functions that return an int returns it as a return code is a little overzealous. For example selinux_file_context_cmp() returns 1, 0, -1 for comparison. It is only not included in the exception.sh output by accident it appears (it is defined as int selinux_file_context_cmp(...) rather than extern int.

Which brings up the next point, there are a handful of functions in selinux.h that don't have extern which means exception handlers aren't made for them. -- 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.