OpenBSD CVS

CVS log for src/libexec/mail.local/mail.local.c


[BACK] Up to [local] / src / libexec / mail.local

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.43 / (download) - annotate - [select for diffs], Thu May 9 08:35:03 2024 UTC (4 weeks, 2 days ago) by florian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.42: +4 -3 lines
Diff to previous 1.42 (colored)

ctime(3) and ctime_r(3) can fail when timestamps are way off.
Add missing error checks to all calls under libexec/

Input kettenis, millert
OK millert

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jun 5 08:07:18 2023 UTC (12 months ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.41: +10 -19 lines
Diff to previous 1.41 (colored)

use getline(3) instead of fgetln(3)

while here simplify the "From " check too.
ok millert@

Revision 1.41 / (download) - annotate - [select for diffs], Mon May 15 12:02:40 2023 UTC (12 months, 3 weeks ago) by op
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

cast to '(long long)' instead of '(long long int)'

requested by deraadt@, ok tb@

Revision 1.40 / (download) - annotate - [select for diffs], Wed May 10 08:03:49 2023 UTC (12 months, 4 weeks ago) by op
Branch: MAIN
Changes since 1.39: +3 -2 lines
Diff to previous 1.39 (colored)

cast off_t to long long int for printing

reduces the diff with opensmtpd-portable.
ok tb@

Revision 1.39 / (download) - annotate - [select for diffs], Sun Feb 9 14:59:20 2020 UTC (4 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.38: +36 -33 lines
Diff to previous 1.38 (colored)

Use sysexits.h exit values to distinguish between tempfail and permfail.
Unix MTAs use the exit value of the MDA (here mail.local) to determine
whether or not a failure to deliver mail should be considered to be
a temporary or permanent failure.  OK semarie@ beck@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Feb 7 02:27:37 2020 UTC (4 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.37: +5 -14 lines
Diff to previous 1.37 (colored)

Remove backward compatibility for obsolete -H flag.
The -H flag was deprecated in 1998.  OK jung@

Revision 1.37 / (download) - annotate - [select for diffs], Sun Feb 2 23:17:09 2020 UTC (4 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.36: +65 -8 lines
Diff to previous 1.36 (colored)

Allow mail.local to be run as non-root.
If mail.local is invoked by a non-root user, open a pipe to
lockspool(1) for file locking.  It is only possible to delivery to
a pre-existing mail spool when running mail.local as non-root.
OK gilles@ deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:53 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.35: +6 -6 lines
Diff to previous 1.35 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Dec 12 20:09:28 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.34: +2 -3 lines
Diff to previous 1.34 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jul 6 15:02:51 2015 UTC (8 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.33: +30 -19 lines
Diff to previous 1.33 (colored)

Add support for IPv6 by using getaddrinfo().  Our inetd.conf ships
with an IPv6 comsat example but it would never get used.  OK deraadt@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:50 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.32: +4 -3 lines
Diff to previous 1.32 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.32 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:31 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.31: +1 -15 lines
Diff to previous 1.31 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.31 / (download) - annotate - [select for diffs], Mon May 26 09:22:03 2008 UTC (16 years ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

sort flags on both the synopsis and usage.

ok jmc@

Revision 1.30 / (download) - annotate - [select for diffs], Sat May 13 04:17:07 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.29: +2 -3 lines
Diff to previous 1.29 (colored)

delete case for ?; cdp_xe@gmx.net

Revision 1.29 / (download) - annotate - [select for diffs], Sat Apr 1 22:48:57 2006 UTC (18 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.28: +9 -7 lines
Diff to previous 1.28 (colored)

minor lint cleaning; ok millert

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jan 2 16:22:46 2006 UTC (18 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.27: +2 -3 lines
Diff to previous 1.27 (colored)

#include <sys/signal.h> not needed

Revision 1.27 / (download) - annotate - [select for diffs], Sun May 29 02:11:49 2005 UTC (19 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Fix case where input file lacks newline before EOF; Andrey Matveev

Revision 1.26 / (download) - annotate - [select for diffs], Sun Aug 8 19:32:45 2004 UTC (19 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

spacing

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jun 2 19:38:24 2003 UTC (21 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.24: +3 -7 lines
Diff to previous 1.24 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Jul 3 23:39:03 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.23: +7 -14 lines
Diff to previous 1.23 (colored)

KNF

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jun 2 01:27:16 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

minor KNF

Revision 1.22 / (download) - annotate - [select for diffs], Sat Aug 18 21:37:38 2001 UTC (22 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.21: +26 -26 lines
Diff to previous 1.21 (colored)

err() -> merr(), and reorder some bugs noted by giannici@neomedia.it; millert helped

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jul 9 07:04:42 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

correct type on last arg to execl(); nordin@cse.ogi.edu

Revision 1.20 / (download) - annotate - [select for diffs], Fri Apr 21 21:50:00 2000 UTC (24 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.19: +26 -16 lines
Diff to previous 1.19 (colored)

Use fgetln(3) instead of fgets(3) when reading in the message.  This
way the From line escaping gets done correctly even for really long
lines.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Aug 15 21:04:34 1998 UTC (25 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.18: +21 -206 lines
Diff to previous 1.18 (colored)

Break out locking code into its own file so it can be shared with lockspool.
Call lockspool when invoked with -H flag for backward compatibility.

Revision 1.18 / (download) - annotate - [select for diffs], Mon May 18 09:58:03 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

readlink(path, buf, sizeof buf-1).  Never forget that -1.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Aug 13 21:09:27 1997 UTC (26 years, 10 months ago) by dm
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.16: +5 -5 lines
Diff to previous 1.16 (colored)

a little extra paranoia

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jul 25 19:41:18 1997 UTC (26 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

#if __STDC__ --> #ifdef __STDC__

Revision 1.15 / (download) - annotate - [select for diffs], Fri Apr 4 18:41:27 1997 UTC (27 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

when mktemp() is hard to fix, use 10 X

Revision 1.14 / (download) - annotate - [select for diffs], Sat Mar 29 02:59:56 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.13: +15 -8 lines
Diff to previous 1.13 (colored)

Make ``mail.local -H'' explicately indicate when the lock fails or succeeds.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Mar 28 02:16:40 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

"mail.local -H" is valid usage.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Feb 12 15:12:27 1997 UTC (27 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

fix option argument parsing, nirva@ishiboo.com

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jan 17 07:12:03 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

r?index -> strr?chr

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jan 15 23:41:01 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

getopt(3) returns -1 when out of args, not EOF, whee!

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 24 19:42:03 1996 UTC (27 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

comment on why this mktemp use is safe

Revision 1.8 / (download) - annotate - [select for diffs], Wed Oct 16 06:30:56 1996 UTC (27 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (colored)

check malloc ret val

Revision 1.7 / (download) - annotate - [select for diffs], Fri Aug 30 12:04:13 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

use S_IWOTH

Revision 1.6 / (download) - annotate - [select for diffs], Thu Aug 29 07:21:58 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +149 -75 lines
Diff to previous 1.5 (colored)

first cut at -H; to be used mailers to grab locks in 755 spool direectories

Revision 1.5 / (download) - annotate - [select for diffs], Thu Aug 29 04:19:34 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +89 -8 lines
Diff to previous 1.4 (colored)

buf oflows, deal with 1777 spool, general DOS attack protection; help from david mazieres

Revision 1.4 / (download) - annotate - [select for diffs], Tue Aug 27 20:33:41 1996 UTC (27 years, 9 months ago) by dm
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Fix race condition.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Aug 27 03:18:00 1996 UTC (27 years, 9 months ago) by dm
Branch: MAIN
Changes since 1.2: +7 -4 lines
Diff to previous 1.2 (colored)

Use lockfiles by default, rather than fcntl.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jul 19 07:35:18 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +71 -35 lines
Diff to previous 1.1 (colored)

race thee no more; fix from travis@evtech.com with some additional stuff from me

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:43:19 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:43:19 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.