s3:idmap_tdb: use filter from idmap_domain rather than from idmap_tdb_context
authorMichael Adam <obnox@samba.org>
Thu, 17 Jun 2010 05:42:00 +0000 (07:42 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:22:12 +0000 (12:22 +0200)
source3/winbindd/idmap_tdb.c

index 281b2410740e358b929130d7a683399906bb4ac1..35b318469e3b3755dc9db251ab2aea315464936b 100644 (file)
@@ -649,10 +649,9 @@ static NTSTATUS idmap_tdb_id_to_sid(struct idmap_domain *dom, struct id_map *map
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb_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;
        }
 
@@ -759,10 +758,9 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_domain *dom, struct id_map *map
        }
 
        /* 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;
        }