dsdb:extended_dn_store: pass the full 'struct dsdb_attribute' to extended_store_replace()
authorStefan Metzmacher <metze@samba.org>
Mon, 26 Feb 2018 12:21:54 +0000 (13:21 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 19 Mar 2018 19:30:50 +0000 (20:30 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13307

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/dsdb/samdb/ldb_modules/extended_dn_store.c

index 47bce532b14e3a5a989e2ed832e05e0a0729e41c..119b217f5f64bdc9a668900602609302ec579e18 100644 (file)
@@ -221,8 +221,9 @@ static int extended_store_replace(struct extended_dn_context *ac,
                                  TALLOC_CTX *callback_mem_ctx,
                                  struct ldb_val *plain_dn,
                                  bool is_delete, 
-                                 const char *oid)
+                                 const struct dsdb_attribute *schema_attr)
 {
+       const char *oid = schema_attr->syntax->ldap_oid;
        int ret;
        struct extended_dn_replace_list *os;
        static const char *attrs[] = {
@@ -353,7 +354,7 @@ static int extended_dn_add(struct ldb_module *module, struct ldb_request *req)
                el = &ac->new_req->op.add.message->elements[i];
                for (j = 0; j < el->num_values; j++) {
                        ret = extended_store_replace(ac, ac->new_req, &el->values[j],
-                                                    false, schema_attr->syntax->ldap_oid);
+                                                    false, schema_attr);
                        if (ret != LDB_SUCCESS) {
                                return ret;
                        }
@@ -449,7 +450,7 @@ static int extended_dn_modify(struct ldb_module *module, struct ldb_request *req
                        bool is_delete = (LDB_FLAG_MOD_TYPE(el->flags) == LDB_FLAG_MOD_DELETE);
 
                        ret = extended_store_replace(ac, ac->new_req, &el->values[j],
-                                                    is_delete, schema_attr->syntax->ldap_oid);
+                                                    is_delete, schema_attr);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(ac);
                                return ret;