View | Details | Raw Unified | Return to bug 210537 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-2 / +9 lines)
Lines 1-5 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
.include <src.opts.mk>
4
3
PROG=	cron
5
PROG=	cron
4
MAN=	cron.8
6
MAN=	cron.8
5
SRCS=	cron.c database.c do_command.c job.c user.c popen.c
7
SRCS=	cron.c database.c do_command.c job.c user.c popen.c
Lines 6-13 Link Here
6
8
7
CFLAGS+= -DLOGIN_CAP -DPAM
9
CFLAGS+= -DLOGIN_CAP -DPAM
8
10
9
LIBADD=	cron pam util
11
LIBADD=	cron pam util magic
12
.if ${MK_OPENSSL} == "no"
13
CFLAGS+=	-DNO_OPENSSL
14
.else
15
LIBADD+=crypto
16
.endif
10
17
11
WARNS?=	2
18
WARNS?=	5
12
19
13
.include <bsd.prog.mk>
20
.include <bsd.prog.mk>
(-)cron.8 (-2 / +20 lines)
Lines 28-33 Link Here
28
.Op Fl j Ar jitter
28
.Op Fl j Ar jitter
29
.Op Fl J Ar rootjitter
29
.Op Fl J Ar rootjitter
30
.Op Fl m Ar mailto
30
.Op Fl m Ar mailto
31
.Op Fl M
31
.Op Fl n
32
.Op Fl n
32
.Op Fl s
33
.Op Fl s
33
.Op Fl o
34
.Op Fl o
Lines 123-128 Link Here
123
The same as
124
The same as
124
.Fl j
125
.Fl j
125
except that it will affect jobs run by the superuser only.
126
except that it will affect jobs run by the superuser only.
127
.It Fl M
128
When preparing an e-mail with a job's output (if any), try to guess the
129
Content-Type of the message. This uses
130
.Lb libmagic
131
-- the same mechanism, as that used by
132
.Nm file.
133
.Pp
134
Note, only the initial portion of the output is analyzed (typicaly
135
-- up to 1024 characters), which could sometimes lead to incorrect results.
136
For example, if the text contains its first non-ASCII character beyond 
137
the initial portion, the charset part of the content-type may be incorrectly
138
set to "us-ascii".
126
.It Fl m Ar mailto
139
.It Fl m Ar mailto
127
Overrides the default recipient for
140
Overrides the default recipient for
128
.Nm
141
.Nm
Lines 168-176 Link Here
168
The second case is for the jobs that run less frequently.
181
The second case is for the jobs that run less frequently.
169
They are executed exactly once, they are not skipped nor
182
They are executed exactly once, they are not skipped nor
170
executed twice (unless cron is restarted or the user's
183
executed twice (unless cron is restarted or the user's
171
.Xr crontab 5
184
.Xr crontab 5 ,
185
.Xr file 1 ,
186
.Xr libmagic 3
172
is changed during such a time interval).
187
is changed during such a time interval).
173
If an interval disappears
188
.An Paul Vixie (original author) Aq paul@vix.com
189
.An Dmitry Morozovsky (jitter additions)
190
.An Sergey Babkin (time-zone changing code) Aq babkin@FreeBSD.org
191
.An Mikhail Teterin (Content-Type setting) Aq mi@aldan.algebra.com
174
due to the GMT offset change, such jobs are
192
due to the GMT offset change, such jobs are
175
executed at the same absolute point of time as they would be in the
193
executed at the same absolute point of time as they would be in the
176
old time zone.
194
old time zone.
(-)cron.c (-5 / +20 lines)
Lines 31-36 Link Here
31
#else
31
#else
32
# include <time.h>
32
# include <time.h>
33
#endif
33
#endif
34
#include <magic.h>
34
35
35
36
36
static	void	usage(void),
37
static	void	usage(void),
Lines 57-66 Link Here
57
static void
58
static void
58
usage() {
59
usage() {
59
#if DEBUGGING
60
#if DEBUGGING
60
    char **dflags;
61
    const char **dflags;
61
#endif
62
#endif
62
63
63
	fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] "
64
	fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] [-m]"
64
			"[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n");
65
			"[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n");
65
#if DEBUGGING
66
#if DEBUGGING
66
	fprintf(stderr, "\ndebugflags: ");
67
	fprintf(stderr, "\ndebugflags: ");
