debian/patches/91_sulogin_lockedpw.dpatch (Thom May):
Purpose: Make sure file systems can be fixed on machines with locked
         root accounts too, by presenting a shell in these cases.
Authour: Thom May and Ubuntu.
Fixes:   #326678
Status:  unknown

--- src/sulogin.c	2009-09-30 10:59:13.000000000 +0200
+++ src/sulogin.c	2009-09-30 10:59:13.000000000 +0200
@@ -241,7 +241,11 @@
 		fprintf(stderr, "%s: no entry for root\n", F_SHADOW);
 		strcpy(pwd.pw_passwd, "");
 	}
-	if (!valid(pwd.pw_passwd)) {
+
+	/* disabled passwords are valid too */
+	if (!(strcmp(pwd.pw_passwd, "*") == 0) ||
+	    !(strcmp(pwd.pw_passwd, "!") == 0) ||
+	    !valid(pwd.pw_passwd)) {
 		fprintf(stderr, "%s: root password garbled\n", F_SHADOW);
 		strcpy(pwd.pw_passwd, ""); }
 	return &pwd;
@@ -469,6 +473,14 @@
 		fprintf(stderr, "sulogin: cannot open password database!\n");
 		sleep(2);
 	}
+	/*
+	 *	If the root password is locked, fire up a shell
+	 */
+	if ((strcmp(pwd->pw_passwd, "*") == 0) ||
+	    (strcmp(pwd->pw_passwd, "!") == 0)) {
+		fprintf(stderr, "sulogin: root account is locked, starting shell\n");
+		sushell(pwd);
+	}
 
 	/*
 	 *	Ask for the password.
