summaryrefslogtreecommitdiffstats
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
commitb26b6aef64e1042c9867a13761ded0c3c6f9670f (patch)
tree2681253d5de8bb8d124a1323fea7e3b32d7f8a6b
parent68693ba4e80257bf895b1c8db18c138d5d9919bb (diff)
downloadsamba-b26b6aef64e1042c9867a13761ded0c3c6f9670f.tar.gz
samba-b26b6aef64e1042c9867a13761ded0c3c6f9670f.tar.xz
samba-b26b6aef64e1042c9867a13761ded0c3c6f9670f.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
-rw-r--r--source/passdb/secrets.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/passdb/secrets.c b/source/passdb/secrets.c
index 89f67cb5b7d..995541ab0cc 100644
--- a/source/passdb/secrets.c
+++ b/source/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;
}