diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-08-25 16:53:26 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-08-26 10:06:33 +1000 |
commit | 17c74e5dfd02df7e935171422477dea3f1bce057 (patch) | |
tree | 6cbb05c4245ee39cdf595d23304b38988377f2ca /source3/passdb | |
parent | 0cfeb65a0b559e2a7e5f6e672d68d9d076b6fd7b (diff) | |
download | samba-17c74e5dfd02df7e935171422477dea3f1bce057.tar.gz samba-17c74e5dfd02df7e935171422477dea3f1bce057.tar.bz2 samba-17c74e5dfd02df7e935171422477dea3f1bce057.zip |
s3-passdb: Make domain_sid argument optional for search_aliases method
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/py_passdb.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index c4129c35e3..f1f138daa1 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -2497,9 +2497,12 @@ static PyObject *py_pdb_search_aliases(pytalloc_Object *self, PyObject *args) struct samr_displayentry *entry; PyObject *py_aliaslist, *py_dict; PyObject *py_domain_sid; - struct dom_sid *dom_sid; + struct dom_sid *domain_sid = NULL; + + py_domain_sid = Py_None; + Py_INCREF(Py_None); - if (!PyArg_ParseTuple(args, "O!:search_users", dom_sid_Type, &py_domain_sid)) { + if (!PyArg_ParseTuple(args, "|O!:search_aliases", dom_sid_Type, &py_domain_sid)) { return NULL; } @@ -2510,7 +2513,9 @@ static PyObject *py_pdb_search_aliases(pytalloc_Object *self, PyObject *args) return NULL; } - dom_sid = pytalloc_get_ptr(py_domain_sid); + if (py_domain_sid != Py_None) { + domain_sid = pytalloc_get_ptr(py_domain_sid); + } search = talloc_zero(tframe, struct pdb_search); if (search == NULL) { @@ -2519,7 +2524,7 @@ static PyObject *py_pdb_search_aliases(pytalloc_Object *self, PyObject *args) return NULL; } - if (!methods->search_aliases(methods, search, dom_sid)) { + if (!methods->search_aliases(methods, search, domain_sid)) { PyErr_Format(py_pdb_error, "Unable to search aliases"); talloc_free(tframe); return NULL; @@ -3438,7 +3443,7 @@ static PyMethodDef py_pdb_methods[] = { Search unix only groups. \n \ Each list entry is dictionary with keys - idx, rid, acct_flags, account_name, fullname, description." }, { "search_aliases", (PyCFunction)py_pdb_search_aliases, METH_VARARGS, - "search_aliases(domain_sid) -> List\n\n \ + "search_aliases([domain_sid]) -> List\n\n \ Search aliases. domain_sid is dcerpc.security.dom_sid object.\n \ Each list entry is dictionary with keys - idx, rid, acct_flags, account_name, fullname, description." }, { "uid_to_sid", (PyCFunction)py_pdb_uid_to_sid, METH_VARARGS, |