diff options
author | Michael Adam <obnox@samba.org> | 2010-06-16 17:12:44 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-08-14 02:10:43 +0200 |
commit | 4b10036da81857449e95272381faa2167ee4f10b (patch) | |
tree | ba5ea84008de3b2549cf4628a14d8ec861d76811 | |
parent | 77096b9a26b23edc6a059dc2bc4f56d26f4aa0ea (diff) | |
download | samba-4b10036da81857449e95272381faa2167ee4f10b.tar.gz samba-4b10036da81857449e95272381faa2167ee4f10b.tar.bz2 samba-4b10036da81857449e95272381faa2167ee4f10b.zip |
s3:idmap_tdb2: use filter from idmap_domain rather than from idmap_tdb2_context
-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; } |