diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-06-03 06:16:11 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-06-03 06:16:11 +0000 |
commit | 988810879eae44c35124d84a9b1f5ac15d443147 (patch) | |
tree | 9403286fa823a1a59c011084d3e5d6174968ae32 /source3/passdb/smbpassfile.c | |
parent | 5a5540f87a89224397d791f4fe8093be214e1f15 (diff) | |
download | samba-988810879eae44c35124d84a9b1f5ac15d443147.tar.gz samba-988810879eae44c35124d84a9b1f5ac15d443147.tar.bz2 samba-988810879eae44c35124d84a9b1f5ac15d443147.zip |
moved secrets handling into secrets.c
(This used to be commit e49550b975dd407a1a8538c9885e036e400b7714)
Diffstat (limited to 'source3/passdb/smbpassfile.c')
-rw-r--r-- | source3/passdb/smbpassfile.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/source3/passdb/smbpassfile.c b/source3/passdb/smbpassfile.c index 608f47ea9b..c915c8365a 100644 --- a/source3/passdb/smbpassfile.c +++ b/source3/passdb/smbpassfile.c @@ -318,52 +318,3 @@ BOOL trust_password_delete(char *domain) return secrets_delete(trust_keystr(domain)); } -/************************************************************************ - Routine to get the trust account password for a domain. -************************************************************************/ - -BOOL get_trust_account_password(char *domain, unsigned char *ret_pwd, time_t *pass_last_set_time) -{ - struct machine_acct_pass *pass; - size_t size; - - /* - * Firstly check if we need to migrate an old DOMAIN.MACHINE.mac - * file into the secrets file. - */ - - migrate_from_old_password_file(domain); - - if (!(pass = secrets_fetch(trust_keystr(domain), &size)) || - size != sizeof(*pass)) return False; - - /* - * Here we check the last change time to see if the machine - * password needs changing. JRA. - */ - - if(time(NULL) > pass->mod_time + lp_machine_password_timeout()) - global_machine_password_needs_changing = True; - - if (pass_last_set_time) - *pass_last_set_time = pass->mod_time; - - memcpy(ret_pwd, pass->hash, 16); - free(pass); - - return True; -} - -/************************************************************************ - Routine to get the trust account password for a domain. -************************************************************************/ - -BOOL set_trust_account_password(char *domain, unsigned char *md4_new_pwd) -{ - struct machine_acct_pass pass; - - pass.mod_time = time(NULL); - memcpy(pass.hash, md4_new_pwd, 16); - - return secrets_store(trust_keystr(domain), (void *)&pass, sizeof(pass)); -} |