s3:winbind: set the read_only flag when parsing the config in idmap_tdb2_db_init
authorMichael Adam <obnox@samba.org>
Tue, 1 Jun 2010 13:49:17 +0000 (15:49 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 1 Jun 2010 15:19:49 +0000 (17:19 +0200)
For the default config this is taken from lp_idmap_read_only(),
and for explicit domains per "idmap config DOMAIN : read only".

source3/winbindd/idmap_tdb2.c

index 4eaf0fc8621584581b21afec20fcf1a0abd2c10e..5108e4ead9f75a65b4e32837a36838cd27a3efd7 100644 (file)
@@ -368,6 +368,8 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom,
                } else {
                        DEBUG(3, ("Warning: 'idmap gid' not set!\n"));
                }
+
+               ctx->read_only = lp_idmap_read_only();
        } else {
                char *config_option = NULL;
                const char *range;
@@ -386,6 +388,9 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom,
                        ctx->filter_high_id = 0;
                }
 
+               ctx->read_only = lp_parm_bool(-1, config_option, "read only",
+                                             false);
+
                talloc_free(config_option);
        }