Enlightenment CVS committal Author : essiene Project : e17 Module : apps/entrance
Dir : e17/apps/entrance/src/client Modified Files: entrance_session.c Log Message: Final vestiges of memory-hogging beast killed by Rapid Response Team. "T'was a messy deal, we're sure happy to see this here beast dead" -- Rapid Response Team Spoke Man. In other news... this should properly fix the XModMap issue Morten was having. Can someone that actually uses XModMap test this and get back to me? Thnx. =================================================================== RCS file: /cvs/e/e17/apps/entrance/src/client/entrance_session.c,v retrieving revision 1.87 retrieving revision 1.88 diff -u -3 -r1.87 -r1.88 --- entrance_session.c 26 Sep 2006 18:50:29 -0000 1.87 +++ entrance_session.c 27 Sep 2006 12:11:47 -0000 1.88 @@ -821,53 +821,23 @@ int res=0; /* If the user's passwd entry has a shell try to run it in login mode */ - if (shell != "") { - switch (pid=fork()) { - case 0: - res=execl(shell, shell, "-l", "-c", buf, NULL); - break; - case -1: - return; - default: - wait(&status); - break; - } - } + if (shell != "") { + execl(shell, shell, "-l", "-c", buf, NULL); + } else { + res = execl("/bin/sh", "/bin/sh", "-l", "-c", buf, NULL); - /* If that didn't work try to run /bin/sh in login mode */ - if (WEXITSTATUS(status)==2 || res == -1 || shell == "") { - switch(pid=fork()) { - case 0: - execl("/bin/sh", "/bin/sh", "-l", "-c", buf, NULL); - break; - case -1: - return; - default: - wait(&status); - break; - } - } + /* Getting here means the previous didn't work + * If /bin/sh isn't a login shell run /bin/sh without loading the profile + * Also log a warning because this will probably not behave correctly */ + if (res == -1) { + /*TODO: should actually hit the user in the face with this message*/ + syslog(LOG_NOTICE, "Neither '%s' or '/bin/sh' are working login shells for user '%s'. Your session may not function properly. ",shell,user); + execl("/bin/sh", "/bin/sh", "-c", buf, NULL); + } - - /* If /bin/sh isn't a login shell run /bin/sh without loading the profile - * Also log a warning because this will probably not behave correctly */ - if (WEXITSTATUS(status)==2) { - syslog(LOG_NOTICE, "Neither '%s' or '/bin/sh' are working login shells for user '%s'. Your session may not function properly. ",shell,user); - switch(pid=fork()) { - case 0: - execl("/bin/sh", "/bin/sh", "-c", buf, NULL); - break; - case -1: - return; - default: - wait(&status); - break; - } - } - - /* Damn, that didn't work either. - * Bye! We call it quits and log an error */ - if (WEXITSTATUS(status)==2) { - syslog(LOG_CRIT, "Entrance could not find a working shell to start the session for user: \"%s\".",user); + /* Damn, that didn't work either. + * Bye! We call it quits and log an error + * TODO: Also hit the user in the face with this! (ouch!)*/ + syslog(LOG_CRIT, "Entrance could not find a working shell to start the session for user: \"%s\".",user); } } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs