From a920733cf6aca9f9e9e6f1bedbe36b9ceec5499c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 24 May 2017 06:44:32 +0200 Subject: [PATCH] s3:secrets: replace secrets_delete_prev_machine_password() by secrets_delete() BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider (cherry picked from commit 5b95cb74e7b2838d228f9773c0e20982b81d1e7d) --- source3/passdb/machine_account_secrets.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c index c3a760b2965..2457ac73ab6 100644 --- a/source3/passdb/machine_account_secrets.c +++ b/source3/passdb/machine_account_secrets.c @@ -370,20 +370,6 @@ bool secrets_fetch_trust_account_password(const char *domain, uint8_t ret_pwd[16 channel); } -/************************************************************************ - Routine to delete the old plaintext machine account password if any -************************************************************************/ - -static bool secrets_delete_prev_machine_password(const char *domain) -{ - char *oldpass = (char *)secrets_fetch(machine_prev_password_keystr(domain), NULL); - if (oldpass == NULL) { - return true; - } - SAFE_FREE(oldpass); - return secrets_delete_entry(machine_prev_password_keystr(domain)); -} - /************************************************************************ Routine to delete the plaintext machine account password, old password, sec channel type and last change time from secrets database @@ -391,7 +377,7 @@ static bool secrets_delete_prev_machine_password(const char *domain) bool secrets_delete_machine_password_ex(const char *domain) { - if (!secrets_delete_prev_machine_password(domain)) { + if (!secrets_delete(machine_prev_password_keystr(domain))) { return false; } if (!secrets_delete_entry(machine_password_keystr(domain))) { -- 2.47.2