uint32_t filter_low_id;
uint32_t filter_high_id;
bool read_only;
+ const char *script; /* script to provide idmaps */
};
/* High water mark keys */
/* User and group id pool */
uid_t low_uid, high_uid; /* Range of uids to allocate */
gid_t low_gid, high_gid; /* Range of gids to allocate */
- const char *idmap_script;
} idmap_tdb2_state;
NTSTATUS status;
uint32 low_id;
- /* see if a idmap script is configured */
- idmap_tdb2_state.idmap_script = lp_parm_const_string(-1, "idmap",
- "script", NULL);
-
- if (idmap_tdb2_state.idmap_script) {
- DEBUG(1, ("using idmap script '%s'\n",
- idmap_tdb2_state.idmap_script));
- }
-
/* load ranges */
status = idmap_tdb2_load_ranges();
}
ctx->read_only = lp_idmap_read_only();
+
+ ctx->script = lp_parm_const_string(-1, "idmap", "script", NULL);
+ if (ctx->script) {
+ DEBUG(1, ("using idmap script '%s'\n", ctx->script));
+ }
} else {
char *config_option = NULL;
const char *range;
char line[64];
unsigned long v;
- cmd = talloc_asprintf(ctx, "%s ", idmap_tdb2_state.idmap_script);
+ cmd = talloc_asprintf(ctx, "%s ", ctx->script);
NT_STATUS_HAVE_NO_MEMORY(cmd);
va_start(ap, fmt);
} else if (strncmp(line, "SID:S-", 6) == 0) {
if (!string_to_sid(map->sid, &line[4])) {
DEBUG(0,("Bad SID in '%s' from idmap script %s\n",
- line, idmap_tdb2_state.idmap_script));
+ line, ctx->script));
return NT_STATUS_NONE_MAPPED;
}
} else {
DEBUG(0,("Bad reply '%s' from idmap script %s\n",
- line, idmap_tdb2_state.idmap_script));
+ line, ctx->script));
return NT_STATUS_NONE_MAPPED;
}
struct idmap_tdb2_set_mapping_context store_state;
DEBUG(10,("Record %s not found\n", keystr));
- if (idmap_tdb2_state.idmap_script == NULL) {
+ if (ctx->script == NULL) {
ret = NT_STATUS_NONE_MAPPED;
goto done;
}
DEBUG(10,(__location__ " Record %s not found\n", keystr));
- if (idmap_tdb2_state.idmap_script == NULL) {
+ if (ctx->script == NULL) {
ret = NT_STATUS_NONE_MAPPED;
goto done;
}