4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
31 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
32 /* All Rights Reserved */
42 #define DAY 24L*60L*60L
43 #define NQUEUE 26 /* number of queues available */
54 #define QUE(x) ('a'+(x))
55 #define RCODE(x) (((x)>>8)&0377)
56 #define TSTAT(x) ((x)&0377)
58 /* This constant must be at least sysconf(_SC_LOGIN_NAME_MAX) in size */
59 #define UNAMESIZE 32 /* max chars in a user name */
61 #define FLEN UNAMESIZE
62 #define LLEN UNAMESIZE
65 * structure used for passing messages from the at and crontab commands to cron
74 #define CRONDIR "/var/spool/cron/crontabs"
75 #define ATDIR "/var/spool/cron/atjobs"
76 #define ACCTFILE "/var/cron/log"
77 #define CRONALLOW "/etc/cron.d/cron.allow"
78 #define CRONDENY "/etc/cron.d/cron.deny"
79 #define ATALLOW "/etc/cron.d/at.allow"
80 #define ATDENY "/etc/cron.d/at.deny"
81 #define PROTO "/etc/cron.d/.proto"
82 #define QUEDEFS "/etc/cron.d/queuedefs"
83 #define FIFO "/etc/cron.d/FIFO"
84 #define DEFFILE "/etc/default/cron"
86 #define SHELL "/usr/bin/sh" /* shell to execute */
88 #define ENV_SHELL "SHELL="
90 #define ENV_HOME "HOME="
92 #define CTLINESIZE 1000 /* max chars in a crontab line */
94 extern int allowed(char *, char *, char *);
95 extern int days_in_mon(int, int);
96 extern char *errmsg(int);
97 extern char *getuser(uid_t
);
98 extern void cron_sendmsg(char, char *, char *, char);
99 extern time_t num(char **);
100 extern void *xmalloc(size_t);
101 extern void *xcalloc(size_t, size_t);
102 extern char *xstrdup(const char *);
103 extern int isvalid_shell(const char *shell
);
104 extern int isvalid_dir(const char *dir
);
106 extern int cron_admin(const char *);