version 1.30, 2003/06/20 16:53:27 |
version 1.31, 2004/03/10 21:23:17 |
|
|
(void)printf("Changing local password for %s.\n", pw->pw_name); |
(void)printf("Changing local password for %s.\n", pw->pw_name); |
if (uid != 0 && pw->pw_passwd[0] != '\0') { |
if (uid != 0 && pw->pw_passwd[0] != '\0') { |
p = getpass("Old password:"); |
p = getpass("Old password:"); |
if (*p == '\0') { |
if (p == NULL || *p == '\0') { |
(void)printf(UNCHANGED_MSG); |
(void)printf(UNCHANGED_MSG); |
pw_abort(); |
pw_abort(); |
exit(0); |
exit(p == NULL ? 1 : 0); |
} |
} |
if (strcmp(crypt(p, pw->pw_passwd), pw->pw_passwd)) { |
if (strcmp(crypt(p, pw->pw_passwd), pw->pw_passwd)) { |
errno = EACCES; |
errno = EACCES; |
|
|
|
|
for (buf[0] = '\0', tries = 0;;) { |
for (buf[0] = '\0', tries = 0;;) { |
p = getpass("New password:"); |
p = getpass("New password:"); |
if (*p == '\0') { |
if (p == NULL || *p == '\0') { |
(void)printf(UNCHANGED_MSG); |
(void)printf(UNCHANGED_MSG); |
pw_abort(); |
pw_abort(); |
exit(0); |
exit(p == NULL ? 1 : 0); |
} |
} |
if (strcmp(p, "s/key") == 0) { |
if (strcmp(p, "s/key") == 0) { |
printf("That password collides with a system feature. Choose another.\n"); |
printf("That password collides with a system feature. Choose another.\n"); |
|
|
&& pwd_check(pw, lc, p) == 0) |
&& pwd_check(pw, lc, p) == 0) |
continue; |
continue; |
strlcpy(buf, p, sizeof(buf)); |
strlcpy(buf, p, sizeof(buf)); |
if (!strcmp(buf, getpass("Retype new password:"))) |
p = getpass("Retype new password:"); |
|
if (p != NULL && strcmp(buf, p) == 0) |
break; |
break; |
(void)printf("Mismatch; try again, EOF to quit.\n"); |
(void)printf("Mismatch; try again, EOF to quit.\n"); |
} |
} |