summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-04-20 16:53:02 +0200
committerAndrew Bartlett <abartlet@samba.org>2009-04-20 16:53:02 +0200
commit6c9caed48187a0d18becf59ab636af44cbe521b0 (patch)
treec47170169077be6f8ae60aed739803ab4ba861b7 /source4/librpc
parent53765c81f726a8c056cc4e57004592dd489975c9 (diff)
parent31120c9eacafd93e0f2c6b0f906af21adadd318a (diff)
downloadsamba-6c9caed48187a0d18becf59ab636af44cbe521b0.tar.gz
samba-6c9caed48187a0d18becf59ab636af44cbe521b0.tar.bz2
samba-6c9caed48187a0d18becf59ab636af44cbe521b0.zip
Merge commit 'origin/master' into libcli-auth-merge-without-netlogond
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/ndr/py_security.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source4/librpc/ndr/py_security.c b/source4/librpc/ndr/py_security.c
index f89263bba3..43c1d50d66 100644
--- a/source4/librpc/ndr/py_security.c
+++ b/source4/librpc/ndr/py_security.c
@@ -187,13 +187,22 @@ static PyObject *py_descriptor_from_sddl(PyObject *self, PyObject *args)
return py_talloc_import((PyTypeObject *)self, secdesc);
}
-static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *py_sid)
+static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args)
{
- struct dom_sid *sid = py_talloc_get_ptr(py_sid);
+ struct dom_sid *sid;
+ PyObject *py_sid = Py_None;
struct security_descriptor *desc = py_talloc_get_ptr(self);
char *text;
PyObject *ret;
+ if (!PyArg_ParseTuple(args, "|O", &py_sid))
+ return NULL;
+
+ if (py_sid == Py_None)
+ sid = py_talloc_get_ptr(py_sid);
+ else
+ sid = NULL;
+
text = sddl_encode(NULL, desc, sid);
ret = PyString_FromString(text);
@@ -215,7 +224,7 @@ static PyMethodDef py_descriptor_extra_methods[] = {
NULL },
{ "from_sddl", (PyCFunction)py_descriptor_from_sddl, METH_VARARGS|METH_CLASS,
NULL },
- { "as_sddl", (PyCFunction)py_descriptor_as_sddl, METH_O,
+ { "as_sddl", (PyCFunction)py_descriptor_as_sddl, METH_VARARGS,
NULL },
{ NULL }
};