idmap_autorid: idmap_autorid_sid_to_id_rid only uses low_id from "range"
authorVolker Lendecke <vl@samba.org>
Fri, 2 Dec 2016 10:58:35 +0000 (10:58 +0000)
committerVolker Lendecke <vl@samba.org>
Fri, 16 Dec 2016 16:38:19 +0000 (17:38 +0100)
Simplification -- from the callers perspective looks like a complex
routine which it is not

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/idmap_autorid.c

index 207a7f3d5b2abf0f0abc386c4155af06c6501ddf..b89ac7edae0c72cd2a08a8d6b5d7b7561689496e 100644 (file)
@@ -290,7 +290,7 @@ static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg,
 
 static NTSTATUS idmap_autorid_sid_to_id_rid(
                                        struct autorid_global_config *global,
-                                       struct autorid_range_config *range,
+                                       uint32_t low_id,
                                        struct id_map *map)
 {
        uint32_t rid;
@@ -300,7 +300,7 @@ static NTSTATUS idmap_autorid_sid_to_id_rid(
 
        reduced_rid = rid % global->rangesize;
 
-       map->xid.id = reduced_rid + range->low_id;
+       map->xid.id = reduced_rid + low_id;
        map->xid.type = ID_TYPE_BOTH;
        map->status = ID_MAPPED;
 
@@ -604,7 +604,7 @@ static NTSTATUS idmap_autorid_sid_to_id(struct idmap_tdb_common_context *common,
                return ret;
        }
 
-       return idmap_autorid_sid_to_id_rid(global, &range, map);
+       return idmap_autorid_sid_to_id_rid(global, range.low_id, map);
 }
 
 /**********************************