summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-09-02 02:36:18 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-09-02 02:36:18 +0000
commitdc4e75ef7ca135c836d22e380847672cf5b3773b (patch)
treed2ff4fef7b9192de63761935103699569ecbb2ee /miscutils
parent005f83adf511ab89296639abbef737ad4e5826f9 (diff)
downloadbusybox-w32-dc4e75ef7ca135c836d22e380847672cf5b3773b.tar.gz
busybox-w32-dc4e75ef7ca135c836d22e380847672cf5b3773b.tar.bz2
busybox-w32-dc4e75ef7ca135c836d22e380847672cf5b3773b.zip
move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant. Vodz last_patch_107
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/crond.c13
-rw-r--r--miscutils/crontab.c4
2 files changed, 7 insertions, 10 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c
index f0920136f..637e09dd8 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -54,9 +54,6 @@
54#define MAXLINES 256 /* max lines in non-root crontabs */ 54#define MAXLINES 256 /* max lines in non-root crontabs */
55#endif 55#endif
56 56
57static const char def_sh[] = "/bin/sh";
58
59
60typedef struct CronFile { 57typedef struct CronFile {
61 struct CronFile *cf_Next; 58 struct CronFile *cf_Next;
62 struct CronLine *cf_LineBase; 59 struct CronLine *cf_LineBase;
@@ -313,7 +310,7 @@ ChangeUser(const char *user)
313 } 310 }
314 setenv("USER", pas->pw_name, 1); 311 setenv("USER", pas->pw_name, 1);
315 setenv("HOME", pas->pw_dir, 1); 312 setenv("HOME", pas->pw_dir, 1);
316 setenv("SHELL", def_sh, 1); 313 setenv("SHELL", DEFAULT_SHELL, 1);
317 314
318 /* 315 /*
319 * Change running state to the user in question 316 * Change running state to the user in question
@@ -997,7 +994,7 @@ RunJob(const char *user, CronLine *line)
997 user, mailFile); 994 user, mailFile);
998 } 995 }
999 996
1000 ForkJob(user, line, mailFd, def_sh, "-c", line->cl_Shell, mailFile); 997 ForkJob(user, line, mailFd, DEFAULT_SHELL, "-c", line->cl_Shell, mailFile);
1001} 998}
1002 999
1003/* 1000/*
@@ -1081,12 +1078,12 @@ RunJob(const char *user, CronLine *line)
1081 1078
1082#ifdef FEATURE_DEBUG_OPT 1079#ifdef FEATURE_DEBUG_OPT
1083 if (DebugOpt) 1080 if (DebugOpt)
1084 crondlog("\005Child Running %s\n", def_sh); 1081 crondlog("\005Child Running %s\n", DEFAULT_SHELL);
1085#endif 1082#endif
1086 1083
1087 execl(def_sh, def_sh, "-c", line->cl_Shell, NULL); 1084 execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL);
1088 crondlog("\024unable to exec, user %s cmd %s -c %s\n", user, 1085 crondlog("\024unable to exec, user %s cmd %s -c %s\n", user,
1089 def_sh, line->cl_Shell); 1086 DEFAULT_SHELL, line->cl_Shell);
1090 exit(0); 1087 exit(0);
1091 } else if (pid < 0) { 1088 } else if (pid < 0) {
1092 /* 1089 /*
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index 6b9446464..6c4da95fe 100644
--- a/miscutils/crontab.c
+++ b/miscutils/crontab.c
@@ -320,7 +320,7 @@ EditFile(const char *user, const char *file)
320 ptr = PATH_VI; 320 ptr = PATH_VI;
321 321
322 snprintf(visual, sizeof(visual), "%s %s", ptr, file); 322 snprintf(visual, sizeof(visual), "%s %s", ptr, file);
323 execl("/bin/sh", "/bin/sh", "-c", visual, NULL); 323 execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", visual, NULL);
324 perror("exec"); 324 perror("exec");
325 exit(0); 325 exit(0);
326 } 326 }
@@ -360,7 +360,7 @@ ChangeUser(const char *user, short dochdir)
360 } 360 }
361 setenv("USER", pas->pw_name, 1); 361 setenv("USER", pas->pw_name, 1);
362 setenv("HOME", pas->pw_dir, 1); 362 setenv("HOME", pas->pw_dir, 1);
363 setenv("SHELL", "/bin/sh", 1); 363 setenv("SHELL", DEFAULT_SHELL, 1);
364 364
365 /* 365 /*
366 * Change running state to the user in question 366 * Change running state to the user in question