1 Goal: Input sanitization for chfn and chsh
5 Status wrt upstream: Already applied upstream (4.1.4.3)
10 static void check_fields (void)
13 - err = valid_field (fullnm, ":,=");
14 + err = valid_field (fullnm, ":,=\n");
16 fprintf (stderr, _("%s: name with non-ASCII characters: '%s'\n"), Prog, fullnm);
18 fprintf (stderr, _("%s: invalid name: '%s'\n"), Prog, fullnm);
21 - err = valid_field (roomno, ":,=");
22 + err = valid_field (roomno, ":,=\n");
24 fprintf (stderr, _("%s: room number with non-ASCII characters: '%s'\n"), Prog, roomno);
30 - if (valid_field (workph, ":,=") != 0) {
31 + if (valid_field (workph, ":,=\n") != 0) {
32 fprintf (stderr, _("%s: invalid work phone: '%s'\n"),
36 - if (valid_field (homeph, ":,=") != 0) {
37 + if (valid_field (homeph, ":,=\n") != 0) {
38 fprintf (stderr, _("%s: invalid home phone: '%s'\n"),
42 - err = valid_field (slop, ":");
43 + err = valid_field (slop, ":\n");
45 fprintf (stderr, _("%s: '%s' contains non-ASCII characters\n"), Prog, slop);
50 * users are restricted to using the shells in /etc/shells.
51 * The shell must be executable by the user.
53 - if (valid_field (loginsh, ":,=") != 0) {
54 + if (valid_field (loginsh, ":,=\n") != 0) {
55 fprintf (stderr, _("%s: Invalid entry: %s\n"), Prog, loginsh);