summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/schema_data.c
diff options
context:
space:
mode:
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-05-04 11:49:18 +0200
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-05-04 18:32:18 +0200
commitf84aeea7399eec38f7906dedaf3652af48c3d184 (patch)
tree1bd0d1f8757053ab5b2fa779d5c5464626b42994 /source4/dsdb/samdb/ldb_modules/schema_data.c
parentbcdaa23798f74cdec8973201a849f562929ea416 (diff)
downloadsamba-f84aeea7399eec38f7906dedaf3652af48c3d184.tar.gz
samba-f84aeea7399eec38f7906dedaf3652af48c3d184.tar.bz2
samba-f84aeea7399eec38f7906dedaf3652af48c3d184.zip
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.c9
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 655b4892af..a6487441c1 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;