diff options
author | Michael Adam <obnox@samba.org> | 2010-06-16 17:17:44 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-08-14 02:10:44 +0200 |
commit | 2842389e55f846d559e3ae6297e6dc93b9ac68f8 (patch) | |
tree | eed0a26d2bd0dcd1a311cbccbb7d21e3723cf202 | |
parent | 6a70e7da58c61ada84e4fbe43d6631f359a466e4 (diff) | |
download | samba-2842389e55f846d559e3ae6297e6dc93b9ac68f8.tar.gz samba-2842389e55f846d559e3ae6297e6dc93b9ac68f8.tar.bz2 samba-2842389e55f846d559e3ae6297e6dc93b9ac68f8.zip |
s3:idmap_tdb2: don't parse config and fill filter_low_id and filter_high_id
into idmap_tdb2_context in idmap_tdb2_db_init().
Now these are taken from the idmap_domain struct instead.
-rw-r--r-- | source3/winbindd/idmap_tdb2.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index e6416f1eee..1423314375 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -329,42 +329,13 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom, } if (strequal(dom->name, "*")) { - uid_t low_uid = 0; - uid_t high_uid = 0; - gid_t low_gid = 0; - gid_t high_gid = 0; - - ctx->filter_low_id = 0; - ctx->filter_high_id = 0; - - if (lp_idmap_uid(&low_uid, &high_uid)) { - ctx->filter_low_id = low_uid; - ctx->filter_high_id = high_uid; - } else { - DEBUG(3, ("Warning: 'idmap uid' not set!\n")); - } - - if (lp_idmap_gid(&low_gid, &high_gid)) { - if ((low_gid != low_uid) || (high_gid != high_uid)) { - DEBUG(1, ("Warning: 'idmap uid' and 'idmap gid'" - " ranges do not agree -- building " - "intersection\n")); - ctx->filter_low_id = MAX(ctx->filter_low_id, - low_gid); - ctx->filter_high_id = MIN(ctx->filter_high_id, - high_gid); - } - } else { - DEBUG(3, ("Warning: 'idmap gid' not set!\n")); - } - 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; + config_option = talloc_asprintf(ctx, "idmap config %s", dom->name); if ( ! config_option) { DEBUG(0, ("Out of memory!\n")); @@ -372,14 +343,6 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom, goto failed; } - range = lp_parm_const_string(-1, config_option, "range", NULL); - if (( ! range) || - (sscanf(range, "%u - %u", &ctx->filter_low_id, &ctx->filter_high_id) != 2)) - { - ctx->filter_low_id = 0; - ctx->filter_high_id = 0; - } - ctx->script = lp_parm_const_string(-1, config_option, "script", NULL); if (ctx->script) { DEBUG(1, ("using idmap script '%s'\n", ctx->script)); @@ -388,11 +351,6 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom, talloc_free(config_option); } - if (ctx->filter_low_id > ctx->filter_high_id) { - ctx->filter_low_id = 0; - ctx->filter_high_id = 0; - } - ret = idmap_tdb2_open_db(); if (!NT_STATUS_IS_OK(ret)) { goto failed; |