diff options
-rw-r--r-- | source3/passdb/secrets.c | 16 |
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; } |