[libvirt] python binding: openAuth() segfaulting

Matthias Bolte matthias.bolte at googlemail.com
Tue Mar 16 16:50:42 UTC 2010


2010/3/16 Dan Kenigsberg <danken at redhat.com>:
> I was trying to learn how to use openAuth(uri, auth_cb, flags), and
> got:
>
> Python 2.6.2 (r262:71600, Jan 25 2010, 18:46:47)
> [GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import libvirt
>>>> libvirt.openAuth('qemu:///system', lambda x: None, 0)
> Segmentation fault (core dumped)
>
> I guess my lambda expression was not what libvirt expected, but still..
>
> Regards,
>
> Dan.
>

Yes, the python bindings lack proper input validation. If you pass
something unexpected it'll probably segfault.

I've started working on a patch that adds input validation to the
python bindings.

Until then, see examples/python/esxlist.py in the libvirt codebase for
the correct usage of the auth parameter in python.

Matthias




More information about the libvir-list mailing list