s4:dsdb/objectclass_attrs: handle DSDB_CONTROL_SEC_DESC_PROPAGATION_OID
authorStefan Metzmacher <metze@samba.org>
Sat, 24 Nov 2012 14:25:06 +0000 (15:25 +0100)
committerStefan Metzmacher <metze@samba.org>
Sun, 25 Nov 2012 22:30:08 +0000 (23:30 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/samdb/ldb_modules/objectclass_attrs.c

index c521f332ae288a3651cce437d7499570cc291436..316dcf8c14ba19687a9adc87215245ec55f4beee 100644 (file)
@@ -600,6 +600,9 @@ static int objectclass_attrs_modify(struct ldb_module *module,
                                    struct ldb_request *req)
 {
        struct ldb_context *ldb;
+       struct ldb_control *sd_propagation_control;
+       int ret;
+
        struct oc_context *ac;
 
        ldb = ldb_module_get_ctx(module);
@@ -611,6 +614,21 @@ static int objectclass_attrs_modify(struct ldb_module *module,
                return ldb_next_request(module, req);
        }
 
+       sd_propagation_control = ldb_request_get_control(req,
+                                       DSDB_CONTROL_SEC_DESC_PROPAGATION_OID);
+       if (sd_propagation_control != NULL) {
+               if (req->op.mod.message->num_elements != 1) {
+                       return ldb_module_operr(module);
+               }
+               ret = strcmp(req->op.mod.message->elements[0].name,
+                            "nTSecurityDescriptor");
+               if (ret != 0) {
+                       return ldb_module_operr(module);
+               }
+
+               return ldb_next_request(module, req);
+       }
+
        ac = oc_init_context(module, req);
        if (ac == NULL) {
                return ldb_operr(ldb);