1 debian/patches/91_sulogin_lockedpw.dpatch (Thom May):
2 Purpose: Make sure file systems can be fixed on machines with locked
3 root accounts too, by presenting a shell in these cases.
4 Authour: Thom May and Ubuntu.
8 Index: trunk/src/sulogin.c
9 ===================================================================
10 --- trunk.orig/src/sulogin.c 2009-09-30 10:59:13.000000000 +0200
11 +++ trunk/src/sulogin.c 2009-09-30 10:59:13.000000000 +0200
13 fprintf(stderr, "%s: no entry for root\n", F_SHADOW);
14 strcpy(pwd.pw_passwd, "");
16 - if (!valid(pwd.pw_passwd)) {
18 + /* disabled passwords are valid too */
19 + if (!(strcmp(pwd.pw_passwd, "*") == 0) ||
20 + !(strcmp(pwd.pw_passwd, "!") == 0) ||
21 + !valid(pwd.pw_passwd)) {
22 fprintf(stderr, "%s: root password garbled\n", F_SHADOW);
23 strcpy(pwd.pw_passwd, ""); }
26 fprintf(stderr, "sulogin: cannot open password database!\n");
30 + * If the root password is locked, fire up a shell
32 + if ((strcmp(pwd->pw_passwd, "*") == 0) ||
33 + (strcmp(pwd->pw_passwd, "!") == 0)) {
34 + fprintf(stderr, "sulogin: root account is locked, starting shell\n");
39 * Ask for the password.
40 Index: trunk/man/sulogin.8
41 ===================================================================
42 --- trunk.orig/man/sulogin.8 2009-07-24 11:49:26.000000000 +0200
43 +++ trunk/man/sulogin.8 2009-09-30 10:59:49.000000000 +0200
46 (or type Control\-D for normal startup):
48 +If the root account is locked, no password prompt is displayed and
49 +\fIsulogin\fR behaves as if the correct password were entered.
51 \fIsulogin\fP will be connected to the current terminal, or to the
52 optional device that can be specified on the command line
53 (typically \fB/dev/console\fP).