From: Andrew Bartlett Date: Thu, 27 Jul 2023 04:29:34 +0000 (+1200) Subject: dsdb: Use samdb_system_container_dn() in samldb.c X-Git-Tag: samba-4.17.11~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3c4dd68a0db924879d1f5c53fff7e511530fca2;p=thirdparty%2Fsamba.git dsdb: Use samdb_system_container_dn() in samldb.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=9959 Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher (cherry picked from commit 97b682e0eb0450513dcecb74be672e18e84fe7a2) --- diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 3ecbd00e68e..d501973ac33 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -5390,14 +5390,9 @@ static int check_rename_constraints(struct ldb_message *msg, /* Objects under CN=System */ - dn1 = ldb_dn_copy(ac, ldb_get_default_basedn(ldb)); + dn1 = samdb_system_container_dn(ldb, ac); if (dn1 == NULL) return ldb_oom(ldb); - if ( ! ldb_dn_add_child_fmt(dn1, "CN=System")) { - talloc_free(dn1); - return LDB_ERR_OPERATIONS_ERROR; - } - if ((ldb_dn_compare_base(dn1, olddn) == 0) && (ldb_dn_compare_base(dn1, newdn) != 0)) { talloc_free(dn1);