diff options
author | Anatoliy Atanasov <anatoliy.atanasov@postpath.com> | 2010-05-04 11:49:18 +0200 |
---|---|---|
committer | Anatoliy Atanasov <anatoliy.atanasov@postpath.com> | 2010-05-04 18:32:18 +0200 |
commit | f84aeea7399eec38f7906dedaf3652af48c3d184 (patch) | |
tree | 1bd0d1f8757053ab5b2fa779d5c5464626b42994 /source4/dsdb/samdb/ldb_modules/schema_data.c | |
parent | bcdaa23798f74cdec8973201a849f562929ea416 (diff) | |
download | samba-f84aeea7399eec38f7906dedaf3652af48c3d184.tar.gz |
s4/rodc: Support read-only database
Check on modify if we are RODC and return referral.
On the ldap backend side now we pass context and ldb_modify_default_callback
to propagate the referral error to the client.
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/schema_data.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/schema_data.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_data.c b/source4/dsdb/samdb/ldb_modules/schema_data.c index 655b4892af3..a6487441c1c 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_data.c +++ b/source4/dsdb/samdb/ldb_modules/schema_data.c @@ -141,6 +141,8 @@ static int schema_data_add(struct ldb_module *module, struct ldb_request *req) const char *oid_attr = NULL; const char *oid = NULL; WERROR status; + bool rodc; + int ret; ldb = ldb_module_get_ctx(module); @@ -159,7 +161,12 @@ static int schema_data_add(struct ldb_module *module, struct ldb_request *req) return ldb_next_request(module, req); } - if (!schema->fsmo.we_are_master) { + ret = samdb_rodc(ldb, &rodc); + if (ret != LDB_SUCCESS) { + DEBUG(4, (__location__ ": unable to tell if we are an RODC \n")); + } + + if (!schema->fsmo.we_are_master && !rodc) { ldb_debug_set(ldb, LDB_DEBUG_ERROR, "schema_data_add: we are not master: reject request\n"); return LDB_ERR_UNWILLING_TO_PERFORM; |