diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-22 12:44:31 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-06-27 16:57:45 +0200 |
commit | dfaadc81925e313901c9b30cd98a4b4fd2404f9d (patch) | |
tree | a0bf4dc9d61036e1236bdc9629a72666e32ceed7 /source3/passdb | |
parent | cf8a4646fe71a974b6a5ee13ae7d7751a5a0adc9 (diff) | |
download | samba-dfaadc81925e313901c9b30cd98a4b4fd2404f9d.tar.gz |
s3:secrets: let secrets_delete_machine_password_ex() also remove the des_salt key
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>
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/machine_account_secrets.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c index 06e42f2c65b..70a8277bd57 100644 --- a/source3/passdb/machine_account_secrets.c +++ b/source3/passdb/machine_account_secrets.c @@ -374,11 +374,19 @@ bool secrets_fetch_trust_account_password(const char *domain, uint8_t ret_pwd[16 Routine to delete all information related to the domain joined machine. ************************************************************************/ -bool secrets_delete_machine_password_ex(const char *domain) +bool secrets_delete_machine_password_ex(const char *domain, const char *realm) { const char *tmpkey = NULL; bool ok; + if (realm != NULL) { + tmpkey = des_salt_key(domain); + ok = secrets_delete(tmpkey); + if (!ok) { + return false; + } + } + tmpkey = domain_guid_keystr(domain); ok = secrets_delete(tmpkey); if (!ok) { @@ -495,7 +503,7 @@ bool secrets_store_machine_pw_sync(const char *pass, const char *oldpass, const uint8_t sec_channel_bytes[4]; if (delete_join) { - secrets_delete_machine_password_ex(domain); + secrets_delete_machine_password_ex(domain, realm); TALLOC_FREE(frame); return true; } |