diff options
Diffstat (limited to 'source3/python/py_spoolss_ports.c')
-rw-r--r-- | source3/python/py_spoolss_ports.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/python/py_spoolss_ports.c b/source3/python/py_spoolss_ports.c index f0bea5175d..8d59274a00 100644 --- a/source3/python/py_spoolss_ports.c +++ b/source3/python/py_spoolss_ports.c @@ -37,13 +37,18 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) /* Parse parameters */ if (!PyArg_ParseTupleAndKeywords( - args, kw, "s|iO!", kwlist, &server, &level, - &PyDict_Type, &creds)) + args, kw, "s|iO", kwlist, &server, &level, &creds)) return NULL; if (server[0] == '\\' && server[1] == '\\') server += 2; + 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_SPOOLSS, &errstr))) { PyErr_SetString(spoolss_error, errstr); free(errstr); |