- talloc_free(ctx);
-
- /* load ranges */
- idmap_tdb_state.low_uid = 0;
- idmap_tdb_state.high_uid = 0;
- idmap_tdb_state.low_gid = 0;
- idmap_tdb_state.high_gid = 0;
-
- range = lp_parm_const_string(-1, "idmap alloc config", "range", NULL);
- if (range && range[0]) {
- unsigned low_id, high_id;
-
- if (sscanf(range, "%u - %u", &low_id, &high_id) == 2) {
- if (low_id < high_id) {
- idmap_tdb_state.low_gid = idmap_tdb_state.low_uid = low_id;
- idmap_tdb_state.high_gid = idmap_tdb_state.high_uid = high_id;
- } else {
- DEBUG(1, ("ERROR: invalid idmap alloc range [%s]", range));
- }
- } else {
- DEBUG(1, ("ERROR: invalid syntax for idmap alloc config:range [%s]", range));
- }
+ low_gid = dbwrap_fetch_int32(idmap_alloc_db, HWM_GROUP);
+ if (low_gid == -1 || low_gid < idmap_tdb_state.low_gid) {
+ update_gid = true;