summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/cron/cron.c5
-rw-r--r--usr.sbin/cron/entry.c40
-rw-r--r--usr.sbin/cron/externs.h20
-rw-r--r--usr.sbin/cron/funcs.h11
-rw-r--r--usr.sbin/cron/globals.h23
-rw-r--r--usr.sbin/cron/pathnames.h32
6 files changed, 38 insertions, 93 deletions
diff --git a/usr.sbin/cron/cron.c b/usr.sbin/cron/cron.c
index af7f8ec87fa..b1bb36b6901 100644
--- a/usr.sbin/cron/cron.c
+++ b/usr.sbin/cron/cron.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cron.c,v 1.60 2015/10/31 12:14:16 millert Exp $ */
+/* $OpenBSD: cron.c,v 1.61 2015/11/04 12:53:05 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -42,6 +42,8 @@ static long GMToff;
static cron_db database;
static at_db at_database;
static double batch_maxload = BATCH_MAXLOAD;
+static int NoFork;
+static time_t StartTime;
static void
usage(void)
@@ -64,7 +66,6 @@ main(int argc, char *argv[])
setvbuf(stdout, NULL, _IOLBF, 0);
setvbuf(stderr, NULL, _IOLBF, 0);
- NoFork = 0;
parse_args(argc, argv);
bzero((char *)&sact, sizeof sact);
diff --git a/usr.sbin/cron/entry.c b/usr.sbin/cron/entry.c
index c59dab981aa..952dfab07ff 100644
--- a/usr.sbin/cron/entry.c
+++ b/usr.sbin/cron/entry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entry.c,v 1.43 2015/10/26 14:27:41 millert Exp $ */
+/* $OpenBSD: entry.c,v 1.44 2015/11/04 12:53:05 millert Exp $ */
/*
* Copyright 1988,1990,1993,1994 by Paul Vixie
@@ -25,20 +25,30 @@ typedef enum ecode {
e_cmd, e_timespec, e_username, e_option, e_memory
} ecode_e;
-static const char *ecodes[] =
- {
- "no error",
- "bad minute",
- "bad hour",
- "bad day-of-month",
- "bad month",
- "bad day-of-week",
- "bad command",
- "bad time specifier",
- "bad username",
- "bad option",
- "out of memory"
- };
+static const char *ecodes[] = {
+ "no error",
+ "bad minute",
+ "bad hour",
+ "bad day-of-month",
+ "bad month",
+ "bad day-of-week",
+ "bad command",
+ "bad time specifier",
+ "bad username",
+ "bad option",
+ "out of memory"
+};
+
+static const char *MonthNames[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ NULL
+};
+
+static const char *DowNames[] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
+ NULL
+};
static int get_list(bitstr_t *, int, int, const char *[], int, FILE *),
get_range(bitstr_t *, int, int, const char *[], int, FILE *),
diff --git a/usr.sbin/cron/externs.h b/usr.sbin/cron/externs.h
index 0566131c526..9e5798a0c85 100644
--- a/usr.sbin/cron/externs.h
+++ b/usr.sbin/cron/externs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: externs.h,v 1.17 2015/10/06 14:58:37 tedu Exp $ */
+/* $OpenBSD: externs.h,v 1.18 2015/11/04 12:53:05 millert Exp $ */
/* Copyright 1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -45,18 +45,6 @@
#include <poll.h>
#include <unistd.h>
#include <utime.h>
-
-# include <syslog.h>
-
-# include <login_cap.h>
-
-# include <bsd_auth.h>
-
-#ifndef TZNAME_ALREADY_DEFINED
-extern char *tzname[2];
-#endif
-#define TZONE(tm) tzname[(tm).tm_isdst]
-
-#ifndef WCOREDUMP
-# define WCOREDUMP(st) (((st) & 0200) != 0)
-#endif
+#include <syslog.h>
+#include <login_cap.h>
+#include <bsd_auth.h>
diff --git a/usr.sbin/cron/funcs.h b/usr.sbin/cron/funcs.h
index c2947bdc6a8..a0229140e45 100644
--- a/usr.sbin/cron/funcs.h
+++ b/usr.sbin/cron/funcs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: funcs.h,v 1.23 2015/10/31 12:14:16 millert Exp $ */
+/* $OpenBSD: funcs.h,v 1.24 2015/11/04 12:53:05 millert Exp $ */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -22,11 +22,8 @@
* We should reorg this into sections by module.
*/
-void set_cron_uid(void),
- set_cron_cwd(void),
+void set_cron_cwd(void),
load_database(cron_db *),
- open_logfile(void),
- sigpipe_func(void),
job_add(entry *, user *),
do_command(entry *, user *),
link_user(cron_db *, user *),
@@ -35,7 +32,6 @@ void set_cron_uid(void),
env_free(char **),
unget_char(int, FILE *),
free_entry(entry *),
- acquire_daemonlock(int),
skip_comments(FILE *),
log_it(const char *, int, const char *, const char *),
log_close(void),
@@ -47,7 +43,6 @@ int job_runqueue(void),
get_string(char *, int, FILE *, char *),
load_env(char *, FILE *),
cron_pclose(FILE *, pid_t),
- glue_strings(char *, size_t, const char *, const char *, char),
allowed(const char *, const char *, const char *),
safe_p(const char *, const char *),
scan_atjobs(at_db *, struct timespec *);
@@ -55,7 +50,6 @@ int job_runqueue(void),
int strtot(const char *nptr, char **endptr, time_t *tp);
char *env_get(char *, char **),
- *arpadate(time_t *),
*first_word(char *, char *),
**env_init(void),
**env_copy(char **),
@@ -68,4 +62,3 @@ entry *load_entry(FILE *,
void (*)(const char *), struct passwd *, char **);
FILE *cron_popen(char *, char *, struct passwd *, pid_t *);
-
diff --git a/usr.sbin/cron/globals.h b/usr.sbin/cron/globals.h
index ee400029c5f..60bd938ed72 100644
--- a/usr.sbin/cron/globals.h
+++ b/usr.sbin/cron/globals.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: globals.h,v 1.11 2015/10/06 14:58:37 tedu Exp $ */
+/* $OpenBSD: globals.h,v 1.12 2015/11/04 12:53:05 millert Exp $ */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -25,26 +25,5 @@
# define INIT(x)
#endif
-XTRN const char *MonthNames[]
-#ifdef MAIN_PROGRAM
- = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
- NULL
- }
-#endif
- ;
-
-XTRN const char *DowNames[]
-#ifdef MAIN_PROGRAM
- = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
- NULL
- }
-#endif
- ;
-
XTRN char *ProgramName INIT("amnesia");
XTRN int LineNumber INIT(0);
-XTRN time_t StartTime INIT(0);
-XTRN int NoFork INIT(0);
diff --git a/usr.sbin/cron/pathnames.h b/usr.sbin/cron/pathnames.h
index 3bcd1b79677..e5db8c6be6a 100644
--- a/usr.sbin/cron/pathnames.h
+++ b/usr.sbin/cron/pathnames.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pathnames.h,v 1.17 2015/10/25 21:36:55 millert Exp $ */
+/* $OpenBSD: pathnames.h,v 1.18 2015/11/04 12:53:05 millert Exp $ */
/* Copyright 1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -20,15 +20,13 @@
#ifndef _PATHNAMES_H_
#define _PATHNAMES_H_
-# include <paths.h>
+#include <paths.h>
-#ifndef CRONDIR
/* CRONDIR is where cron(8) and crontab(1) both chdir
* to; SPOOL_DIR, CRON_ALLOW, CRON_DENY, and LOG_FILE
* are all relative to this directory.
*/
#define CRONDIR "/var/cron"
-#endif
/* SPOOLDIR is where the crontabs live.
* This directory will have its modtime updated
@@ -73,30 +71,6 @@
/* what editor to use if no EDITOR or VISUAL
* environment variable specified.
*/
-#if defined(_PATH_VI)
-# define EDITOR _PATH_VI
-#else
-# define EDITOR "/usr/ucb/vi"
-#endif
-
-#ifndef _PATH_SENDMAIL
-# define _PATH_SENDMAIL "/usr/lib/sendmail"
-#endif
-
-#ifndef _PATH_BSHELL
-# define _PATH_BSHELL "/bin/sh"
-#endif
-
-#ifndef _PATH_DEFPATH
-# define _PATH_DEFPATH "/usr/bin:/bin"
-#endif
-
-#ifndef _PATH_TMP
-# define _PATH_TMP "/tmp/"
-#endif
-
-#ifndef _PATH_DEVNULL
-# define _PATH_DEVNULL "/dev/null"
-#endif
+#define EDITOR _PATH_VI
#endif /* _PATHNAMES_H_ */