[libvirt] Some questions about virConnectAuthCallbackPtr

Daniel P. Berrange berrange at redhat.com
Mon Oct 15 10:13:25 UTC 2012


On Sat, Oct 13, 2012 at 03:52:06PM +0100, Richard W.M. Jones wrote:
> Some questions which seem to be left ambigious by the documentation
> for virConnectAuthCallbackPtr:
> 
> http://libvirt.org/html/libvirt-libvirt.html#virConnectAuthCallbackPtr
> 
> (1) For a single open, can this be called multiple times?  I'm
> thinking, some authentication methods might give the user N attempts
> at typing the password, which might result in N callbacks here.

It depends on the driver and auth mechanism, but yes, the callback can
be invoked multiple times. The remote driver tries to ask for as many
credentials at the same time as possible, but SASL allows for triggering
the auth callback multiuple during the auth process. The ESX driver will
actually ask for credentials separately IIRC.

> (2) The documentation says: "Returns: 0 if all interactions were
> filled, or -1 upon error".  However it also says "If an interaction
> cannot be filled, fill in NULL and 0".  Does that mean it's OK (not an
> error, return 0) if a result field is set to NULL?

Correct, filling in NULL and 0 is an allowed non-error condition, to
indicate that the user didn't have any data to provide for that field.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list