summaryrefslogtreecommitdiff
path: root/source3/passdb/py_passdb.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-03-16 09:16:23 +1100
committerMichael Adam <obnox@samba.org>2012-05-02 12:45:29 +0200
commita6e29f23f09ba5b6b6d362f7683ae8088bc0ba85 (patch)
tree1483d783c627d660b46e250b6ad6bb41f3522d0e /source3/passdb/py_passdb.c
parent802655011509c4f355cb74f971bf1cc2cbc25ac5 (diff)
downloadsamba-a6e29f23f09ba5b6b6d362f7683ae8088bc0ba85.tar.gz
samba-a6e29f23f09ba5b6b6d362f7683ae8088bc0ba85.tar.bz2
samba-a6e29f23f09ba5b6b6d362f7683ae8088bc0ba85.zip
s3-passdb: Change pdb_sid_to_id() to return struct unixid
This will make it easier to consistantly pass a struct unixid all the way up and down the idmap stack, and allow ID_TYPE_BOTH to be handled correctly. Andrew Bartlett Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/passdb/py_passdb.c')
-rw-r--r--source3/passdb/py_passdb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index d0ef567738..17ae476b52 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "lib/util/talloc_stack.h"
#include "libcli/security/security.h"
+#include "librpc/gen_ndr/idmap.h"
#include "passdb.h"
#include "secrets.h"
@@ -2669,9 +2670,7 @@ static PyObject *py_pdb_sid_to_id(pytalloc_Object *self, PyObject *args)
TALLOC_CTX *tframe;
PyObject *py_sid;
struct dom_sid *sid;
- uid_t uid = -1;
- gid_t gid = -1;
- enum lsa_SidType type;
+ struct unixid id;
if (!PyArg_ParseTuple(args, "O!:sid_to_id", dom_sid_Type, &py_sid)) {
return NULL;
@@ -2686,7 +2685,7 @@ static PyObject *py_pdb_sid_to_id(pytalloc_Object *self, PyObject *args)
sid = pytalloc_get_ptr(py_sid);
- if (!methods->sid_to_id(methods, sid, &uid, &gid, &type)) {
+ if (!methods->sid_to_id(methods, sid, &id)) {
PyErr_Format(py_pdb_error, "Unable to get id for sid");
talloc_free(tframe);
return NULL;
@@ -2694,7 +2693,7 @@ static PyObject *py_pdb_sid_to_id(pytalloc_Object *self, PyObject *args)
talloc_free(tframe);
- return Py_BuildValue("(II)", (uid != -1)?uid:gid, type);
+ return Py_BuildValue("(II)", id.id, id.type);
}