s3:idmap_tdb: give idmap domain argument to idmap_tdb_id_to_sid
authorMichael Adam <obnox@samba.org>
Thu, 17 Jun 2010 05:32:12 +0000 (07:32 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:22:11 +0000 (12:22 +0200)
instead of idmap_tdb_context. This is in preparation of using the
filter from the idmap_domain struct.

source3/winbindd/idmap_tdb.c

index 098b565a91e8e3cd6306673eb7c94e3f58526f27..06b506921afc7e074bdc6ee938c048619ffeebc9 100644 (file)
@@ -635,16 +635,19 @@ failed:
  Single id to sid lookup function. 
 **********************************/
 
-static NTSTATUS idmap_tdb_id_to_sid(struct idmap_tdb_context *ctx, struct id_map *map)
+static NTSTATUS idmap_tdb_id_to_sid(struct idmap_domain *dom, struct id_map *map)
 {
        NTSTATUS ret;
        TDB_DATA data;
        char *keystr;
+       struct idmap_tdb_context *ctx;
 
-       if (!ctx || !map) {
+       if (!dom || !map) {
                return NT_STATUS_INVALID_PARAMETER;
        }
 
+       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))) {
@@ -783,7 +786,7 @@ static NTSTATUS idmap_tdb_unixids_to_sids(struct idmap_domain *dom, struct id_ma
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
 
        for (i = 0; ids[i]; i++) {
-               ret = idmap_tdb_id_to_sid(ctx, ids[i]);
+               ret = idmap_tdb_id_to_sid(dom, ids[i]);
                if ( ! NT_STATUS_IS_OK(ret)) {
 
                        /* if it is just a failed mapping continue */