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.19.0rc2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3493671ce743ec42d2cb2cc74402e5feb13b32f3;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 1b4921a6f2e..1edcba7223d 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -5402,14 +5402,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);