* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: conf.c,v 1.33 2000-12-23 20:17:17 thib Exp $ */
+ /* $Id: conf.c,v 1.34 2000-12-30 12:55:17 thib Exp $ */
#include "fcron.h"
if ( strcmp(dir_name, ".") == 0 )
explain("updating configuration from " FCRONTABS );
else
- explain("updating configuration from '%s'", dir_name);
+ explain("updating configuration from %s", dir_name);
if ((dir = opendir("."))) {
while ((den = readdir(dir))) {
/* begin by adding normal files, if any, to database */
for (list_cur = file_list; list_cur; list_cur = list_cur->next ) {
if ( getpwnam(list_cur->str) ) {
- explain("adding file '%s'", list_cur->str);
+ explain("adding file %s", list_cur->str);
synchronize_file(list_cur->str);
}
else
- error("ignoring file '%s' : not in passwd file.", list_cur->str);
+ error("ignoring file \"%s\" : not in passwd file.", list_cur->str);
}
/* then remove files which are no longer wanted */
for (list_cur = rm_list; list_cur; list_cur = list_cur->next ) {
- explain("removing file '%s'", list_cur->str + 3);
+ explain("removing file %s", list_cur->str + 3);
delete_file(list_cur->str + 3); /* len("rm.") = 3 */
if ( remove(list_cur->str + 3) != 0 && errno != ENOENT )
- error_e("Could not remove '%s'", list_cur->str + 3);
+ error_e("Could not remove %s", list_cur->str + 3);
if ( remove(list_cur->str) != 0 && errno != ENOENT )
- error_e("Could not remove '%s'", list_cur->str);
+ error_e("Could not remove %s", list_cur->str);
}
/* finally add new files */
for (list_cur = new_list; list_cur; list_cur = list_cur->next ) {
if ( getpwnam(list_cur->str + 4) ) { /* len("new.") = 4 */
- explain("adding new file '%s'", list_cur->str + 4);
+ explain("adding new file %s", list_cur->str + 4);
synchronize_file(list_cur->str);
}
else
- error("ignoring file '%s' : not in passwd file.",
+ error("ignoring file %s : not in passwd file.",
(list_cur->str + 4));
}
strncmp(buf, "fcrontab-"FILEVERSION"\n",
sizeof("fcrontab-"FILEVERSION"\n")) != 0) {
- error("File '%s' is not valid: ignored.", file_name);
+ error("File %s is not valid: ignored.", file_name);
error("Maybe this file has been generated by an old version"
" of fcron. In this case, you should install it again"
" using fcrontab.");
/* read env variables */
Alloc(env, env_t);
while( (env->e_val = read_str(ff, buf, sizeof(buf))) != NULL ) {
- debug(" Env: '%s'", env->e_val );
+ debug(" Env: \"%s\"", env->e_val );
env->e_next = cf->cf_env_base;
cf->cf_env_base = env;
insert_nextexe(cl);
} else {
if ( cl->cl_timefreq < 60 ) {
- error("Invalid timefreq in '%s': set to 1 day", cl->cl_shell);
+ error("Invalid timefreq in %s: set to 1 day", cl->cl_shell);
cl->cl_timefreq = 3600*24;
}
cl->cl_nextexe += slept;
else {
/* job has been stopped during execution :
* launch it again */
- warn("job '%s' has not terminated : executed again now.",
+ warn("job %s has not terminated : executed again now.",
cl->cl_shell);
set_serial_once(cl->cl_option);
add_serial_job(cl);
if (debug_opt) {
struct tm *ftime;
ftime = localtime( &(cl->cl_nextexe) );
- debug(" cmd '%s' next exec %d/%d/%d wday:%d %02d:%02d",
+ debug(" cmd %s next exec %d/%d/%d wday:%d %02d:%02d",
cl->cl_shell, (ftime->tm_mon + 1), ftime->tm_mday,
(ftime->tm_year + 1900), ftime->tm_wday,
ftime->tm_hour, ftime->tm_min);
}
/* check for an error */
if ( ferror(ff) != 0 )
- error("file '%s' is truncated : you should reinstall it", file_name);
+ error("file %s is truncated : you should reinstall it", file_name);
/* free last calloc : unused */
free(cl);
/* // if (fgets(buf, sizeof(buf), ff) == NULL || */
/* // strncmp(buf, "eof\n", sizeof("eof\n")) != 0) */
-/* // error("file '%s' is truncated : you should reinstall it",file_name); */
+/* // error("file %s is truncated : you should reinstall it",file_name); */
fclose(ff);
i = 0;
while (i < lavg_num)
if ( lavg_array[i].l_line->cl_file == file ) {
- debug("removing '%s' from lavg queue",
+ debug("removing %s from lavg queue",
lavg_array[i].l_line->cl_shell);
lavg_array[i].l_line->cl_numexe--;
if (i < --lavg_num) {
if (serial_array[i] != NULL && serial_array[i]->cl_file == file ) {
if ( ! s_a )
s_a = calloc(serial_array_size, sizeof(CL *));
- debug("removing '%s' from serial queue",
+ debug("removing %s from serial queue",
serial_array[i]->cl_shell);
serial_num--;
serial_array[i]->cl_numexe--;
/* chown the file to root:root : this file should only be read and
* modified by fcron (not fcrontab) */
if (fchown(fileno(f), 0, 0) != 0)
- error_e("Could not fchown '%s'", (path) ? path : file->cf_user);
+ error_e("Could not fchown \"%s\"", (path) ? path : file->cf_user);
/* save file : */
fclose(f);
if (file != NULL)
+ /* we have to save only a single file */
break ;
}
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: database.c,v 1.41 2000-12-10 20:29:25 thib Exp $ */
+ /* $Id: database.c,v 1.42 2000-12-30 12:55:38 thib Exp $ */
#include "fcron.h"
run_queue_job(line);
}
else {
- warn(" process already running: %s '%s'",
+ warn(" process already running: %s %s",
line->cl_file->cf_user,
line->cl_shell
);
}
if (debug_opt)
set_wday(ftime);
- debug(" '%s' first non matching %d/%d/%d wday:%d %02d:%02d",
+ debug(" %s first non matching %d/%d/%d wday:%d %02d:%02d",
line->cl_shell, (ftime->tm_mon + 1), ftime->tm_mday,
(ftime->tm_year + 1900), ftime->tm_wday,
ftime->tm_hour, ftime->tm_min);
}
}
- debug(" '%s' first non matching %d/%d/%d wday:%d %02d:%02d",
+ debug(" %s first non matching %d/%d/%d wday:%d %02d:%02d",
line->cl_shell, (ftime->tm_mon + 1), ftime->tm_mday,
(ftime->tm_year + 1900), ftime->tm_wday,
ftime->tm_hour, ftime->tm_min);
line->cl_nextexe = mktime(&ftime);
if ( ! is_new_line )
- debug(" cmd: '%s' next exec %d/%d/%d wday:%d %02d:%02d",
+ debug(" cmd: %s next exec %d/%d/%d wday:%d %02d:%02d",
line->cl_shell, (ftime.tm_mon + 1), ftime.tm_mday,
(ftime.tm_year + 1900), ftime.tm_wday,
ftime.tm_hour, ftime.tm_min);
else {
/* this is a job based on system up time */
line->cl_nextexe = now + line->cl_timefreq;
- debug(" cmd: '%s' next exec in %lds", line->cl_shell,
+ debug(" cmd: %s next exec in %lds", line->cl_shell,
line->cl_timefreq);
}
/* first, check if some lines must be executed because of until */
while ( i < lavg_num )
if ( lavg_array[i].l_line->cl_until && lavg_array[i].l_until < now ) {
- debug("until '%s' %d", lavg_array[i].l_line->cl_shell,
+ debug("until %s %d", lavg_array[i].l_line->cl_shell,
lavg_array[i].l_until);
run_lavg_job(i);
} else
|| l_avg[2] < lavg_array[i].l_line->cl_lavg[2] )
)
) {
- debug("lavg '%s' %s %.0f:%d %.0f:%d %.0f:%d",
+ debug("lavg %s %s %.0f:%d %.0f:%d %.0f:%d",
lavg_array[i].l_line->cl_shell,
(is_lor(lavg_array[i].l_line->cl_option)) ? "or" : "and",
l_avg[0], lavg_array[i].l_line->cl_lavg[0],
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcron.c,v 1.35 2000-12-14 18:09:43 thib Exp $ */
+ /* $Id: fcron.c,v 1.36 2000-12-30 12:55:06 thib Exp $ */
#include "fcron.h"
-char rcs_info[] = "$Id: fcron.c,v 1.35 2000-12-14 18:09:43 thib Exp $";
+char rcs_info[] = "$Id: fcron.c,v 1.36 2000-12-30 12:55:06 thib Exp $";
void main_loop(void);
void check_signal(void);
if (optind < argc) {
for (i = optind; i<=argc; i++)
- error("Unknown argument '%s'", argv[i]);
+ error("Unknown argument \"%s\"", argv[i]);
usage();
}
struct passwd *pass;
if ( ! (pass = getpwnam(USERNAME)) )
- die("user '%s' is not in passwd file. Aborting.", USERNAME);
+ die("user \"%s\" is not in passwd file. Aborting.", USERNAME);
if (setregid(pass->pw_gid, 0) != 0 )
die_e("Could not set gid to " GROUPNAME);
if (setreuid(pass->pw_uid, 0) != 0 )
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcrontab.c,v 1.26 2000-12-23 20:12:05 thib Exp $ */
+ /* $Id: fcrontab.c,v 1.27 2000-12-30 12:54:19 thib Exp $ */
/*
* The goal of this program is simple : giving a user interface to fcron
#include "fcrontab.h"
-char rcs_info[] = "$Id: fcrontab.c,v 1.26 2000-12-23 20:12:05 thib Exp $";
+char rcs_info[] = "$Id: fcrontab.c,v 1.27 2000-12-30 12:54:19 thib Exp $";
void info(void);
void usage(void);
make_file(char *file)
{
- explain("installing file '%s' for user %s", file, user);
+ explain("installing file %s for user %s", file, user);
/* read file and create a list in memory */
switch ( read_file(file, user) ) {
return ;
}
else
- die_e("User %s could not read file '%s'", user, file);
+ die_e("User %s could not read file \"%s\"", user, file);
}
else {
if ( stat(tmp, &st) == 0 )
mtime = st.st_mtime;
else {
- error_e("could not stat '%s'", buf);
+ error_e("could not stat \"%s\"", buf);
goto exiterr;
}
}
#endif
execlp(editor, editor, tmp, NULL);
- error_e("Error while running '%s'", editor);
+ error_e("Error while running \"%s\"", editor);
goto exiterr;
case -1:
sprintf(tmp, "/tmp/fcrontab.%d", getpid());
if( (tmp_file = fopen(tmp, "w")) == NULL )
- die_e("Could not open '%s'", tmp);
+ die_e("Could not open \"%s\"", tmp);
while ( (c = getc(stdin)) != EOF )
putc(c, tmp_file);
buf);
}
else
- fprintf(stderr, "Could not open '%s': %s\n", buf,
+ fprintf(stderr, "Could not open \"%s\": %s\n", buf,
strerror(errno));
exit (EXIT_ERR);
if ( user == NULL ) {
/* get user's name using getpwuid() */
if ( ! (pass = getpwuid(uid)) )
- die("user '%s' is not in passwd file. Aborting.", USERNAME);
+ die("user \"%s\" is not in passwd file. Aborting.", USERNAME);
/* we need to strdup2 the value given by getpwuid() because we free
* file->cf_user in delete_file */
user = strdup2(pass->pw_name);
}
else {
if ( ! (pass = getpwnam(user)) )
- die("user '%s' is not in passwd file. Aborting.", user);
+ die("user \"%s\" is not in passwd file. Aborting.", user);
asuid = pass->pw_uid;
asgid = pass->pw_gid;
}
if ( ! is_allowed(user) ) {
- die("User '%s' is not allowed to use %s. Aborting.",
+ die("User \"%s\" is not allowed to use %s. Aborting.",
user, prog_name);
}
{
struct passwd *pass;
if ( ! (pass = getpwnam(USERNAME)) )
- die("user '%s' is not in passwd file. Aborting.", USERNAME);
+ die("user \"%s\" is not in passwd file. Aborting.", USERNAME);
fcrontab_uid = pass->pw_uid;
fcrontab_gid = pass->pw_gid;
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fileconf.c,v 1.31 2000-12-23 20:16:10 thib Exp $ */
+ /* $Id: fileconf.c,v 1.32 2000-12-30 12:54:55 thib Exp $ */
#include "fcrontab.h"
/* check if user is allowed to read file */
/* create a temp file with user's permissions */
if ( access(file_name, R_OK) != 0 )
- die_e("User %s can't read file '%s'", user, file_name);
+ die_e("User %s can't read file \"%s\"", user, file_name);
else if ( (file = fopen(file_name, "r")) == NULL ) {
- fprintf(stderr, "Could not open '%s': %s\n", file_name,
+ fprintf(stderr, "Could not open \"%s\": %s\n", file_name,
strerror(errno));
return ERR;
}
case '!':
ptr = read_opt(ptr, &default_line);
if ( ptr != NULL && *ptr != '\0' ) {
- fprintf(stderr, "%s:%d: Syntax error: string '%s' ignored\n",
+ fprintf(stderr, "%s:%d: Syntax error: string \"%s\" ignored\n",
file_name, line, ptr);
need_correction = 1;
}
else {
struct passwd *pass = NULL;
if ( (pass = getpwnam(val)) == 0 ) {
- fprintf(stderr, "%s:%d:MAILTO: '%s' is not in passwd :"
+ fprintf(stderr, "%s:%d:MAILTO: \"%s\" is not in passwd :"
" ignored\n", file_name, line, val);
need_correction = 1;
} else {
name[i++] = *ptr++;
if ((pas = getpwnam(name)) == NULL) {
- fprintf(stderr, "runas: '%s' is not in passwd file : ignored", name);
+ fprintf(stderr, "runas: \"%s\" is not in passwd file : ignored", name);
need_correction = 1;
return NULL;
}
#define Handle_err \
{ \
- fprintf(stderr, "%s:%d: Argument(s) for option '%s' not valid: " \
+ fprintf(stderr, "%s:%d: Argument(s) for option \"%s\" not valid: " \
"skipping end of line.\n", file_name, line, opt_name); \
need_correction = 1; \
return NULL; \
else
set_serial(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if (strcmp(opt_name, "serialonce") == 0 ) {
else
clear_serial_sev(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if (strcmp(opt_name, "lavgonce") == 0 ) {
else
clear_lavg_sev(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if (strcmp(opt_name, "exesev") == 0 ) {
else
set_exe_sev(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if(strcmp(opt_name, "b")==0 || strcmp(opt_name, "bootrun")==0){
else
set_bootrun(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if( strcmp(opt_name, "reset")==0 ) {
cl->cl_mailto = uid;
}
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if(strcmp(opt_name, "f") == 0 || strcmp(opt_name, "first") == 0){
if( ! in_brackets || (ptr=get_time(ptr, &(cl->cl_nextexe)))==NULL)
Handle_err;
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %ld\n",opt_name,cl->cl_nextexe);
+ fprintf(stderr, " Opt : \"%s\" %ld\n",opt_name,cl->cl_nextexe);
}
else if(strcmp(opt_name, "r")==0 || strcmp(opt_name, "runfreq")==0) {
Handle_err;
cl->cl_runfreq = i;
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
/* options to run once per interval :
else if (strcmp(opt_name, "mins") == 0) {
/* nothing to do */
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "hours") == 0) {
set_freq_mins(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "days") == 0) {
set_freq_mins(cl->cl_option);
set_freq_hrs(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "mons") == 0) {
set_freq_mins(cl->cl_option);
set_freq_hrs(cl->cl_option);
set_freq_days(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "dow") == 0) {
set_freq_mins(cl->cl_option);
set_freq_days(cl->cl_option);
set_freq_mons(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
/* run once an element of the selected field
set_freq_hrs(cl->cl_option);
set_freq_periodically(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "daily") == 0) {
set_freq_days(cl->cl_option);
set_freq_periodically(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "monthly") == 0) {
set_freq_mons(cl->cl_option);
set_freq_periodically(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "weekly") == 0) {
set_freq_dow(cl->cl_option);
set_freq_periodically(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
/* run once an element of the selected field
set_freq_periodically(cl->cl_option);
set_freq_mid(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "middaily") == 0
|| strcmp(opt_name, "nightly") == 0) {
set_freq_periodically(cl->cl_option);
set_freq_mid(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "midmonthly") == 0) {
set_freq_mons(cl->cl_option);
set_freq_periodically(cl->cl_option);
set_freq_mid(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if (strcmp(opt_name, "midweekly") == 0) {
set_freq_dow(cl->cl_option);
set_freq_periodically(cl->cl_option);
set_freq_mid(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s'\n", opt_name);
+ fprintf(stderr, " Opt : \"%s\"\n", opt_name);
}
else if ( strcmp(opt_name, "lavg") == 0 ) {
else
set_land(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if( strcmp(opt_name, "lavgor") == 0 ) {
else
set_lor(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if(strcmp(opt_name, "u") == 0 || strcmp(opt_name, "until") == 0){
if( ! in_brackets || (ptr=get_time(ptr, &(cl->cl_until)))==NULL)
Handle_err;
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %ld\n",opt_name,cl->cl_until);
+ fprintf(stderr, " Opt : \"%s\" %ld\n",opt_name,cl->cl_until);
}
else if(strcmp(opt_name, "m")==0 || strcmp(opt_name, "mail")==0){
else
set_mail(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if( strcmp(opt_name, "forcemail") == 0 ) {
else
set_mailzerolength(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if( strcmp(opt_name, "mailto") == 0) {
clear_mail(cl->cl_option);
else {
if ( (pass = getpwnam(buf)) == NULL ) {
- fprintf(stderr, "%s:%d:mailto: '%s' is not in passwd :"
+ fprintf(stderr, "%s:%d:mailto: \"%s\" is not in passwd :"
" ignored\n", file_name, line, buf);
need_correction = 1;
} else {
}
}
if (debug_opt)
- fprintf(stderr, " Opt : '%s' '%s'\n", opt_name, buf);
+ fprintf(stderr, " Opt : \"%s\" \"%s\"\n", opt_name, buf);
}
else if( strcmp(opt_name, "dayand") == 0 ) {
else
set_dayand(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if( strcmp(opt_name, "dayor") == 0 ) {
else
set_dayor(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if(strcmp(opt_name, "n") == 0 || strcmp(opt_name, "nice") == 0) {
Handle_err;
cl->cl_nice = (char)i;
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, i);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i);
}
else if(strcmp(opt_name, "runas") == 0) {
cl->cl_runas = uid;
set_runas(cl->cl_option);
if (debug_opt)
- fprintf(stderr, " Opt : '%s' %d\n", opt_name, uid);
+ fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, uid);
}
}
else {
- fprintf(stderr, "%s:%d: Option '%s' unknown: "
+ fprintf(stderr, "%s:%d: Option \"%s\" unknown: "
"skipping option.\n", file_name, line, opt_name);
need_correction = 1;
}
cf->cf_line_base = cl;
if ( debug_opt )
- fprintf(stderr, " Cmd '%s', timefreq %ld, first %ld\n",
+ fprintf(stderr, " Cmd \"%s\", timefreq %ld, first %ld\n",
cl->cl_shell, cl->cl_timefreq, cl->cl_nextexe);
return;
cf->cf_line_base = cl;
if ( debug_opt )
- fprintf(stderr, " Cmd '%s'\n", cl->cl_shell);
+ fprintf(stderr, " Cmd \"%s\"\n", cl->cl_shell);
return;
exiterr:
cf->cf_line_base = cl;
if ( debug_opt )
- fprintf(stderr, " Cmd '%s'\n", cl->cl_shell);
+ fprintf(stderr, " Cmd \"%s\"\n", cl->cl_shell);
return;
exiterr:
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: job.c,v 1.26 2000-12-04 20:18:27 thib Exp $ */
+ /* $Id: job.c,v 1.27 2000-12-30 12:55:25 thib Exp $ */
#include "fcron.h"
/* prepare the job execution */
switch ( pid = fork() ) {
case -1:
- error_e("Fork error : could not exec '%s'", line->cl_shell);
+ error_e("Fork error : could not exec \"%s\"", line->cl_shell);
break;
case 0:
if ( (home = getenv("HOME")) != NULL )
if (chdir(home) != 0) {
- error_e("Could not chdir to HOME dir '%s'", home);
+ error_e("Could not chdir to HOME dir \"%s\"", home);
if (chdir("/") < 0)
- die_e("Could not chdir to HOME dir '/'");
+ die_e("Could not chdir to HOME dir /");
}
if ( (shell = getenv("SHELL")) == NULL )
shell = SHELL;
else if ( access(shell, X_OK) != 0 ) {
if (errno == ENOENT)
- error("shell '%s' : no file or directory. SHELL set to " SHELL,
- shell);
+ error("shell \"%s\" : no file or directory. SHELL set to "
+ SHELL, shell);
else
- error_e("shell '%s' not valid : SHELL set to " SHELL, shell);
+ error_e("shell \"%s\" not valid : SHELL set to " SHELL, shell);
shell = SHELL;
}
/* now, run the job */
switch ( fork() ) {
case -1:
- error_e("Fork error : could not exec '%s'", line->cl_shell);
+ error_e("Fork error : could not exec \"%s\"", line->cl_shell);
break;
case 0:
#ifdef CHECKJOBS
/* this will force to mail a message containing at least the exact
* and complete command executed for each execution of all jobs */
- debug("Execing '%s -c %s'", shell, line->cl_shell);
+ debug("Execing \"%s -c %s\"", shell, line->cl_shell);
#endif /* CHECKJOBS */
execl(shell, shell, "-c", line->cl_shell, NULL);
/* execl returns only on error */
- error_e("Can't find '%s'. Trying a execlp(\"sh\", ...)", shell);
+ error_e("Can't find \"%s\". Trying a execlp(\"sh\", ...)", shell);
execlp("sh", "sh", "-c", line->cl_shell, NULL);
- die_e("execl() '%s -c %s' error", shell, line->cl_shell);
+ die_e("execl() \"%s -c %s\" error", shell, line->cl_shell);
/* execution never gets here */
/* run sendmail with mail file as standard input */
execl(SENDMAIL, SENDMAIL, SENDMAIL_ARGS, pass->pw_name, NULL);
- error_e("Can't find '"SENDMAIL"'. Trying a execlp(\"sendmail\")");
+ error_e("Can't find \""SENDMAIL"\". Trying a execlp(\"sendmail\")");
execlp("sendmail", "sendmail", SENDMAIL_ARGS, pass->pw_name, NULL);
die_e("Can't exec " SENDMAIL);