diff options
author | Volker Lendecke <vl@samba.org> | 2008-03-10 15:48:04 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-03-10 21:08:45 +0100 |
commit | d634ab06b34990b6eecee751435f2436ff76ec44 (patch) | |
tree | 840382f669c1916c8cfb663a3b4f4eb5a4732968 /source3/smbd | |
parent | fe0e5d292df820d3c34cdcdfe0880941df9c1621 (diff) | |
download | samba-d634ab06b34990b6eecee751435f2436ff76ec44.tar.gz samba-d634ab06b34990b6eecee751435f2436ff76ec44.tar.bz2 samba-d634ab06b34990b6eecee751435f2436ff76ec44.zip |
Convert secrets_lock_trust_account_password to talloc
This is preparing the conversion of secrets.c to ctdb
(This used to be commit 1307f0130c47b8d740d2b7afe7a5d8d1a655e2a2)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/process.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 68bec7830a..9c01bbaa4a 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1901,6 +1901,7 @@ static void timeout_processing(int *select_timeout, unsigned char trust_passwd_hash[16]; time_t lct; + void *lock; /* * We're in domain level security, and the code that @@ -1912,7 +1913,9 @@ static void timeout_processing(int *select_timeout, * First, open the machine password file with an exclusive lock. */ - if (secrets_lock_trust_account_password(lp_workgroup(), True) == False) { + lock = secrets_get_trust_account_lock(NULL, lp_workgroup()); + + if (lock == NULL) { DEBUG(0,("process: unable to lock the machine account password for \ machine %s in domain %s.\n", global_myname(), lp_workgroup() )); return; @@ -1921,7 +1924,7 @@ machine %s in domain %s.\n", global_myname(), lp_workgroup() )); if(!secrets_fetch_trust_account_password(lp_workgroup(), trust_passwd_hash, &lct, NULL)) { DEBUG(0,("process: unable to read the machine account password for \ machine %s in domain %s.\n", global_myname(), lp_workgroup())); - secrets_lock_trust_account_password(lp_workgroup(), False); + TALLOC_FREE(lock); return; } @@ -1931,7 +1934,7 @@ machine %s in domain %s.\n", global_myname(), lp_workgroup())); if(t < lct + lp_machine_password_timeout()) { global_machine_password_needs_changing = False; - secrets_lock_trust_account_password(lp_workgroup(), False); + TALLOC_FREE(lock); return; } @@ -1939,7 +1942,7 @@ machine %s in domain %s.\n", global_myname(), lp_workgroup())); change_trust_account_password( lp_workgroup(), NULL); global_machine_password_needs_changing = False; - secrets_lock_trust_account_password(lp_workgroup(), False); + TALLOC_FREE(lock); } /* update printer queue caches if necessary */ |