summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_rid.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-06-22 12:42:06 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:55 +0200
commitac63c50684ec2edb4a99f6ed1995288700ce5642 (patch)
treec4f2ee3a91a405d47781eef046877a91b2d16724 /source3/winbindd/idmap_rid.c
parentcda44b9e8e8f0edc111f5fa8daf6f8a9f5bf2a7f (diff)
downloadsamba-ac63c50684ec2edb4a99f6ed1995288700ce5642.tar.gz
samba-ac63c50684ec2edb4a99f6ed1995288700ce5642.tar.bz2
samba-ac63c50684ec2edb4a99f6ed1995288700ce5642.zip
s3:idmap_rid: use range from idmap_domain in idmap_rid_sid_to_id()
Diffstat (limited to 'source3/winbindd/idmap_rid.c')
-rw-r--r--source3/winbindd/idmap_rid.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/winbindd/idmap_rid.c b/source3/winbindd/idmap_rid.c
index b09f2e9453..762d8890db 100644
--- a/source3/winbindd/idmap_rid.c
+++ b/source3/winbindd/idmap_rid.c
@@ -140,18 +140,21 @@ static NTSTATUS idmap_rid_id_to_sid(struct idmap_domain *dom, struct id_map *map
Single sid to id lookup function.
**********************************/
-static NTSTATUS idmap_rid_sid_to_id(struct idmap_rid_context *ctx, struct id_map *map)
+static NTSTATUS idmap_rid_sid_to_id(struct idmap_domain *dom, struct id_map *map)
{
uint32_t rid;
+ struct idmap_rid_context *ctx;
+
+ ctx = talloc_get_type(dom->private_data, struct idmap_rid_context);
sid_peek_rid(map->sid, &rid);
- map->xid.id = rid - ctx->base_rid + ctx->low_id;
+ map->xid.id = rid - ctx->base_rid + dom->low_id;
/* apply filters before returning result */
- if ((map->xid.id < ctx->low_id) || (map->xid.id > ctx->high_id)) {
+ if (!idmap_unix_id_is_in_range(map->xid.id, dom)) {
DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
- map->xid.id, ctx->low_id, ctx->high_id));
+ map->xid.id, dom->low_id, dom->high_id));
map->status = ID_UNMAPPED;
return NT_STATUS_NONE_MAPPED;
}
@@ -199,7 +202,6 @@ static NTSTATUS idmap_rid_unixids_to_sids(struct idmap_domain *dom, struct id_ma
static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids)
{
- struct idmap_rid_context *ridctx;
NTSTATUS ret;
int i;
@@ -207,12 +209,10 @@ static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_ma
for (i = 0; ids[i]; i++) {
ids[i]->status = ID_UNKNOWN;
}
-
- ridctx = talloc_get_type(dom->private_data, struct idmap_rid_context);
for (i = 0; ids[i]; i++) {
- ret = idmap_rid_sid_to_id(ridctx, ids[i]);
+ ret = idmap_rid_sid_to_id(dom, ids[i]);
if (( ! NT_STATUS_IS_OK(ret)) &&
( ! NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED))) {