~ubuntu-branches/ubuntu/wily/sysvinit/wily

« back to all changes in this revision

Viewing changes to debian/patches/91_sulogin_lockedpw.dpatch

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2015-07-03 09:02:08 UTC
  • mfrom: (2.1.72 sid)
  • Revision ID: package-import@ubuntu.com-20150703090208-t622gtp4gdwwny9m
Tags: 2.88dsf-59.2ubuntu1
Merge with Debian unstable, updating for the /bin/mountpoint move.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
5
 
Fixes:   #326678
6
 
Status:  unknown
7
 
 
8
 
--- a/src/sulogin.c
9
 
+++ b/src/sulogin.c
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, "");
13
 
        }
14
 
-       if (!valid(pwd.pw_passwd)) {
15
 
+
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, ""); }
22
 
        return &pwd;
23
 
@@ -585,6 +589,14 @@ int main(int argc, char **argv)
24
 
                fprintf(stderr, "sulogin: cannot open password database!\n");
25
 
                sleep(2);
26
 
        }
27
 
+       /*
28
 
+        *      If the root password is locked, fire up a shell
29
 
+        */
30
 
+       if ((strcmp(pwd->pw_passwd, "*") == 0) ||
31
 
+           (strcmp(pwd->pw_passwd, "!") == 0)) {
32
 
+               /* fprintf(stderr, "sulogin: root account is locked, starting shell\n"); */
33
 
+               sushell(pwd);
34
 
+       }
35
 
 
36
 
        /*
37
 
         *      Ask for the password.
38
 
--- a/man/sulogin.8
39
 
+++ b/man/sulogin.8
40
 
@@ -39,6 +39,10 @@ Give root password for system maintenanc
41
 
 .br
42
 
 (or type Control\-D for normal startup):
43
 
 .PP
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
46
 
+were entered.
47
 
+.PP
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).