mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3/smbpasswd: Check if Unix account exists before asking for the password.
Admins shouldn't have to type in the password twice when the passdb account cannot be created because the Unix account is missing. Karolin
This commit is contained in:
parent
49a6d757b4
commit
1b9ae1a6bb
@ -430,6 +430,15 @@ static int process_root(int local_flags)
|
||||
}
|
||||
|
||||
if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) {
|
||||
struct passwd *passwd;
|
||||
|
||||
passwd = getpwnam_alloc(NULL, user_name);
|
||||
if (!passwd) {
|
||||
DEBUG(0, ("Cannot locate Unix account for "
|
||||
"'%s'!\n", user_name));
|
||||
exit(1);;
|
||||
}
|
||||
|
||||
new_passwd = prompt_for_new_password(stdin_passwd_get);
|
||||
|
||||
if(!new_passwd) {
|
||||
|
Loading…
Reference in New Issue
Block a user