From 4b10036da81857449e95272381faa2167ee4f10b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jun 2010 17:12:44 +0200 Subject: s3:idmap_tdb2: use filter from idmap_domain rather than from idmap_tdb2_context --- source3/winbindd/idmap_tdb2.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 5f813580fe..6520e9951b 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -551,10 +551,9 @@ static NTSTATUS idmap_tdb2_id_to_sid(struct idmap_domain *dom, struct id_map *ma ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context); /* apply filters before checking */ - if ((ctx->filter_low_id && (map->xid.id < ctx->filter_low_id)) || - (ctx->filter_high_id && (map->xid.id > ctx->filter_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->filter_low_id, ctx->filter_high_id)); + map->xid.id, dom->low_id, dom->high_id)); return NT_STATUS_NONE_MAPPED; } @@ -680,14 +679,10 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_domain *dom, struct id_map *ma } /* apply filters before returning result */ - if ((ctx->filter_low_id - && (map->xid.id < ctx->filter_low_id)) || - (ctx->filter_high_id - && (map->xid.id > ctx->filter_high_id))) { + if (!idmap_unix_id_is_in_range(map->xid.id, dom)) { DEBUG(5, ("Script returned id (%u) out of range " "(%u - %u). Filtered!\n", - map->xid.id, - ctx->filter_low_id, ctx->filter_high_id)); + map->xid.id, dom->low_id, dom->high_id)); ret = NT_STATUS_NONE_MAPPED; goto done; } @@ -728,10 +723,9 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_domain *dom, struct id_map *ma } /* apply filters before returning result */ - if ((ctx->filter_low_id && (map->xid.id < ctx->filter_low_id)) || - (ctx->filter_high_id && (map->xid.id > ctx->filter_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->filter_low_id, ctx->filter_high_id)); + map->xid.id, dom->low_id, dom->high_id)); ret = NT_STATUS_NONE_MAPPED; } -- cgit