summaryrefslogtreecommitdiff
path: root/miscutils/crontab.c
diff options
context:
space:
mode:
authorDenys Vlasenko2011-03-08 21:00:36 +0100
committerDenys Vlasenko2011-03-08 21:00:36 +0100
commit681efe20d327e9e6774b174a617d66bbb9d21f48 (patch)
tree4331e443ee303c24364b1655651c8584db8b51c1 /miscutils/crontab.c
parent86cf0364bd58e07646a23a1128e4a9ea79189579 (diff)
downloadbusybox-681efe20d327e9e6774b174a617d66bbb9d21f48.zip
busybox-681efe20d327e9e6774b174a617d66bbb9d21f48.tar.gz
use user's shell instead of hardwired "/bin/sh" (android needs this)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/crontab.c')
-rw-r--r--miscutils/crontab.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index 163e15d..16d7fdf 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)