summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-09-10 16:45:53 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-09-11 12:16:17 +0100
commitc9378ecd737dac326b7a4ddc44a830f2dbe0e975 (patch)
treee1af8b9fc2435dce6eff087548379db0ec459d96
parent7984eccd246ff74d3992bd610cc11e0d2cb68994 (diff)
downloadlibvirt-python-split-c9378ecd737dac326b7a4ddc44a830f2dbe0e975.zip
libvirt-python-split-c9378ecd737dac326b7a4ddc44a830f2dbe0e975.tar.gz
libvirt-python-split-c9378ecd737dac326b7a4ddc44a830f2dbe0e975.tar.xz
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>
-rw-r--r--libvirt-override.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index 768144a..bb1d881 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -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;