s4-schema: set subClassOf by default to top if not specified
authorMatthieu Patou <mat@matws.net>
Tue, 17 Apr 2012 06:24:10 +0000 (23:24 -0700)
committerMichael Adam <obnox@samba.org>
Tue, 17 Apr 2012 22:07:02 +0000 (00:07 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
source4/dsdb/samdb/ldb_modules/samldb.c

index 41751a2c7d80d13368a924d3986351982bb7b892..79ab1f85ce5fa34341de6e9c8113e5f5db00717b 100644 (file)
@@ -621,6 +621,12 @@ static int samldb_fill_object(struct samldb_ctx *ac)
                const struct ldb_val *rdn_value, *def_obj_cat_val;
                unsigned int v = ldb_msg_find_attr_as_uint(ac->msg, "objectClassCategory", -2);
 
+               /* As discussed with Microsoft through dochelp in April 2012 this is the behavior of windows*/
+               if (!ldb_msg_find_element(ac->msg, "subClassOf")) {
+                       ret = ldb_msg_add_string(ac->msg, "subClassOf", "top");
+                       if (ret != LDB_SUCCESS) return ret;
+               }
+
                ret = samdb_find_or_add_attribute(ldb, ac->msg,
                                                  "rdnAttId", "cn");
                if (ret != LDB_SUCCESS) return ret;