1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 16:25:10 +03:00

Check against python None type when filling in auth parameters

When deciding whether to provide an auth function callback
in openAuth(), credcb was checked against NULL, when it
really needs to be checked against Py_None

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-09-10 16:45:53 +01:00
parent 7984eccd24
commit c9378ecd73

View File

@ -1840,7 +1840,8 @@ libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
auth.credtype[i] = (int)PyLong_AsLong(val);
}
}
auth.cb = pycredcb ? virConnectCredCallbackWrapper : NULL;
if (pycredcb && pycredcb != Py_None)
auth.cb = virConnectCredCallbackWrapper;
auth.cbdata = pyauth;
LIBVIRT_BEGIN_ALLOW_THREADS;