Fix normalise module: Skip non-DN attributes
[abartlet/samba.git/.git] / source4 / dsdb / samdb / ldb_modules / normalise.c
index 70513bd644cc189f554c8c893e9fce90f99e96bf..3d1986c41403639f78619fcd9543e1714ce4eea8 100644 (file)
@@ -114,13 +114,12 @@ static int normalize_search_callback(struct ldb_request *req, struct ldb_reply *
                                continue;
                        }
                        /* Look to see if this attributeSyntax is a DN */
-                       if (!((strcmp(attribute->attributeSyntax_oid, "2.5.5.1") == 0) ||
-                             (strcmp(attribute->attributeSyntax_oid, "2.5.5.7") == 0))) {
+                       if (strcmp(attribute->attributeSyntax_oid, "2.5.5.1") != 0) {
                                continue;
                        }
                        for (j = 0; j < msg->elements[i].num_values; j++) {
                                const char *dn_str;
-                               struct ldb_dn *dn = ldb_dn_new(ac, ac->module->ldb, (const char *)msg->elements[i].values[j].data);
+                               struct ldb_dn *dn = ldb_dn_from_ldb_val(ac, ac->module->ldb, &msg->elements[i].values[j]);
                                if (!dn) {
                                        return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_OPERATIONS_ERROR);
                                }