s3:secrets: replace secrets_delete_prev_machine_password() by secrets_delete()
authorStefan Metzmacher <metze@samba.org>
Wed, 24 May 2017 04:44:32 +0000 (06:44 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Jun 2017 14:57:45 +0000 (16:57 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/passdb/machine_account_secrets.c

index c3a760b2965c528fc09303d2b6349de14b9a228d..2457ac73ab6ef6371c2cdbae1b197ca5a13cada8 100644 (file)
@@ -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))) {