diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-04-19 14:35:41 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-04-19 14:35:41 +0000 |
commit | 748acd94d582801673fe87d6799ab3f73a267f75 (patch) | |
tree | 40a8d4ba8ff96fa86c47457ed8b8d153be83458c /usr.bin/vacation | |
parent | 897e48d28a35ff8250ea8968c9e9dbfd2099db57 (diff) |
match behavior of current sendmail-based vacation: eliminate the concept that
an interval (-r) of 0 indicates sending a reply to every message (per sender),
but rather match the 'non-numeric' case where only one reply will be sent (per
sender). default remains unchanged. vacation database should be reinitalized
sometime before 2038.
removes the need for time_t casts.
discussed with deraadt; ok millert
Diffstat (limited to 'usr.bin/vacation')
-rw-r--r-- | usr.bin/vacation/vacation.1 | 13 | ||||
-rw-r--r-- | usr.bin/vacation/vacation.c | 6 |
2 files changed, 6 insertions, 13 deletions
diff --git a/usr.bin/vacation/vacation.1 b/usr.bin/vacation/vacation.1 index d8ea7bfcd9b..d16280e6d44 100644 --- a/usr.bin/vacation/vacation.1 +++ b/usr.bin/vacation/vacation.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vacation.1,v 1.19 2007/05/31 19:20:19 jmc Exp $ +.\" $OpenBSD: vacation.1,v 1.20 2013/04/19 14:35:40 okan Exp $ .\" $NetBSD: vacation.1,v 1.5 1995/08/31 21:57:08 jtc Exp $ .\" .\" Copyright (c) 1985, 1987, 1990, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)vacation.1 8.2 (Berkeley) 4/28/95 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: April 19 2013 $ .Dt VACATION 1 .Os .Sh NAME @@ -82,17 +82,10 @@ days. The default is one week. An interval of .Dq 0 -means that -a reply is sent to each message, and an interval of +or .Dq Li infinite (actually, any non-numeric character) will never send more than one reply. -It should be noted that intervals of -.Dq Li \&0 -are quite -dangerous, as it allows mailers to get into -.Dq I am on vacation -loops. .El .Pp Messages will not be replied to diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 23a36de5505..f51e233dd65 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vacation.c,v 1.32 2009/10/27 23:59:46 deraadt Exp $ */ +/* $OpenBSD: vacation.c,v 1.33 2013/04/19 14:35:40 okan Exp $ */ /* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */ /* @@ -114,7 +114,7 @@ main(int argc, char *argv[]) if (interval < 0) usage(); } else - interval = (time_t)LONG_MAX; /* XXX */ + interval = 0; /* one time only */ break; default: usage(); @@ -401,7 +401,7 @@ recent(void) key.size = strlen(from); if (!(db->get)(db, &key, &data, 0)) { bcopy(data.data, &then, sizeof(then)); - if (next == (time_t)LONG_MAX || /* XXX */ + if (next == 0 || then + next > time(NULL)) return(1); } |