Skip to content

Commit

Permalink
Don't look up local user for remote changes, even when root.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdough committed Apr 16, 2009
1 parent 56aae35 commit 75ccf93
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source3/utils/smbpasswd.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,18 @@ static int process_root(int local_flags)
}

if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) {
struct passwd *passwd = getpwnam_alloc(NULL, user_name);
struct passwd *passwd;

if (!passwd) {
fprintf(stderr, "Cannot locate Unix account for "
"'%s'!\n", user_name);
exit(1);
if (remote_machine == NULL) {
passwd = getpwnam_alloc(NULL, user_name);

if (!passwd) {
fprintf(stderr, "Cannot locate Unix account for "
"'%s'!\n", user_name);
exit(1);
}
TALLOC_FREE(passwd);
}
TALLOC_FREE(passwd);

new_passwd = prompt_for_new_password(stdin_passwd_get);

Expand Down

0 comments on commit 75ccf93

Please sign in to comment.