From c8884e1cf2f9fe08b464c34c25ce682ff3450b34 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 13 Nov 2009 19:31:40 +1100 Subject: [PATCH] s4-ldb: changed the DN checks for \n to warnings a \n is sometimes allowed in AD (eg in deleted DNs). Until we know when is really is allowed, treat it as a warning only. --- source4/dsdb/common/tests/dsdb_dn.c | 9 ++++++--- source4/torture/ldb/ldb.c | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/source4/dsdb/common/tests/dsdb_dn.c b/source4/dsdb/common/tests/dsdb_dn.c index 8f1aeca082c..183bce28d02 100644 --- a/source4/dsdb/common/tests/dsdb_dn.c +++ b/source4/dsdb/common/tests/dsdb_dn.c @@ -317,9 +317,12 @@ static bool torture_dsdb_dn_invalid(struct torture_context *torture) /* Check DN based on MS-ADTS:3.1.1.5.1.2 Naming Constraints*/ val = data_blob_string_const("CN=New\nLine,DC=SAMBA,DC=org"); - torture_assert(torture, - dsdb_dn_parse(mem_ctx, ldb, &val, LDB_SYNTAX_DN) == NULL, - "Should have Failed to create a DN with 0xA in it"); + + /* changed to a warning until we understand the DEL: DNs */ + if (dsdb_dn_parse(mem_ctx, ldb, &val, LDB_SYNTAX_DN) != NULL) { + torture_warning(torture, + "Should have Failed to create a DN with 0xA in it"); + } val = data_blob_string_const("B:4:ABAB:CN=New\nLine,DC=SAMBA,DC=org"); torture_assert(torture, diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c index f986372fe94..dbfd96c59b2 100644 --- a/source4/torture/ldb/ldb.c +++ b/source4/torture/ldb/ldb.c @@ -661,9 +661,11 @@ static bool torture_ldb_dn(struct torture_context *torture) dn = ldb_dn_new(mem_ctx, ldb, "CN=New\nLine,DC=SAMBA,DC=org"), "Failed to create a DN with 0xA in it"); - torture_assert(torture, - ldb_dn_validate(dn) == false, - "should have failed to validate a DN with 0xA in it"); + /* this is a warning until we work out how the DEL: CNs work */ + if (ldb_dn_validate(dn) != false) { + torture_warning(torture, + "should have failed to validate a DN with 0xA in it"); + } val = data_blob_const("CN=Zer\0,DC=SAMBA,DC=org", 23); torture_assert(torture, -- 2.34.1