summaryrefslogtreecommitdiff
path: root/source3/passdb/smbpassfile.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-27 23:59:42 +0000
committerJeremy Allison <jra@samba.org>2000-11-27 23:59:42 +0000
commit0f1c800f8542297b9c1a6a4dff20263e3b6d9d40 (patch)
tree426b829c4680972d57e606f81f2af0f84a1d86ca /source3/passdb/smbpassfile.c
parent120f3afa899eac9a03643ce3e81264d245e09d3d (diff)
downloadsamba-0f1c800f8542297b9c1a6a4dff20263e3b6d9d40.tar.gz
samba-0f1c800f8542297b9c1a6a4dff20263e3b6d9d40.tar.bz2
samba-0f1c800f8542297b9c1a6a4dff20263e3b6d9d40.zip
passdb/secrets.c passdb/smbpassfile.c smbd/server.c : Actually *use* the code
written to transition from an old DOMAIN.MACHINE.MAC file to secrets.tdb. printing/nt_printing.c: Fix case insensitive name lookups for driver files. John - this should fix the Win9x/WinME problem correctly. Jeremy. (This used to be commit 8f3332a9acf413ac5d12053ca5c52733a4e946cc)
Diffstat (limited to 'source3/passdb/smbpassfile.c')
-rw-r--r--source3/passdb/smbpassfile.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/source3/passdb/smbpassfile.c b/source3/passdb/smbpassfile.c
index 72dcbea122..f995d8fd4b 100644
--- a/source3/passdb/smbpassfile.c
+++ b/source3/passdb/smbpassfile.c
@@ -274,46 +274,26 @@ static BOOL get_trust_account_password_from_file( unsigned char *ret_pwd, time_t
}
/************************************************************************
-form a key for fetching a domain trust password
-************************************************************************/
-
-static char *trust_keystr(char *domain)
-{
- static fstring keystr;
- slprintf(keystr,sizeof(keystr),"%s/%s", SECRETS_MACHINE_ACCT_PASS, domain);
- return keystr;
-}
-
-/************************************************************************
Migrate an old DOMAIN.MACINE.mac password file to the tdb secrets db.
************************************************************************/
-static void migrate_from_old_password_file(char *domain)
+BOOL migrate_from_old_password_file(char *domain)
{
struct machine_acct_pass pass;
if (!trust_password_file_lock(domain, global_myname))
- return;
+ return True;
if (!get_trust_account_password_from_file( pass.hash, &pass.mod_time)) {
trust_password_file_unlock();
- return;
+ return False;
}
- trust_password_file_delete(domain, global_myname);
-
- secrets_store(trust_keystr(domain), (void *)&pass, sizeof(pass));
+ if (!secrets_store(trust_keystr(domain), (void *)&pass, sizeof(pass)))
+ return False;
+ trust_password_file_delete(domain, global_myname);
trust_password_file_unlock();
- return;
-}
-/************************************************************************
- Routine to delete the trust account password file for a domain.
-************************************************************************/
-
-BOOL trust_password_delete(char *domain)
-{
- return secrets_delete(trust_keystr(domain));
+ return True;
}
-