]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Check against python None type when filling in auth parameters
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 10 Sep 2012 15:45:53 +0000 (16:45 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Sep 2012 11:16:17 +0000 (12:16 +0100)
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>
python/libvirt-override.c

index 768144a009690fdbf9e60dd58b53c88f8f341fa3..bb1d881f1ea8392768bc2fb22dd914f873dceb51 100644 (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;