From 7d6af77804adc069a83e8566250f868a6cb9786e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 29 Sep 2015 05:09:46 -0500 Subject: Make defconfig build for nommu. Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some unconverted commands. --- toys/other/login.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'toys/other/login.c') diff --git a/toys/other/login.c b/toys/other/login.c index c727bf96..7f9559aa 100644 --- a/toys/other/login.c +++ b/toys/other/login.c @@ -159,9 +159,7 @@ void login_main(void) syslog(LOG_INFO, "%s logged in on %s %s %s", pwd->pw_name, ttyname(tty), hh ? "from" : "", hh ? TT.hostname : ""); - // can't xexec here because name doesn't match argv[0] - snprintf(toybuf, sizeof(toybuf)-1, "-%s", basename_r(pwd->pw_shell)); - toy_exec((char *[]){toybuf, 0}); - execl(pwd->pw_shell, toybuf, NULL); - error_exit("Failed to spawn shell"); + // not using xexec(), login calls absolute path from filesystem so must exec() + execl(pwd->pw_shell, xmprintf("-%s", pwd->pw_shell), (char *)0); + perror_exit("exec shell '%s'", pwd->pw_shell); } -- cgit v1.2.3