aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/conspy.c4
-rw-r--r--miscutils/crontab.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/miscutils/conspy.c b/miscutils/conspy.c
index 1fdb2fb38..9c5405332 100644
--- a/miscutils/conspy.c
+++ b/miscutils/conspy.c
@@ -316,10 +316,8 @@ static NOINLINE void start_shell_in_child(const char* tty_name)
int pid = xvfork();
if (pid == 0) {
struct termios termchild;
- char *shell = getenv("SHELL");
+ const char *shell = get_shell_name();
- if (!shell)
- shell = (char *) DEFAULT_SHELL;
signal(SIGHUP, SIG_IGN);
// set tty as a controlling tty
setsid();
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index 163e15dce..16d7fdf69 100644
--- a/miscutils/crontab.c
+++ b/miscutils/crontab.c
@@ -20,8 +20,9 @@
static void edit_file(const struct passwd *pas, const char *file)
{
const char *ptr;
- int pid = xvfork();
+ pid_t pid;
+ pid = xvfork();
if (pid) { /* parent */
wait4pid(pid);
return;
@@ -30,7 +31,7 @@ static void edit_file(const struct passwd *pas, const char *file)
/* CHILD - change user and run editor */
/* initgroups, setgid, setuid */
change_identity(pas);
- setup_environment(DEFAULT_SHELL,
+ setup_environment(pas->pw_shell,
SETUP_ENV_CHANGEENV | SETUP_ENV_TO_TMP,
pas);
ptr = getenv("VISUAL");
@@ -41,7 +42,7 @@ static void edit_file(const struct passwd *pas, const char *file)
}
BB_EXECLP(ptr, ptr, file, NULL);
- bb_perror_msg_and_die("exec %s", ptr);
+ bb_perror_msg_and_die("can't execute '%s'", ptr);
}
static int open_as_user(const struct passwd *pas, const char *file)