summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-02-22 03:18:37 +0000
committerAndrew Tridgell <tridge@samba.org>2002-02-22 03:18:37 +0000
commit488b01f79a1023b81739add0b78da35ad4168020 (patch)
tree81dca141ff5a695a598f6b124919933d35469836 /source3
parent566fafdb251de4b88d2f6f71bd210d464b1d2a0a (diff)
downloadsamba-488b01f79a1023b81739add0b78da35ad4168020.tar.gz
samba-488b01f79a1023b81739add0b78da35ad4168020.tar.bz2
samba-488b01f79a1023b81739add0b78da35ad4168020.zip
made the domain secret key in secrets.tdb domain specific. This allows
you to join a 2nd domain then leave the old domain rather than the other way around (This used to be commit b26b6aef64e1042c9867a13761ded0c3c6f9670f)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/secrets.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 89f67cb5b7..995541ab0c 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -190,7 +190,13 @@ the password is assumed to be a null terminated ascii string
************************************************************************/
BOOL secrets_store_machine_password(char *pass)
{
- return secrets_store(SECRETS_MACHINE_PASSWORD, pass, strlen(pass)+1);
+ char *key;
+ BOOL ret;
+ asprintf(&key, "%s/%s", SECRETS_MACHINE_PASSWORD, lp_workgroup());
+ strupper(key);
+ ret = secrets_store(key, pass, strlen(pass)+1);
+ free(key);
+ return ret;
}
@@ -200,7 +206,13 @@ the password is assumed to be a null terminated ascii string
************************************************************************/
char *secrets_fetch_machine_password(void)
{
- return (char *)secrets_fetch(SECRETS_MACHINE_PASSWORD, NULL);
+ char *key;
+ char *ret;
+ asprintf(&key, "%s/%s", SECRETS_MACHINE_PASSWORD, lp_workgroup());
+ strupper(key);
+ ret = (char *)secrets_fetch(key, NULL);
+ free(key);
+ return ret;
}