Re: Small Change to chpass.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Giorgos Keramidas
Date: Wednesday, December 10, 2008 - 11:32 pm

On Wed, 10 Dec 2008 18:00:25 -0800, "Sheldon Givens" <sheldon@sigsegv.ca> wrote:

This seems useful, thanks for submitting the patch :)


You can probably do away with `auth' and reset password to NULL when
strcmp() fails (note that we also use whitespace in for statements to
separate everything more clearly):

        if (old_pw && !master_mode) {
                for (itr = 0; itr < max_retries; itr++) {
                        password = getpass("Password:");
                        if (strcmp(crypt(password, old_pw->pw_passwd),
                            old_pw->pw_passwd) != 0)
                                break;
                        password = NULL;
                }
                if (password == NULL)
                        baduser();
        } else {
                password = "";

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Small Change to chpass.c, Sheldon Givens, (Wed Dec 10, 7:00 pm)
Re: Small Change to chpass.c, Giorgos Keramidas, (Wed Dec 10, 11:32 pm)
Re: Small Change to chpass.c, Trond Endrestøl, (Thu Dec 11, 12:11 am)
Re: Small Change to chpass.c, Rodrigo OSORIO (ros), (Thu Dec 11, 3:07 am)
Re: Small Change to chpass.c, Giorgos Keramidas, (Thu Dec 11, 6:15 am)
Re: Small Change to chpass.c, Garrett Cooper, (Thu Dec 11, 1:39 pm)