diff options
-rw-r--r-- | source3/winbindd/idmap_tdb2.c | 18 |
1 files changed, 6 insertions, 12 deletions
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; } |