[Pkg-sysvinit-commits] r1453 - in sysvinit-upstream/trunk: doc src

Petter Reinholdtsen pere at alioth.debian.org
Sun Jul 12 15:07:46 UTC 2009


Author: pere
Date: 2009-07-12 15:07:45 +0000 (Sun, 12 Jul 2009)
New Revision: 1453

Modified:
   sysvinit-upstream/trunk/doc/Changelog
   sysvinit-upstream/trunk/src/sulogin.c
Log:
Let sulogin fall back to the staticly linked /bin/sash if both roots
shell and /bin/sh fail to execute.


Modified: sysvinit-upstream/trunk/doc/Changelog
===================================================================
--- sysvinit-upstream/trunk/doc/Changelog	2009-07-12 15:06:19 UTC (rev 1452)
+++ sysvinit-upstream/trunk/doc/Changelog	2009-07-12 15:07:45 UTC (rev 1453)
@@ -81,6 +81,8 @@
     and document this requirement in the manual page.
   * Change reboot/halt to work properly when used as a login shell.
     Patch by Dale R. Worley and Fedora.
+  * Let sulogin fall back to the staticly linked /bin/sash if both roots
+    shell and /bin/sh fail to execute.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 30 Jul 2004 14:14:58 +0200
 

Modified: sysvinit-upstream/trunk/src/sulogin.c
===================================================================
--- sysvinit-upstream/trunk/src/sulogin.c	2009-07-12 15:06:19 UTC (rev 1452)
+++ sysvinit-upstream/trunk/src/sulogin.c	2009-07-12 15:07:45 UTC (rev 1453)
@@ -40,6 +40,7 @@
 #define F_PASSWD	"/etc/passwd"
 #define F_SHADOW	"/etc/shadow"
 #define BINSH		"/bin/sh"
+#define STATICSH	"/bin/sash"
 
 char *Version = "@(#)sulogin 2.85-3 23-Apr-2003 miquels at cistron.nl";
 
@@ -362,6 +363,12 @@
 	setenv("SHELL", BINSH, 1);
 	execl(BINSH, profile ? "-sh" : "sh", NULL);
 	perror(BINSH);
+
+	/* Fall back to staticly linked shell if both the users shell
+	   and /bin/sh failed to execute. */
+	setenv("SHELL", STATICSH, 1);
+	execl(STATICSH, STATICSH, NULL);
+	perror(STATICSH);
 }
 
 void usage(void)




More information about the Pkg-sysvinit-commits mailing list