r2177

dslinux_sonny_jim at dslinux.in-berlin.de dslinux_sonny_jim at dslinux.in-berlin.de
Fri Mar 28 17:43:41 CET 2008


Author: sonny_jim
Date: 2008-03-28 17:43:41 +0100 (Fri, 28 Mar 2008)
New Revision: 2177

Log:
Make autologin fall back to /bin/login/, code from stsp

Modified: trunk/user/autologin/autologin.c
===================================================================
--- trunk/user/autologin/autologin.c	2008-03-28 16:38:54 UTC (rev 2176)
+++ trunk/user/autologin/autologin.c	2008-03-28 16:43:41 UTC (rev 2177)
@@ -98,8 +98,12 @@
 			while(strstr(cfg, "=\t"))
 				strcpy(strstr(cfg, "=\t")+1, strstr(cfg,"=\t")+2);
 			if(!strncasecmp(cfg, "AUTOLOGIN=", 10)) {
-				if(strlen(cfg)<11 || (strncasecmp(cfg+10, "Y", 1) && strncasecmp(cfg+10, "1", 1)))
+				if(strlen(cfg)<11 || (strncasecmp(cfg+10, "Y", 1) && strncasecmp(cfg+10, "1", 1))) {
+					/*Fall back to /bin/login */
+					execlp("login", "login", NULL);
+					printf("ERROR: Couldn't exec /bin/login: $s\n", strerror(errno));
 					return 0; /* Why did we get called??? */
+				}
 			} else if(!strncasecmp(cfg, "USER=", 5))
 				user=strdup(cfg+5);
 			else if(!strncasecmp(cfg, "EXEC=", 5))



More information about the dslinux-commit mailing list