s3:idmap: move loading of idmap options together before range checking in idmap_init_...
authorMichael Adam <obnox@samba.org>
Sun, 20 Jul 2014 10:11:16 +0000 (12:11 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 25 Jul 2014 09:52:10 +0000 (11:52 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/winbindd/idmap.c

index c76c35022de0ead972a144a88d50d11c5343aad2..e62f477764d60f8ad369ff0a42e5fc660ea2bb47 100644 (file)
@@ -219,7 +219,11 @@ static struct idmap_domain *idmap_init_domain(TALLOC_CTX *mem_ctx,
                goto fail;
        }
 
+       result->read_only = lp_parm_bool(-1, config_option, "read only", false);
        range = lp_parm_const_string(-1, config_option, "range", NULL);
+
+       talloc_free(config_option);
+
        if (range == NULL) {
                if (check_range) {
                        DEBUG(1, ("idmap range not specified for domain %s\n",
@@ -236,10 +240,6 @@ static struct idmap_domain *idmap_init_domain(TALLOC_CTX *mem_ctx,
                }
        }
 
-       result->read_only = lp_parm_bool(-1, config_option, "read only", false);
-
-       talloc_free(config_option);
-
        if (result->low_id > result->high_id) {
                DEBUG(1, ("Error: invalid idmap range detected: %lu - %lu\n",
                          (unsigned long)result->low_id,