summaryrefslogtreecommitdiffstats
path: root/source/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
commit166aee6cc2abb5f6e91ebf3d4ec37454034b8dcd (patch)
treec58f169215c0d076c9441501ea18f0ea79f1705c /source/python/py_samr.c
parentb6e860546a622e6da238faf56d7c1567c6cf63a5 (diff)
downloadsamba-166aee6cc2abb5f6e91ebf3d4ec37454034b8dcd.tar.gz
samba-166aee6cc2abb5f6e91ebf3d4ec37454034b8dcd.tar.xz
samba-166aee6cc2abb5f6e91ebf3d4ec37454034b8dcd.zip
Allow None to be used as a valid credential for functions that take a
credential as a parameter.
Diffstat (limited to 'source/python/py_samr.c')
-rw-r--r--source/python/py_samr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/python/py_samr.c b/source/python/py_samr.c
index f715f891b4f..733a57c1d4f 100644
--- a/source/python/py_samr.c
+++ b/source/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);