diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-09-03 15:53:01 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-09-03 15:53:01 +0000 |
commit | fab13a4f25f936a15bc8dae81a9c6b453b0fb21d (patch) | |
tree | b9b86ba2628755704c16e2a136f8676ed6437653 /usr.bin/calendar/calendar.h | |
parent | 6448f697b9dd29cf29b43afce0b32fbc8b385e9f (diff) |
- Prevent users from hanging or killing 'calendar -a', at the cost of
one additional fork() per user who has a calendar file. Side effect is
that root runs much less code.
- Use login caps so we don't, for example, give a user more processes than
he's allowed.
- tmpfile() rather than mkstemp() means never leaving junk behind.
- Don't let 'calendar -a' take more than a day.
Reviewed by millert@
Diffstat (limited to 'usr.bin/calendar/calendar.h')
-rw-r--r-- | usr.bin/calendar/calendar.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/calendar/calendar.h b/usr.bin/calendar/calendar.h index e16ae8677e0..2fe6d35225b 100644 --- a/usr.bin/calendar/calendar.h +++ b/usr.bin/calendar/calendar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: calendar.h,v 1.4 1998/12/13 07:31:07 pjanzen Exp $ */ +/* $OpenBSD: calendar.h,v 1.5 2001/09/03 15:53:00 pjanzen Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -40,6 +40,7 @@ extern time_t f_time; extern struct iovec header[]; extern struct tm *tp; extern char *calendarFile; +extern char *calendarHome; extern char *optarg; struct fixs { @@ -108,3 +109,9 @@ extern int f_dayBefore; /* days before current date */ #define NUMEV 2 /* Total number of such special events */ extern struct specialev spev[NUMEV]; + +/* For calendar -a, specify a maximum time (in seconds) to spend parsing + * each user's calendar files. This prevents them from hanging calendar + * (e.g. by using named pipes) + */ +#define USERTIMEOUT 20 |