diff options
author | Tim Potter <tpot@samba.org> | 2002-05-28 02:08:39 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-28 02:08:39 +0000 |
commit | b6e860546a622e6da238faf56d7c1567c6cf63a5 (patch) | |
tree | dd29d124bcd10fbaf23eff04155b1945e021b650 /source/python/py_lsa.c | |
parent | 7d10dc5f7bd12e25ea3e64b380a029c89929156f (diff) | |
download | samba-b6e860546a622e6da238faf56d7c1567c6cf63a5.tar.gz samba-b6e860546a622e6da238faf56d7c1567c6cf63a5.tar.xz samba-b6e860546a622e6da238faf56d7c1567c6cf63a5.zip |
Allow None to be used as a valid credential in open_policy.
Added {get,set}_debuglevel() and setup_logging() functions.
Diffstat (limited to 'source/python/py_lsa.c')
-rw-r--r-- | source/python/py_lsa.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/source/python/py_lsa.c b/source/python/py_lsa.c index 7edd6516422..0665578e60e 100644 --- a/source/python/py_lsa.c +++ b/source/python/py_lsa.c @@ -62,10 +62,15 @@ static PyObject *lsa_open_policy(PyObject *self, PyObject *args, POLICY_HND hnd; 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_LSARPC, &errstr))) { PyErr_SetString(lsa_error, errstr); free(errstr); @@ -360,6 +365,38 @@ static PyMethodDef lsa_methods[] = { METH_VARARGS, "Close a policy handle" }, + /* Other stuff - this should really go into a samba config module + but for the moment let's leave it here. */ + + { "setup_logging", (PyCFunction)py_setup_logging, + METH_VARARGS | METH_KEYWORDS, + "Set up debug logging. + +Initialises Samba's debug logging system. One argument is expected which +is a boolean specifying whether debugging is interactive and sent to stdout +or logged to a file. + +Example: + +>>> spoolss.setup_logging(interactive = 1)" }, + + { "get_debuglevel", (PyCFunction)get_debuglevel, + METH_VARARGS, + "Set the current debug level. + +Example: + +>>> spoolss.get_debuglevel() +0" }, + + { "set_debuglevel", (PyCFunction)set_debuglevel, + METH_VARARGS, + "Get the current debug level. + +Example: + +>>> spoolss.set_debuglevel(10)" }, + { NULL } }; |