summaryrefslogtreecommitdiffstats
path: root/lib/exec_shell.c
Commit message (Collapse)AuthorAgeFilesLines
* exec_shell: prevent ".: applet not found" error when SHELL env is not set.osexp20002018-06-251-1/+2
| | | | When SHELL env is not set, it cause xstrdup(NULL) be executed, and result in weird error message ".: applet not found" instead of /bin/sh being used.
* lib/exec_shell: (and pager) use errexec()Karel Zak2018-02-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/exec_shell: cleanup function attributesKarel Zak2018-02-011-1/+1
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* exec_shell: prevent basename from modifying envRuediger Meier2016-02-111-2/+5
| | | | | | | | Fix warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* include: add missing includesRuediger Meier2016-02-111-0/+1
| | | | | | | | lib/pager.c: signal.h ... raise(3p) lib/sysfs.c: libgen.h ... basename(3p) lib/exec_shell.c: libgen.h ... basename(3p) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* exec_shell: add a license and touch up func defMike Frysinger2013-07-011-1/+20
| | | | | | | | | | When this file was created, the standard license header was missed. Add it using the same one from unshare.c. The noreturn attribute is not needed since we include the header which has it on the prototype. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* unshare,nsenter: spawn shell by defaultZbigniew Jędrzejewski-Szmek2013-02-141-0/+27
The behaviour mimics chroot. Possibly it would have been nicer to to query the password database in the new namepace and run the shell of the user there, but it's hard to do correctly. getpwuid() might need to load nss plugins, and the arch in the new namespace might be different (in case of NEWNS mounts), or the hostname might be different, etc. So in general it's not possible to do it reliably. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>