1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

s3:secrets: remove unused secrets_store_[prev_]machine_password()

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>
This commit is contained in:
Stefan Metzmacher 2017-05-23 17:42:09 +02:00
parent b874dc90c9
commit f513c20ee0
2 changed files with 0 additions and 50 deletions

View 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,

View 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