cron.c database.c user.c job.c do_command.c popen.c \
$(common_src)
crontab_SOURCES = crontab.c $(common_src)
-common_src = entry.c env.c misc.c pw_dup.c security.c cron.h \
+common_src = entry.c env.c misc.c pw_dup.c security.c \
externs.h funcs.h globals.h macros.h pathnames.h structs.h \
bitstring.h
common_nodist = cron-paths.h
* to add clustering support.
*/
+#include "config.h"
+
#define MAIN_PROGRAM
-#include <cron.h>
+#include <errno.h>
+#include <langinfo.h>
+#include <locale.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#ifdef WITH_INOTIFY
+# include <sys/inotify.h>
+#endif
+
+#ifdef HAVE_SYS_FCNTL_H
+# include <sys/fcntl.h>
+#endif
+
+#include "funcs.h"
+#include "globals.h"
+#include "pathnames.h"
#if defined WITH_INOTIFY
int inotify_enabled;
+++ /dev/null
-/* Copyright 1988,1990,1993,1994 by Paul Vixie
- * All rights reserved
- */
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* cron.h - header for vixie's cron
- *
- * $Id: cron.h,v 1.6 2004/01/23 18:56:42 vixie Exp $
- *
- * vix 14nov88 [rest of log is in RCS]
- * vix 14jan87 [0 or 7 can be sunday; thanks, mwm@berkeley]
- * vix 30dec86 [written]
- */
-
-#include "../config.h"
-#include "externs.h"
-
-#ifdef WITH_SELINUX
-#include <selinux/selinux.h>
-#endif
-
-#ifdef WITH_PAM
-#include <security/pam_appl.h>
-#endif
-
-#ifdef WITH_INOTIFY
-#include <sys/inotify.h>
-#endif
-
-#include "pathnames.h"
-#include "macros.h"
-#include "structs.h"
-#include "funcs.h"
-#include "globals.h"
-
* to add clustering support.
*/
+#include "config.h"
+
#define MAIN_PROGRAM
-#include <cron.h>
+#include <errno.h>
+#include <locale.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <utime.h>
+
+#ifdef WITH_PAM
+# include <security/pam_appl.h>
+#endif
+
#ifdef WITH_SELINUX
# include <selinux/selinux.h>
# include <selinux/context.h>
# include <selinux/av_permissions.h>
#endif
+#include "bitstring.h"
+#include "externs.h"
+#include "funcs.h"
+#include "globals.h"
+#include "macros.h"
+#include "pathnames.h"
+#include "structs.h"
+
#define NHEADER_LINES 0
enum opt_t {opt_unknown, opt_list, opt_delete, opt_edit, opt_replace, opt_hostset, opt_hostget};
* to add clustering support.
*/
-#include <cron.h>
+#include "config.h"
+
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#ifdef WITH_INOTIFY
+# include <sys/inotify.h>
+#endif
+
+#include "funcs.h"
+#include "globals.h"
+#include "pathnames.h"
#define TMAX(a,b) ((a)>(b)?(a):(b))
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <cron.h>
+#include "config.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include "externs.h"
+#include "funcs.h"
+#include "globals.h"
+#include "structs.h"
+
+#ifndef isascii
+# define isascii(c) ((unsigned)(c)<=0177)
+#endif
static int child_process(entry *, char **);
static int safe_p(const char *, const char *);
* vix 30dec86 [written]
*/
-#include <cron.h>
+#include "config.h"
+
+#include <ctype.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "bitstring.h"
+#include "funcs.h"
+#include "globals.h"
+#include "macros.h"
+#include "pathnames.h"
typedef enum ecode {
e_none, e_minute, e_hour, e_dom, e_month, e_dow,
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <cron.h>
+#include "config.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "globals.h"
+#include "funcs.h"
char **env_init(void) {
char **p = (char **) malloc(sizeof (char *));
/* reorder these #include's at your peril */
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif
-#include <sys/file.h>
-/* stat is used even, when --with-inotify */
-#include <sys/stat.h>
-
-#include <bitstring.h>
-#include <ctype.h>
-#ifndef isascii
-#define isascii(c) ((unsigned)(c)<=0177)
-#endif
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <grp.h>
-#include <locale.h>
-#include <pwd.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <utime.h>
-
-#if defined(SYSLOG)
-# include <syslog.h>
-#endif
+#ifndef CRONIE_EXTERNS_H
+#define CRONIE_EXTERNS_H
#if defined(LOGIN_CAP)
# include <login_cap.h>
# include <bsd_auth.h>
#endif /*BSD_AUTH*/
-/* include locale stuff for mailer "Content-Type":
- */
-#include <locale.h>
-#include <nl_types.h>
-#include <langinfo.h>
-
#define DIR_T struct dirent
#define WAIT_T int
#define SIG_T sig_t
#ifndef WCOREDUMP
# define WCOREDUMP(st) (((st) & 0200) != 0)
#endif
+
+#endif /* CRONIE_EXTERNS_H */
*/
/* Notes:
- * This file has to be included by cron.h after data structure defs.
* We should reorg this into sections by module.
*/
+#ifndef CRONIE_FUNCS_H
+#define CRONIE_FUNCS_H
+
+#include <stdio.h>
+
+#include "externs.h"
+#include "structs.h"
+
void set_cron_uid(void),
check_spool_dir(void),
open_logfile(void),
/* PAM */
int cron_start_pam(struct passwd *pw);
void cron_close_pam(void);
+
+#endif /* CRONIE_FUNCS_H */
* to add clustering support.
*/
+#ifndef CRONIE_GLOBALS_H
+#define CRONIE_GLOBALS_H
+
+#include <time.h>
+
+#include "macros.h"
+
#ifdef MAIN_PROGRAM
# define XTRN
# define INIT(x) = x
#else
#define DebugFlags 0
#endif /* DEBUGGING */
+
+#endif /* CRONIE_GLOBALS_H */
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <cron.h>
+#include "config.h"
+
+#include <stdlib.h>
+
+#include "funcs.h"
+#include "globals.h"
typedef struct _job {
struct _job *next;
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
+#ifndef CRONIE_MACROS_H
+#define CRONIE_MACROS_H
+
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef O_NOFOLLOW
#define O_NOFOLLOW 0
#endif
+
+#endif /* CRONIE_MACROS_H */
* vix 30dec86 [written]
*/
-#include <cron.h>
+#include "config.h"
+
+#include "globals.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#if defined(SYSLOG)
+# include <syslog.h>
+#endif
+
#ifdef WITH_AUDIT
# include <libaudit.h>
#endif
#ifdef HAVE_FLOCK /* flock(2) */
# include <sys/file.h>
#endif
-#include <stdio.h>
+
+#include "funcs.h"
+#include "macros.h"
+#include "pathnames.h"
#if defined(SYSLOG) && defined(LOG_FILE)
# undef LOG_FILE
/* warning:
* heavily ascii-dependent.
*/
-void mkprint(char *dst, unsigned char *src, int len) {
+static void mkprint(char *dst, unsigned char *src, int len) {
/*
* XXX
* We know this routine can't overflow the dst buffer because mkprints()
*
*/
+#include "config.h"
+
+#include <errno.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include "funcs.h"
+#include "globals.h"
+#include "macros.h"
+
#ifdef HAVE_SYS_CDEFS_H
# include <sys/cdefs.h>
#endif
-#include <cron.h>
#include <signal.h>
/*
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <config.h>
+#include "config.h"
+
#include <sys/param.h>
#if !defined(OpenBSD) || OpenBSD < 200105
#include <stdio.h>
#include <string.h>
+#include "funcs.h"
+#include "globals.h"
+
struct passwd *
pw_dup(const struct passwd *pw) {
char *cp;
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <cron.h>
+#include "config.h"
+
+#include <errno.h>
+#include <grp.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "funcs.h"
+#include "globals.h"
+
+#ifdef WITH_PAM
+# include <security/pam_appl.h>
+#endif
#ifdef WITH_SELINUX
# include <selinux/selinux.h>
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifndef CRONIE_STRUCTS_H
+#define CRONIE_STRUCTS_H
+
+#include <time.h>
+#include "macros.h"
+#include "bitstring.h"
+
typedef struct _entry {
struct _entry *next;
struct passwd *pwd;
* variables for the main program, just
* extern them elsewhere.
*/
+
+#endif /* CRONIE_STRUCTS_H */
/* vix 26jan87 [log is in RCS file]
*/
-#include <cron.h>
+#include "config.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "funcs.h"
+#include "globals.h"
static const char *FileName;