aboutsummaryrefslogtreecommitdiff
path: root/miscutils/crond.c
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-09-02 02:36:18 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-09-02 02:36:18 +0000
commitd7cb97b8bf8945b6f04bcccbb9be72d638158321 (patch)
treed2ff4fef7b9192de63761935103699569ecbb2ee /miscutils/crond.c
parent253ff43f62644ee79597eed14b49dcf291f198a1 (diff)
downloadbusybox-w32-d7cb97b8bf8945b6f04bcccbb9be72d638158321.tar.gz
busybox-w32-d7cb97b8bf8945b6f04bcccbb9be72d638158321.tar.bz2
busybox-w32-d7cb97b8bf8945b6f04bcccbb9be72d638158321.zip
move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant. Vodz last_patch_107 git-svn-id: svn://busybox.net/trunk/busybox@7365 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils/crond.c')
-rw-r--r--miscutils/crond.c13
1 files changed, 5 insertions, 8 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 /*