summaryrefslogtreecommitdiff
path: root/source3/python/py_samr.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-28 02:09:54 +0000
committerTim Potter <tpot@samba.org>2002-05-28 02:09:54 +0000
commite99a265bad36f2525a5b04734ff996e66b624711 (patch)
treebb68aeb7a79f786f9669f4ddc06aa13c0d2224cd /source3/python/py_samr.c
parentd21f10d3e65ebdee7db8e4c122a0a623b65bcd49 (diff)
downloadsamba-e99a265bad36f2525a5b04734ff996e66b624711.tar.gz
samba-e99a265bad36f2525a5b04734ff996e66b624711.tar.bz2
samba-e99a265bad36f2525a5b04734ff996e66b624711.zip
Allow None to be used as a valid credential for functions that take a
credential as a parameter. (This used to be commit 166aee6cc2abb5f6e91ebf3d4ec37454034b8dcd)
Diffstat (limited to 'source3/python/py_samr.c')
-rw-r--r--source3/python/py_samr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/python/py_samr.c b/source3/python/py_samr.c
index f715f891b4..733a57c1d4 100644
--- a/source3/python/py_samr.c
+++ b/source3/python/py_samr.c
@@ -283,10 +283,16 @@ static PyObject *samr_connect(PyObject *self, PyObject *args, PyObject *kw)
NTSTATUS ntstatus;
if (!PyArg_ParseTupleAndKeywords(
- args, kw, "s|O!i", kwlist, &server, &PyDict_Type,
- &creds, &desired_access))
+ args, kw, "s|Oi", kwlist, &server, &creds,
+ &desired_access))
return NULL;
+ if (creds && creds != Py_None && !PyDict_Check(creds)) {
+ PyErr_SetString(PyExc_TypeError,
+ "credentials must be dictionary or None");
+ return NULL;
+ }
+
if (!(cli = open_pipe_creds(server, creds, PIPE_SAMR, &errstr))) {
PyErr_SetString(samr_error, errstr);
free(errstr);