1 --- ../../simpleinit-msb-1.2/sysvtools/sulogin.c 2001-09-26 12:59:46.000000000 +0200
2 +++ sulogin.c 2004-07-30 13:40:28.000000000 +0200
4 * encrypted root password is "x" the shadow
5 * password will be used.
7 - * Version: @(#)sulogin 2.81 31-Jul-2001 miquels@cistron.nl
8 + * Version: @(#)sulogin 2.85-3 23-Apr-2003 miquels@cistron.nl
13 #define F_SHADOW "/etc/shadow"
14 #define BINSH "/bin/sh"
16 -char *Version = "@(#)sulogin 2.81 31-Jul-2001 miquels@cistron.nl";
17 +char *Version = "@(#)sulogin 2.85-3 23-Apr-2003 miquels@cistron.nl";
28 * Fix the tty modes and set reasonable defaults.
30 * Ask for the password. Note that there is no
31 * default timeout as we normally skip this during boot.
33 -char *getpasswd(void)
34 +char *getpasswd(char *crypted)
37 struct termios old, tty;
42 - printf("Give root password for maintenance\n");
43 - printf("(or type Control-D for normal startup): ");
45 + printf("Give root password for maintenance\n");
47 + printf("Press enter for maintenance\n");
48 + printf("(or type Control-D to continue): ");
54 } else if (!isatty(fd)) {
55 fprintf(stderr, "%s: not a tty\n", tty);
61 * Ask for the password.
64 - if (pwd->pw_passwd[0] && (p = getpasswd()) == NULL) break;
65 + if ((p = getpasswd(pwd->pw_passwd)) == NULL) break;
66 if (pwd->pw_passwd[0] == 0 ||
67 strcmp(crypt(p, pwd->pw_passwd), pwd->pw_passwd) == 0)