From 488b01f79a1023b81739add0b78da35ad4168020 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 22 Feb 2002 03:18:37 +0000 Subject: 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) --- source3/passdb/secrets.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source3') 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; } -- cgit