All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: James Athey <jathey@tresys.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: [RFC][PATCH] libselinux: refactored SWIG bindings
Date: Tue, 04 Sep 2007 10:23:40 -0400	[thread overview]
Message-ID: <46DD6A6C.2040305@redhat.com> (raw)
In-Reply-To: <1181744873.18728.10.camel@exodus.columbia.tresys.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Athey wrote:
> I've attached refactored SWIG bindings for libselinux.  As
> requested, I've moved the Python specific wrappers into their own file.
> Here are some of the highlights:
> 
> * Should leak a lot less memory, because the wrapper handles memory
> management for lists and strings automatically
> * security_get_boolean_names is now usable
> * Instead of whitelisting functions to be wrapped, it blacklists
> functions that should not be wrapped
> 
> It's still not an ideal wrapper, partly because many functions still
> return two values - a return code, and the actual returned data.  In
> every language except C, the desired semantics would be just returning
> the data and throwing an exception if the return code != 0.  I didn't
> add this feature because it would definitely break existing code.
> 
> ~James
> 
> 

https://bugzilla.redhat.com/show_bug.cgi?id=276121

Bug in refactored SWIG Bindings.


#!/usr/bin/python

import selinux
args = [ "/bin/bash", "--version" ]
selinux.rpm_execcon(0, args[0], args, [ ])

Produces:

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    selinux.rpm_execcon(0, args[0], args, [ ])
TypeError: in method 'rpm_execcon', argument 3 of type 'char *const []'

Version-Release number of selected component (if applicable):
libselinux-2.0.31-3.fc8

James do  you have a nice quick fix for this?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFG3WpsrlYvE4MpobMRAr6CAJ92i9x0z8pCLfrlLk8IxveRTAY1RgCdGl81
So55zob/LavO32xM1vQCdnc=
=qMG5
-----END PGP SIGNATURE-----

--
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.

  parent reply	other threads:[~2007-09-04 14:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13 14:27 [RFC][PATCH] libselinux: refactored SWIG bindings James Athey
2007-06-19 11:40 ` Stephen Smalley
2007-06-19 15:08   ` James Athey
2007-06-19 18:48     ` Daniel J Walsh
2007-06-19 19:51       ` James Athey
2007-06-19 19:53         ` Daniel J Walsh
2007-06-22 19:38         ` Stephen Smalley
2007-09-04 14:23 ` Daniel J Walsh [this message]
2007-09-05 19:35   ` [PATCH] libselinux: fix rpm_execcon in " James Athey
2007-09-06 12:37     ` Daniel J Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46DD6A6C.2040305@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=jathey@tresys.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.