version 1.51, 2016/09/02 10:32:38 |
version 1.52, 2016/09/02 18:06:43 |
|
|
getnewpasswd(struct passwd *pw, login_cap_t *lc, int authenticated) |
getnewpasswd(struct passwd *pw, login_cap_t *lc, int authenticated) |
{ |
{ |
static char hash[_PASSWORD_LEN]; |
static char hash[_PASSWORD_LEN]; |
char newpass[_PASSWORD_LEN + 1]; |
char newpass[1024]; |
char *p, *pref; |
char *p, *pref; |
int tries, pwd_tries; |
int tries, pwd_tries; |
sig_t saveint, savequit; |
sig_t saveint, savequit; |
|
|
if (!authenticated) { |
if (!authenticated) { |
(void)printf("Changing password for %s.\n", pw->pw_name); |
(void)printf("Changing password for %s.\n", pw->pw_name); |
if (uid != 0 && pw->pw_passwd[0] != '\0') { |
if (uid != 0 && pw->pw_passwd[0] != '\0') { |
char oldpass[_PASSWORD_LEN + 1]; |
char oldpass[1024]; |
|
|
p = readpassphrase("Old password:", oldpass, |
p = readpassphrase("Old password:", oldpass, |
sizeof(oldpass), RPP_ECHO_OFF); |
sizeof(oldpass), RPP_ECHO_OFF); |
|
|
pwd_tries = pwd_gettries(lc); |
pwd_tries = pwd_gettries(lc); |
|
|
for (newpass[0] = '\0', tries = 0;;) { |
for (newpass[0] = '\0', tries = 0;;) { |
char repeat[_PASSWORD_LEN + 1]; |
char repeat[1024]; |
|
|
p = readpassphrase("New password:", newpass, sizeof(newpass), |
p = readpassphrase("New password:", newpass, sizeof(newpass), |
RPP_ECHO_OFF); |
RPP_ECHO_OFF); |