Lines 479-485 Link Here
479
480
480
#ifdef USE_SIGCHLD
481
#ifdef USE_SIGCHLD
481
static void
482
static void
482
sigchld_handler(int x)
483
sigchld_handler(int x __unused)
483
{
484
{
484
	WAIT_T		waiter;
485
	WAIT_T		waiter;
485
	PID_T		pid;
486
	PID_T		pid;
Lines 511-521 Link Here
511
512
512
513
513
static void
514
static void
514
sighup_handler(int x)
515
sighup_handler(int x __unused)
515
{
516
{
516
	log_close();
517
	log_close();
517
}
518
}
518
519
520
extern magic_t Magic;
519
521
520
static void
522
static void
521
parse_args(argc, argv)
523
parse_args(argc, argv)
Lines 525-531 Link Here
525
	int	argch;
527
	int	argch;
526
	char	*endp;
528
	char	*endp;
527
529
528
	while ((argch = getopt(argc, argv, "j:J:m:nosx:")) != -1) {
530
	while ((argch = getopt(argc, argv, "j:J:m:Mnosx:")) != -1) {
529
		switch (argch) {
531
		switch (argch) {
530
		case 'j':
532
		case 'j':
531
			Jitter = strtoul(optarg, &endp, 10);
533
			Jitter = strtoul(optarg, &endp, 10);
Lines 542-547 Link Here
542
		case 'm':
544
		case 'm':
543
			defmailto = optarg;
545
			defmailto = optarg;
544
			break;
546
			break;
547
		case 'M':
548
			Magic = magic_open(MAGIC_MIME|MAGIC_ERROR);
549
			if (Magic == NULL) {
550
				warnx("failed to allocate the magic structure");
551
				break;
552
			}
553
			if (!magic_load(Magic, NULL))
554
				break;
555
			warnx("failed to load magic DB: %s",
556
			    magic_error(Magic));
557
			magic_close(Magic);
558
			Magic = NULL;
559
			break;
545
		case 'n':
560
		case 'n':
546
			dont_daemonize = 1;
561
			dont_daemonize = 1;
547
			break;
562
			break;
(-)cron.h (-15 / +15 lines)
Lines 228-263 Link Here
228
		unget_char(int, FILE *),
228
		unget_char(int, FILE *),
229
		free_entry(entry *),
229
		free_entry(entry *),
230
		skip_comments(FILE *),
230
		skip_comments(FILE *),
231
		log_it(char *, int, char *, const char *),
231
		log_it(const char *, int, const char *, const char *),
232
		log_close(void);
232
		log_close(void);
233
233
234
int		job_runqueue(void),
234
int		job_runqueue(void),
235
		set_debug_flags(char *),
235
		set_debug_flags(char *),
236
		get_char(FILE *),
236
		get_char(FILE *),
237
		get_string(char *, int, FILE *, char *),
237
		get_string(char *, int, FILE *, const char *),
238
		swap_uids(void),
238
		swap_uids(void),
239
		swap_uids_back(void),
239
		swap_uids_back(void),
240
		load_env(char *, FILE *),
240
		load_env(char *, FILE *),
241
		cron_pclose(FILE *),
241
		cron_pclose(FILE *),
242
		strcmp_until(char *, char *, int),
242
		strcmp_until(const char *, const char *, int),
243
		allowed(char *),
243
		allowed(char *),
244
		strdtb(char *);
244
		strdtb(char *);
245
245
246
char		*env_get(char *, char **),
246
char		*env_get(const char *, char **),
247
		*arpadate(time_t *),
247
		*arpadate(time_t *),
248
		*mkprints(unsigned char *, unsigned int),
248
		*mkprints(unsigned char *, unsigned int),
249
		*first_word(char *, char *),
249
		*first_word(char *, const char *),
250
		**env_init(void),
250
		**env_init(void),
251
		**env_copy(char **),
251
		**env_copy(char **),
252
		**env_set(char **, char *);
252
		**env_set(char **, const char *);
253
253
254
user		*load_user(int, struct passwd *, char *),
254
user		*load_user(int, struct passwd *, const char *),
255
		*find_user(cron_db *, char *);
255
		*find_user(const cron_db *, const char *);
256
256
257
entry		*load_entry(FILE *, void (*)(char *),
257
entry		*load_entry(FILE *, void (*)(const char *),
258
				 struct passwd *, char **);
258
				 struct passwd *, char **);
259
259
260
FILE		*cron_popen(char *, char *, entry *);
260
FILE		*cron_popen(char *, const char *, const entry *);
261
261
262
262
263
				/* in the C tradition, we only create
263
				/* in the C tradition, we only create
Lines 267-290 Link Here
267
267
268
#ifdef MAIN_PROGRAM
268
#ifdef MAIN_PROGRAM
269
# if !defined(LINT) && !defined(lint)
269
# if !defined(LINT) && !defined(lint)
270
char	*copyright[] = {
270
const char	*copyright[] = {
271
		"@(#) Copyright 1988,1989,1990,1993,1994 by Paul Vixie",
271
		"@(#) Copyright 1988,1989,1990,1993,1994 by Paul Vixie",
272
		"@(#) All rights reserved"
272
		"@(#) All rights reserved"
273
	};
273
	};
274
# endif
274
# endif
275
275
276
char	*MonthNames[] = {
276
const char	*MonthNames[] = {
277
		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
277
		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
278
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
278
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
279
		NULL
279
		NULL
280
	};
280
	};
281
281
282
char	*DowNames[] = {
282
const char	*DowNames[] = {
283
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
283
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
284
		NULL
284
		NULL
285
	};
285
	};
286
286
287
char	*ProgramName,
287
const char	*ProgramName,
288
	*defmailto;
288
	*defmailto;
289
int	LineNumber;
289
int	LineNumber;
290
unsigned Jitter,
290
unsigned Jitter,
Lines 293-299 Link Here
293
293
294
# if DEBUGGING
294
# if DEBUGGING
295
int	DebugFlags;
295
int	DebugFlags;
296
char	*DebugFlagNames[] = {	/* sync with #defines */
296
const char	*DebugFlagNames[] = {	/* sync with #defines */
297
		"ext", "sch", "proc", "pars", "load", "misc", "test", "bit",
297
		"ext", "sch", "proc", "pars", "load", "misc", "test", "bit",
298
		NULL		/* NULL must be last element */
298
		NULL		/* NULL must be last element */
299
	};
299
	};
(-)database.c (-10 / +10 lines)
Lines 33-39 Link Here
33
#define TMAX(a,b) ((a)>(b)?(a):(b))
33
#define TMAX(a,b) ((a)>(b)?(a):(b))
34
34
35
35
36
static	void		process_crontab(char *, char *, char *,
36
static	void		process_crontab(const char *, const char *, const char *,
37
					     struct stat *,
37
					     struct stat *,
38
					     cron_db *, cron_db *);
38
					     cron_db *, cron_db *);
39
39
Lines 53-62 Link Here
53
		const char *name;
53
		const char *name;
54
		struct stat st;
54
		struct stat st;
55
	} syscrontabs [] = {
55
	} syscrontabs [] = {
56
		{ SYSCRONTABS },
56
		{ .name = SYSCRONTABS },
57
		{ LOCALSYSCRONTABS }
57
		{ .name = LOCALSYSCRONTABS }
58
	};
58
	};
59
	int i, ret;
59
	size_t	i;
60
	int	ret;
60
61
61
	Debug(DLOAD, ("[%d] load_database()\n", getpid()))
62
	Debug(DLOAD, ("[%d] load_database()\n", getpid()))
62
63
Lines 234-243 Link Here
234
235
235
user *
236
user *
236
find_user(db, name)
237
find_user(db, name)
237
	cron_db	*db;
238
	const cron_db *db;
238
	char	*name;
239
	const char *name;
239
{
240
{
240
	char	*env_get();
241
	user	*u;
241
	user	*u;
242
242
243
	for (u = db->head;  u != NULL;  u = u->next)
243
	for (u = db->head;  u != NULL;  u = u->next)
Lines 249-257 Link Here
249
249
250
static void
250
static void
251
process_crontab(uname, fname, tabname, statbuf, new_db, old_db)
251
process_crontab(uname, fname, tabname, statbuf, new_db, old_db)
252
	char		*uname;
252
	const char	*uname;
253
	char		*fname;
253
	const char	*fname;
254
	char		*tabname;
254
	const char	*tabname;
255
	struct stat	*statbuf;
255
	struct stat	*statbuf;
256
	cron_db		*new_db;
256
	cron_db		*new_db;
257
	cron_db		*old_db;
257
	cron_db		*old_db;
(-)do_command.c (-26 / +123 lines)
Lines 26-31 Link Here
26
#if defined(sequent)
26
#if defined(sequent)
27
# include <sys/universe.h>
27
# include <sys/universe.h>
28
#endif
28
#endif
29
#ifndef NO_OPENSSL
30
# include <openssl/bio.h>
31
# include <openssl/evp.h>
32
#endif
29
#if defined(SYSLOG)
33
#if defined(SYSLOG)
30
# include <syslog.h>
34
# include <syslog.h>
31
#endif
35
#endif
Lines 36-45 Link Here
36
# include <security/pam_appl.h>
40
# include <security/pam_appl.h>
37
# include <security/openpam.h>
41
# include <security/openpam.h>
38
#endif
42
#endif
43
#include <magic.h>
44
#include <inttypes.h>
39
45
46
magic_t Magic = NULL; /* Try to set Content-Type in generated e-mail? */
40
47
41
static void		child_process(entry *, user *),
48
static void	child_process(const entry *, const user *);
42
			do_univ(user *);
49
#if defined(sequent)
50
static void	do_univ(const user *);
51
#endif
43
52
44
53
45
void
54
void
Lines 85-100 Link Here
85
	Debug(DPROC, ("[%d] main process returning to work\n", getpid()))
94
	Debug(DPROC, ("[%d] main process returning to work\n", getpid()))
86
}
95
}
87
96
97
#ifndef NO_OPENSSL
98
static size_t
99
mimefwrite(const void * restrict ptr, size_t size, size_t nmemb,
100
    FILE * restrict stream)
101
{
102
	static BIO *base64;
103
	int bytes;
88
104
105
	Debug(DPROC, ("[%d] PROCESSING binary output %p, %zd, %zd, %p\n",
106
	    getpid(), ptr, size, nmemb, stream));
107
108
	if (ptr == NULL) {
109
		if (base64 == NULL)
110
			return 0;
111
112
		Debug(DPROC, ("[%d] CLOSING base64 output %p\n",
113
			getpid(), stream));
114
115
		BIO_set_close(base64, BIO_NOCLOSE);
116
		BIO_free_all(base64);
117
		base64 = NULL;
118
		return 0;
119
	}
120
121
	if (base64 == NULL) {
122
		BIO *b64 = BIO_new(BIO_f_base64());
123
124
		base64 = BIO_new_fp(stream, BIO_NOCLOSE);
125
		base64 = BIO_push(b64, base64);
126
	}
127
128
	bytes = BIO_write(base64, ptr, size * nmemb);
129
130
	return bytes / size;
131
}
132
#endif
133
89
static void
134
static void
90
child_process(e, u)
135
child_process(e, u)
91
	entry	*e;
136
	const entry	*e;
92
	user	*u;
137
	const user	*u;
93
{
138
{
94
	int		stdin_pipe[2], stdout_pipe[2];
139
	int		stdin_pipe[2], stdout_pipe[2];
95
	register char	*input_data;
140
	register char	*input_data;
96
	char		*usernm, *mailto, *mailfrom;
141
	char		*usernm, *mailto, *mailfrom;
97
	int		children = 0;
142
	int		children = 0;
143
	size_t		(*writer)(const void * restrict, size_t, size_t,
144
			    FILE * restrict) = fwrite;
98
# if defined(LOGIN_CAP)
145
# if defined(LOGIN_CAP)
99
	struct passwd	*pwd;
146
	struct passwd	*pwd;
100
	login_cap_t *lc;
147
	login_cap_t *lc;
Lines 275-285 Link Here
275
		close(stdin_pipe[READ_PIPE]);
322
		close(stdin_pipe[READ_PIPE]);
276
		close(stdout_pipe[WRITE_PIPE]);
323
		close(stdout_pipe[WRITE_PIPE]);
277
324
325
#if defined(sequent)
278
		/* set our login universe.  Do this in the grandchild
326
		/* set our login universe.  Do this in the grandchild
279
		 * so that the child can invoke /usr/lib/sendmail
327
		 * so that the child can invoke /usr/lib/sendmail
280
		 * without surprises.
328
		 * without surprises.
281
		 */
329
		 */
282
		do_univ(u);
330
		do_univ(u);
331
#endif
283
332
284
# if defined(LOGIN_CAP)
333
# if defined(LOGIN_CAP)
285
		/* Set user's entire context, but skip the environment
334
		/* Set user's entire context, but skip the environment
Lines 453-459 Link Here
453
502
454
	/*local*/{
503
	/*local*/{
455
		register FILE	*in = fdopen(stdout_pipe[READ_PIPE], "r");
504
		register FILE	*in = fdopen(stdout_pipe[READ_PIPE], "r");
456
		register int	ch;
505
		char		buf[BUFSIZ];
506
		size_t		bufsize;
457
507
458
		if (in == NULL) {
508
		if (in == NULL) {
459
			warn("fdopen failed in child");
509
			warn("fdopen failed in child");
Lines 460-474 Link Here
460
			_exit(ERROR_EXIT);
510
			_exit(ERROR_EXIT);
461
		}
511
		}
462
512
463
		ch = getc(in);
513
		/*
464
		if (ch != EOF) {
514
		 * Read a little bit of the job's output -- enough to
515
		 * determine the * Content-Type of it...
516
		 */
517
		bufsize = fread(buf, sizeof(char),
518
		    sizeof(buf)/sizeof(char), in);
519
520
		if (bufsize > 0) {
465
			register FILE	*mail;
521
			register FILE	*mail;
466
			register int	bytes = 1;
522
			off_t		bytes = 0;
467
			int		status = 0;
523
			int		status = 0;
468
524
469
			Debug(DPROC|DEXT,
525
			Debug(DPROC|DEXT,
470
				("[%d] got data (%x:%c) from grandchild\n",
526
				("[%d] got data (%x:%c) from grandchild, "
471
					getpid(), ch, ch))
527
				 "%zd chars\n",
528
					getpid(), buf[0], buf[0], bufsize))
472
529
473
			/* get name of recipient.  this is MAILTO if set to a
530
			/* get name of recipient.  this is MAILTO if set to a
474
			 * valid local username; USER otherwise.
531
			 * valid local username; USER otherwise.
Lines 494-499 Link Here
494
				register char	**env;
551
				register char	**env;
495
				auto char	mailcmd[MAX_COMMAND];
552
				auto char	mailcmd[MAX_COMMAND];
496
				auto char	hostname[MAXHOSTNAMELEN];
553
				auto char	hostname[MAXHOSTNAMELEN];
554
				const char	*mimetype;
497
555
498
				if (gethostname(hostname, MAXHOSTNAMELEN) == -1)
556
				if (gethostname(hostname, MAXHOSTNAMELEN) == -1)
499
					hostname[0] = '\0';
557
					hostname[0] = '\0';
Lines 511-516 Link Here
511
					fprintf(mail, "From: Cron Daemon <%s>\n",
569
					fprintf(mail, "From: Cron Daemon <%s>\n",
512
					    mailfrom);
570
					    mailfrom);
513
				fprintf(mail, "To: %s\n", mailto);
571
				fprintf(mail, "To: %s\n", mailto);
572
573
				if (Magic) {
574
					mimetype = magic_buffer(Magic,
575
					    buf, bufsize*sizeof(char));
576
					if (mimetype == NULL) {
577
						fprintf(mail,
578
						    "X-Cron-MagicError: %s\n",
579
						    magic_error(Magic));
580
					} else {
581
						const char *encoding = "8bit";
582
#ifndef NO_OPENSSL
583
						/*
584
						 * If available, use OpenSSL's
585
						 * base64 functinality to
586
						 * convert binary body:
587
						 */
588
						if (strstr(mimetype,
589
						    "charset=binary")) {
590
							encoding = "base64";
591
							writer = mimefwrite;
592
						}
593
#endif
594
595
						fprintf(mail,
596
						    "Mime-Version: 1.0\n"
597
						    "Content-Type: %s\n"
598
						    "Content-Transfer-"
599
						    "Encoding: %s\n",
600
						    mimetype, encoding);
601
					}
602
				}
603
514
				fprintf(mail, "Subject: Cron <%s@%s> %s\n",
604
				fprintf(mail, "Subject: Cron <%s@%s> %s\n",
515
					usernm, first_word(hostname, "."),
605
					usernm, first_word(hostname, "."),
516
					e->cmd);
606
					e->cmd);
Lines 522-531 Link Here
522
					fprintf(mail, "X-Cron-Env: <%s>\n",
612
					fprintf(mail, "X-Cron-Env: <%s>\n",
523
						*env);
613
						*env);
524
				fprintf(mail, "\n");
614
				fprintf(mail, "\n");
525
526
				/* this was the first char from the pipe
527
				 */
528
				putc(ch, mail);
529
			}
615
			}
530
616
531
			/* we have to read the input pipe no matter whether
617
			/* we have to read the input pipe no matter whether
Lines 533-544 Link Here
533
			 * mail pipe if we ARE mailing.
619
			 * mail pipe if we ARE mailing.
534
			 */
620
			 */
535
621
536
			while (EOF != (ch = getc(in))) {
622
			do {
537
				bytes++;
623
				if (mailto) {
538
				if (mailto)
624
					bytes += sizeof(char) *
539
					putc(ch, mail);
625
					    writer(buf, sizeof(char),
540
			}
626
						bufsize, mail);
627
				}
541
628
629
				bufsize = fread(buf, sizeof(char),
630
				    sizeof(buf)/sizeof(char), in);
631
			} while (bufsize != 0);
632
542
			/* only close pipe if we opened it -- i.e., we're
633
			/* only close pipe if we opened it -- i.e., we're
543
			 * mailing...
634
			 * mailing...
544
			 */
635
			 */
Lines 546-551 Link Here
546
			if (mailto) {
637
			if (mailto) {
547
				Debug(DPROC, ("[%d] closing pipe to mail\n",
638
				Debug(DPROC, ("[%d] closing pipe to mail\n",
548
					getpid()))
639
					getpid()))
640
#ifndef NO_OPENSSL
641
				/*
642
				 * If we were using mimefwrite, give it a
643
				 * chance to properly close things down:
644
				 */
645
				if (writer == mimefwrite)
646
					mimefwrite(NULL, 0, 0, mail);
647
#endif
549
				/* Note: the pclose will probably see
648
				/* Note: the pclose will probably see
550
				 * the termination of the grandchild
649
				 * the termination of the grandchild
551
				 * in addition to the mail process, since
650
				 * in addition to the mail process, since
Lines 560-570 Link Here
560
			 * what's going on.
659
			 * what's going on.
561
			 */
660
			 */
562
			if (mailto && status) {
661
			if (mailto && status) {
563
				char buf[MAX_TEMPSTR];
564
565
				snprintf(buf, sizeof(buf),
662
				snprintf(buf, sizeof(buf),
566
			"mailed %d byte%s of output but got status 0x%04x\n",
663
			"mailed %jd byte%s of output but got status 0x%04x\n",
567
					bytes, (bytes==1)?"":"s",
664
					(intmax_t)bytes, (bytes==1)?"":"s",
568
					status);
665
					status);
569
				log_it(usernm, getpid(), "MAIL", buf);
666
				log_it(usernm, getpid(), "MAIL", buf);
570
			}
667
			}
Lines 600-610 Link Here
600
}
697
}
601
698
602
699
700
#if defined(sequent)
603
static void
701
static void
604
do_univ(u)
702
do_univ(u)
605
	user	*u;
703
	const user	*u;
606
{
704
{
607
#if defined(sequent)
608
/* Dynix (Sequent) hack to put the user associated with
705
/* Dynix (Sequent) hack to put the user associated with
609
 * the passed user structure into the ATT universe if
706
 * the passed user structure into the ATT universe if
610
 * necessary.  We have to dig the gecos info out of
707
 * necessary.  We have to dig the gecos info out of
Lines 634-638 Link Here
634
		return;
731
		return;
635
732
636
	(void) universe(U_ATT);
733
	(void) universe(U_ATT);
734
}
637
#endif
735
#endif
638
}
(-)popen.c (-2 / +3 lines)
Lines 56-63 Link Here
56
56
57
FILE *
57
FILE *
58
cron_popen(program, type, e)
58
cron_popen(program, type, e)
59
	char *program, *type;
59
	char		*program;
60
	entry *e;
60
	const char	*type;
61
	const entry	*e;
61
{
62
{
62
	register char *cp;
63
	register char *cp;
63
	FILE *iop;
64
	FILE *iop;
(-)user.c (-2 / +2 lines)
Lines 44-50 Link Here
44
44
45
static void
45
static void
46
log_error(msg)
46
log_error(msg)
47
	char	*msg;
47
	const char	*msg;
48
{
48
{
49
	log_it(User_name, getpid(), "PARSE", msg);
49
	log_it(User_name, getpid(), "PARSE", msg);
50
}
50
}
Lines 53-59 Link Here
53
load_user(crontab_fd, pw, name)
53
load_user(crontab_fd, pw, name)
54
	int		crontab_fd;
54
	int		crontab_fd;
55
	struct passwd	*pw;		/* NULL implies syscrontab */
55
	struct passwd	*pw;		/* NULL implies syscrontab */
56
	char		*name;
56
	const char	*name;
57
{
57
{
58
	char	envstr[MAX_ENVSTR];
58
	char	envstr[MAX_ENVSTR];
59
	FILE	*file;
59
	FILE	*file;

Return to bug 210537