OBJSD := fcron.o cl.o subs.o mem.o save.o temp_file.o log.o database.o job.o conf.o u_list.o exe_list.o lavg_list.o env_list.o fcronconf.o $(LIBOBJS)
OBJSTAB := fcrontab.o cl.o subs.o mem.o save.o temp_file.o log.o fileconf.o allow.o read_string.o u_list.o env_list.o fcronconf.o
OBJSDYN := fcrondyn.o subs.o mem.o log.o allow.o read_string.o fcronconf.o
-OBJCONV := convert-fcrontab.o cl.o subs.o mem.o save.o log.o u_list.o env_list.o
+OBJCONV := convert-fcrontab.o cl.o subs.o mem.o save.o log.o u_list.o env_list.o fcronconf.o
OBJSIG := fcronsighup.o subs.o mem.o log.o allow.o fcronconf.o
HEADERSALL := config.h $(SRCDIR)/global.h $(SRCDIR)/cl.h $(SRCDIR)/log.h $(SRCDIR)/subs.h $(SRCDIR)/mem.h $(SRCDIR)/save.h $(SRCDIR)/option.h $(SRCDIR)/dyncom.h
/* constants and variables defined by command line */
while(1) {
- c = getopt(argc, argv, "hV");
+ c = getopt(argc, argv, "chV");
if (c == EOF) break;
switch (c) {
case 'h':
usage(); break;
+ case 'c':
+ Set(fcronconf, optarg); break;
+
case ':':
fprintf(stderr, "(setopt) Missing parameter");
usage();
if (optind >= argc || argc != 2)
usage();
+ /* parse fcron.conf */
+ read_conf();
+
user_to_update = strdup2(argv[optind]);
if (chdir(cdir) != 0)
#include "global.h"
+/* needed for parsing a conf file */
+#include "fcronconf.h"
+
extern uid_t rootuid;
extern gid_t rootgid;
char *fifofile = NULL;
char *fcronallow = NULL;
char *fcrondeny = NULL;
-char *fcronlog = NULL;
+char *fcronlogfile = NULL;
char *shell = NULL;
char *sendmail = NULL;
char *editor = NULL;
else if ( strncmp(ptr1, "fifofile", namesize) == 0 ) { Set(fifofile , ptr2); }
else if ( strncmp(ptr1, "fcronallow", namesize) == 0 ) { Set(fcronallow , ptr2); }
else if ( strncmp(ptr1, "fcrondeny", namesize) == 0 ) { Set(fcrondeny , ptr2); }
- else if ( strncmp(ptr1, "fcronlog", namesize) == 0 ) { Set(fcronlog, ptr2); }
+ else if ( strncmp(ptr1, "fcronlog", namesize) == 0 ) { Set(fcronlogfile, ptr2); }
else if ( strncmp(ptr1, "shell", namesize) == 0 ) { Set(shell , ptr2); }
else if ( strncmp(ptr1, "sendmail", namesize) == 0 ) { Set(sendmail , ptr2); }
else if ( strncmp(ptr1, "editor", namesize) == 0 ) { Set(editor , ptr2); }
extern char *fcronallow;
extern char *fcrondeny;
extern char *fcrontabs;
-extern char *fcronlog;
+extern char *fcronlogfile;
extern char *pidfile;
extern char *fifofile;
extern char *editor;
return;
// are we using syslog?
- if (dosyslog && (fcronlog == NULL)) {
+ if (dosyslog && (fcronlogfile == NULL)) {
openlog(prog_name, LOG_PID, SYSLOG_FACILITY);
- } else if (fcronlog != NULL) {
- logfd = fopen(fcronlog, "a+");
+ } else if (fcronlogfile != NULL) {
+ logfd = fopen(fcronlogfile, "a+");
}
log_open = 1;
return;
// check whether we need to close syslog, or a file.
- if (dosyslog && (fcronlog == NULL)) {
+ if (dosyslog && (fcronlogfile == NULL)) {
closelog();
- } else if (fcronlog != NULL) {
+ } else if (fcronlogfile != NULL) {
fclose(logfd);
}
time_t t = time(NULL);
struct tm *ft;
char date[30];
- char type[30]
+ char *type;
// print the current time as a string.
ft = localtime(&t);