summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_ads.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/pdb_ads.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/pdb_ads.c')
-rw-r--r--source3/passdb/pdb_ads.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index cd7781a1af..f88ad75de7 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -24,6 +24,7 @@
#include "../libds/common/flags.h"
#include "secrets.h"
#include "../librpc/gen_ndr/samr.h"
+#include "../librpc/gen_ndr/idmap.h"
#include "../libcli/ldap/ldap_ndr.h"
#include "../libcli/security/security.h"
#include "../libds/common/flag_mapping.h"
@@ -2204,7 +2205,7 @@ static bool pdb_ads_gid_to_sid(struct pdb_methods *m, gid_t gid,
}
static bool pdb_ads_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid,
- uid_t *uid, gid_t *gid, enum lsa_SidType *type)
+ struct unixid *id)
{
struct pdb_ads_state *state = talloc_get_type_abort(
m->private_data, struct pdb_ads_state);
@@ -2216,8 +2217,8 @@ static bool pdb_ads_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid,
int rc;
bool ret = false;
- *uid = -1;
- *gid = -1;
+ id->id = -1;
+ id->type = ID_TYPE_NOT_SPECIFIED;
sidstr = sid_binstring_hex(sid);
if (sidstr == NULL) {
@@ -2247,17 +2248,21 @@ static bool pdb_ads_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid,
goto fail;
}
if (atype == ATYPE_ACCOUNT) {
- *type = SID_NAME_USER;
- if (!tldap_pull_uint32(msg[0], "uidNumber", uid)) {
+ uid_t uid;
+ id->type = ID_TYPE_UID;
+ if (!tldap_pull_uint32(msg[0], "uidNumber", &uid)) {
DEBUG(10, ("Did not find uidNumber\n"));
goto fail;
}
+ id->id = uid;
} else {
- *type = SID_NAME_DOM_GRP;
+ gid_t gid;
+ id->type = ID_TYPE_GID;
if (!tldap_pull_uint32(msg[0], "gidNumber", gid)) {
DEBUG(10, ("Did not find gidNumber\n"));
goto fail;
}
+ id->id = gid;
}
ret = true;
fail: