diff options
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/crond.c | 13 | ||||
| -rw-r--r-- | miscutils/crontab.c | 4 |
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 | ||
| 57 | static const char def_sh[] = "/bin/sh"; | ||
| 58 | |||
| 59 | |||
| 60 | typedef struct CronFile { | 57 | typedef 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 |
