From: Jeremy Allison Date: Sat, 12 Dec 1998 00:15:15 +0000 (+0000) Subject: Fixed bug in smbpasswd where adding a user and mis-typing the new X-Git-Tag: samba-2.0.0beta4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ba1ccab564e922d987af96322be4a096efaa77;p=thirdparty%2Fsamba.git Fixed bug in smbpasswd where adding a user and mis-typing the new password a second time would add the user with a potentially random garbage password. Jeremy. --- diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c index de8118b5796..aeb02729f03 100644 --- a/source/utils/smbpasswd.c +++ b/source/utils/smbpasswd.c @@ -423,6 +423,11 @@ static int process_root(int argc, char *argv[]) if(!new_passwd) new_passwd = prompt_for_new_password(stdin_passwd_get); + + if(!new_passwd) { + fprintf(stderr, "Unable to get new password.\n"); + exit(1); + } } if (!password_change(remote_machine, user_name, old_passwd, new_passwd, @@ -520,8 +525,8 @@ static int process_nonroot(int argc, char *argv[]) } if (!new_passwd) { - printf("Unable to get new password.\n"); - exit(0); + fprintf(stderr, "Unable to get new password.\n"); + exit(1); } if (!password_change(remote_machine, user_name, old_passwd, new_passwd,