From 2958dfcdf87d5169fe1152806be6ad03acb04d88 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 May 2000 10:42:21 +0000 Subject: added secrets.tdb and changed storage of trust account password to use it (This used to be commit 88ad00b82acc4636ab57dfe710af08ea85b82ff1) --- source3/smbd/password.c | 2 +- source3/smbd/process.c | 11 +---------- source3/smbd/reply.c | 9 +-------- source3/smbd/server.c | 2 ++ 4 files changed, 5 insertions(+), 19 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 782d04631a..0478e205d1 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -1435,7 +1435,7 @@ BOOL domain_client_validate( char *user, char *domain, /* * Get the machine account password. */ - if (!trust_get_passwd( trust_passwd, global_myworkgroup, global_myname)) + if (!get_trust_account_password(domain, trust_passwd, NULL)) { return False; } diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 6482ccd538..805bbe4415 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -920,16 +920,9 @@ static BOOL timeout_processing(int deadtime, int *select_timeout, time_t *last_t * First, open the machine password file with an exclusive lock. */ - if(!trust_password_lock( global_myworkgroup, global_myname, True)) { - DEBUG(0,("process: unable to open the machine account password file for \ -machine %s in domain %s.\n", global_myname, global_myworkgroup )); - return True; - } - - if(!get_trust_account_password( trust_passwd_hash, &lct)) { + if(!get_trust_account_password(global_myworkgroup, trust_passwd_hash, &lct)) { DEBUG(0,("process: unable to read the machine account password for \ machine %s in domain %s.\n", global_myname, global_myworkgroup )); - trust_password_unlock(); return True; } @@ -938,7 +931,6 @@ machine %s in domain %s.\n", global_myname, global_myworkgroup )); */ if(t < lct + lp_machine_password_timeout()) { - trust_password_unlock(); global_machine_password_needs_changing = False; return True; } @@ -946,7 +938,6 @@ machine %s in domain %s.\n", global_myname, global_myworkgroup )); pstrcpy(remote_machine_list, lp_passwordserver()); change_trust_account_password( global_myworkgroup, remote_machine_list); - trust_password_unlock(); global_machine_password_needs_changing = False; } diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 90d4200f5e..7a818971d9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -838,14 +838,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int strlower(user); - /* - * In share level security, only overwrite sesssetup_use if - * it's a non null-session share. Helps keep %U and %G - * working. - */ - - if((lp_security() != SEC_SHARE) || (*user && !guest)) - pstrcpy(sesssetup_user,user); + pstrcpy(sesssetup_user,user); reload_services(True); diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 574be64553..d2ccd75059 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -498,6 +498,8 @@ static void init_structs(void ) init_printer_hnd(); init_dptrs(); + + secrets_init(); } /**************************************************************************** -- cgit