s4-samdb: remove the rDN size constraint of 64
authorAndrew Tridgell <tridge@samba.org>
Mon, 9 Nov 2009 11:19:52 +0000 (22:19 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 9 Nov 2009 11:19:52 +0000 (22:19 +1100)
This size constraint is not correct in it's current form, as windows
does send us rDN values for CN with lengths longer than 64. Once we
know how this constraint really works we can add it back in.

source4/dsdb/samdb/ldb_modules/objectclass.c
source4/lib/ldb/tests/python/ldap.py

index 003d6731d4b37c67d8a7cf89d647c02e1bf633c3..ba28d42e7fc52f795ed2ea7bb4b9412ed480034b 100644 (file)
@@ -347,12 +347,19 @@ static int fix_dn(TALLOC_CTX *mem_ctx,
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       /* AD doesn't allow the rDN to be longer than 64 characters */
+
        rdn_val = ldb_dn_get_rdn_val(newdn);
+
+#if 0
+       /* the rules for rDN length constraints are more complex than
+       this. Until we understand them we need to leave this
+       constraint out. Otherwise we break replication, as windows
+       does sometimes send us rDNs longer than 64 */
        if (!rdn_val || rdn_val->length > 64) {
-               DEBUG(2,(__location__ ": rDN longer than 64 limit for '%s'\n", ldb_dn_get_linearized(newdn)));
-               return LDB_ERR_CONSTRAINT_VIOLATION;
+               DEBUG(2,(__location__ ": WARNING: rDN longer than 64 limit for '%s'\n", ldb_dn_get_linearized(newdn)));
        }
+#endif
+
 
        /* And replace it with CN=foo (we need the attribute in upper case */
        return ldb_dn_set_component(*fixed_dn, 0, upper_rdn_attr, *rdn_val);
index 118fb87c8425e0acb219effc12dbe6da940e9e8d..0c247cf7f60916f28fc7db3cf8a2b042dd39f7ae 100755 (executable)
@@ -484,7 +484,10 @@ class BasicTests(unittest.TestCase):
 
         self.delete_force(self.ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
-    def test_largeRDN(self):
+
+        # this test needs to be disabled until we really understand
+        # what the rDN length constraints are
+    def DISABLED_test_largeRDN(self):
         """Testing large rDN (limit 64 characters)"""
         rdn = "CN=a012345678901234567890123456789012345678901234567890123456789012";
         self.delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))