-/* $OpenBSD: local_passwd.c,v 1.59 2021/07/12 15:09:20 beck Exp $ */
+/* $OpenBSD: local_passwd.c,v 1.60 2021/08/28 06:46:49 robert Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
savequit = signal(SIGQUIT, kbintr);
if (!authenticated) {
- (void)printf("Changing password for %s.\n", pw->pw_name);
+ fprintf(stderr, "Changing password for %s.\n", pw->pw_name);
if (uid != 0 && pw->pw_passwd[0] != '\0') {
char oldpass[1024];
p = readpassphrase("Old password:", oldpass,
sizeof(oldpass), RPP_ECHO_OFF);
if (p == NULL || *p == '\0') {
- (void)printf("%s\n", UNCHANGED_MSG);
+ fprintf(stderr, "%s\n", UNCHANGED_MSG);
pw_abort();
exit(p == NULL ? 1 : 0);
}
p = readpassphrase("New password:", newpass, sizeof(newpass),
RPP_ECHO_OFF);
if (p == NULL || *p == '\0') {
- (void)printf("%s\n", UNCHANGED_MSG);
+ fprintf(stderr, "%s\n", UNCHANGED_MSG);
pw_abort();
exit(p == NULL ? 1 : 0);
}
if (strcmp(p, "s/key") == 0) {
- printf("That password collides with a system feature. Choose another.\n");
+ fprintf(stderr, "That password collides with a system feature. Choose another.\n");
continue;
}
explicit_bzero(repeat, sizeof(repeat));
break;
}
- (void)printf("Mismatch; try again, EOF to quit.\n");
+ fprintf(stderr, "Mismatch; try again, EOF to quit.\n");
explicit_bzero(repeat, sizeof(repeat));
explicit_bzero(newpass, sizeof(newpass));
}
pref = login_getcapstr(lc, "localcipher", NULL, NULL);
if (crypt_newhash(newpass, pref, hash, sizeof(hash)) != 0) {
- (void)printf("Couldn't generate hash.\n");
+ fprintf(stderr, "Couldn't generate hash.\n");
explicit_bzero(newpass, sizeof(newpass));
pw_error(NULL, 0, 0);
}
-/* $OpenBSD: pwd_check.c,v 1.16 2017/08/21 21:41:13 deraadt Exp $ */
+/* $OpenBSD: pwd_check.c,v 1.17 2021/08/28 06:46:49 robert Exp $ */
/*
* Copyright 2000 Niels Provos <provos@citi.umich.edu>
min_len = (int)login_getcapnum(lc, "minpasswordlen", 6, 6);
if (min_len > 0 && strlen(password) < min_len) {
- printf("Please enter a longer password.\n");
+ fprintf(stderr, "Please enter a longer password.\n");
return (0);
}
ret = regexec(&rgx, password, 0, NULL, 0);
regfree(&rgx);
if (ret == 0) {
- printf("%s\n", patterns[i].response);
+ fprintf(stderr, "%s\n", patterns[i].response);
exit(1);
}
}
out:
free(checker);
- printf("Please use a different password. Unusual capitalization,\n");
- printf("control characters, or digits are suggested.\n");
+ fprintf(stderr, "Please use a different password. Unusual capitalization,\n");
+ fprintf(stderr, "control characters, or digits are suggested.\n");
return (0);
}