s3:secrets: remove unused secrets_store_[prev_]machine_password()
authorStefan Metzmacher <metze@samba.org>
Tue, 23 May 2017 15:42:09 +0000 (17:42 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Jun 2017 14:57:46 +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/include/secrets.h
source3/passdb/machine_account_secrets.c

index 0363b6b375ff4c5de21eed57f9625050ef928fc7..24ae5bd06643bd869de6103f03d3e61f07733c93 100644 (file)
@@ -140,7 +140,6 @@ NTSTATUS secrets_finish_password_change(const char *change_server,
                                        const struct secrets_domain_info1 *info);
 bool secrets_delete_machine_password_ex(const char *domain, const char *realm);
 bool secrets_delete_domain_sid(const char *domain);
-bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel);
 char *secrets_fetch_prev_machine_password(const char *domain);
 time_t secrets_fetch_pass_last_set_time(const char *domain);
 char *secrets_fetch_machine_password(const char *domain,
index b88fbe937bc6d43fd01f91508cd9a0d45bb008be..3d1cb5b5ee33a4bfd67039c14fa5eede58409de1 100644 (file)
@@ -449,55 +449,6 @@ bool secrets_delete_domain_sid(const char *domain)
        return secrets_delete_entry(domain_sid_keystr(domain));
 }
 
-/************************************************************************
- Routine to store the previous machine password (by storing the current password
- as the old)
-************************************************************************/
-
-static bool secrets_store_prev_machine_password(const char *domain)
-{
-       char *oldpass;
-       bool ret;
-
-       oldpass = (char *)secrets_fetch(machine_password_keystr(domain), NULL);
-       if (oldpass == NULL) {
-               return true;
-       }
-       ret = secrets_store(machine_prev_password_keystr(domain), oldpass, strlen(oldpass)+1);
-       SAFE_FREE(oldpass);
-       return ret;
-}
-
-/************************************************************************
- Routine to set the plaintext machine account password for a realm
- the password is assumed to be a null terminated ascii string.
- Before storing
-************************************************************************/
-
-bool secrets_store_machine_password(const char *pass, const char *domain,
-                                   enum netr_SchannelType sec_channel)
-{
-       bool ret;
-       uint32_t last_change_time;
-       uint32_t sec_channel_type;
-
-       if (!secrets_store_prev_machine_password(domain)) {
-               return false;
-       }
-
-       ret = secrets_store(machine_password_keystr(domain), pass, strlen(pass)+1);
-       if (!ret)
-               return ret;
-
-       SIVAL(&last_change_time, 0, time(NULL));
-       ret = secrets_store(machine_last_change_time_keystr(domain), &last_change_time, sizeof(last_change_time));
-
-       SIVAL(&sec_channel_type, 0, sec_channel);
-       ret = secrets_store(machine_sec_channel_type_keystr(domain), &sec_channel_type, sizeof(sec_channel_type));
-
-       return ret;
-}
-
 /************************************************************************
  Set the machine trust account password, the old pw and last change
  time, domain SID and salting principals based on values passed in