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.
10
@@ -329,7 +329,11 @@ struct passwd *getrootpwent(int try_manu
11
fprintf(stderr, "%s: no entry for root\n", F_SHADOW);
12
strcpy(pwd.pw_passwd, "");
14
- if (!valid(pwd.pw_passwd)) {
16
+ /* disabled passwords are valid too */
17
+ if (!(strcmp(pwd.pw_passwd, "*") == 0) ||
18
+ !(strcmp(pwd.pw_passwd, "!") == 0) ||
19
+ !valid(pwd.pw_passwd)) {
20
fprintf(stderr, "%s: root password garbled\n", F_SHADOW);
21
strcpy(pwd.pw_passwd, ""); }
23
@@ -585,6 +589,14 @@ int main(int argc, char **argv)
24
fprintf(stderr, "sulogin: cannot open password database!\n");
28
+ * If the root password is locked, fire up a shell
30
+ if ((strcmp(pwd->pw_passwd, "*") == 0) ||
31
+ (strcmp(pwd->pw_passwd, "!") == 0)) {
32
+ /* fprintf(stderr, "sulogin: root account is locked, starting shell\n"); */
37
* Ask for the password.
40
@@ -39,6 +39,10 @@ Give root password for system maintenanc
42
(or type Control\-D for normal startup):
44
+If the root account is locked, as is the default on Ubuntu, no password
45
+prompt is displayed and \fIsulogin\fR behaves as if the correct password
48
\fIsulogin\fP will be connected to the current terminal, or to the
49
optional device that can be specified on the command line
50
(typically \fB/dev/console\fP).