From: Andrew Bartlett Date: Thu, 27 Jul 2023 05:09:31 +0000 (+1200) Subject: s4-rpc_server/backupkey: Use samdb_system_container_dn() in set_lsa_secret() X-Git-Tag: samba-4.17.11~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=558834c3e1323563a939386e52614ada0b3ec969;p=thirdparty%2Fsamba.git s4-rpc_server/backupkey: Use samdb_system_container_dn() in set_lsa_secret() This is now exactly the same actions, but just uses common code to do it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9959 Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher (cherry picked from commit 13eed1e0e7d0bdef6b5cdb6b858f124b812adbea) --- diff --git a/source4/rpc_server/backupkey/dcesrv_backupkey.c b/source4/rpc_server/backupkey/dcesrv_backupkey.c index 0eda3ce7018..5faffdc022c 100644 --- a/source4/rpc_server/backupkey/dcesrv_backupkey.c +++ b/source4/rpc_server/backupkey/dcesrv_backupkey.c @@ -88,17 +88,12 @@ static NTSTATUS set_lsa_secret(TALLOC_CTX *mem_ctx, * * taillor the function to the particular needs of backup protocol */ - system_dn = ldb_dn_copy(frame, ldb_get_default_basedn(ldb)); + system_dn = samdb_system_container_dn(ldb, frame); if (system_dn == NULL) { talloc_free(frame); return NT_STATUS_NO_MEMORY; } - if (!ldb_dn_add_child_fmt(system_dn, "CN=System")) { - talloc_free(frame); - return NT_STATUS_NO_MEMORY; - } - name2 = talloc_asprintf(msg, "%s Secret", name); if (name2 == NULL) { talloc_free(frame);