OpenBSD CVS

CVS log for src/libexec/spamd-setup/spamd-setup.c


[BACK] Up to [local] / src / libexec / spamd-setup

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.50 / (download) - annotate - [select for diffs], Fri Jul 7 00:10:15 2017 UTC (6 years, 11 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, 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, OPENBSD_6_6_BASE, OPENBSD_6_6, 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, HEAD
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

allow fetching lists from https:// URLs too

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jul 7 00:09:14 2017 UTC (6 years, 11 months ago) by djm
Branch: MAIN
Changes since 1.48: +34 -6 lines
Diff to previous 1.48 (colored)

switch user to _spamd before executing ftp(1) to fetch lists.
sprinkle in some closefrom(2); ok deraadt@ beck@

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jan 4 09:15:24 2016 UTC (8 years, 5 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.47: +8 -5 lines
Diff to previous 1.47 (colored)

pledge(2) spamd-setup(8)

It needs these annotations, to at least run the operations next to them:

stdio: malloc(3)
rpath: open(2)
inet: connect(2)/socket(2)
proc: fork(2)
exec: execvp(3)

While here remove netinet/in.h since all we need is already in arpa/inet.h and
sort the headers alphabetically

OK beck@

Revision 1.47 / (download) - annotate - [select for diffs], Sat Dec 12 20:09:28 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
Changes since 1.46: +2 -3 lines
Diff to previous 1.46 (colored)

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

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jun 3 02:24:36 2015 UTC (9 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.45: +3 -4 lines
Diff to previous 1.45 (colored)

Do not assume that asprintf() clears the pointer on failure, which
is non-portable.  Also add missing asprintf() return value checks.
OK deraadt@ guenther@ doug@

Revision 1.45 / (download) - annotate - [select for diffs], Tue Jan 20 16:54:06 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.44: +13 -9 lines
Diff to previous 1.44 (colored)

Allocate a bit more memory to reduce the change of having to
realloc() which is expensive for large blacklists.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jan 19 19:25:47 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.43: +1 -2 lines
Diff to previous 1.43 (colored)

Does not need netinet/ip_ipsp.h

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:50 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.42: +4 -2 lines
Diff to previous 1.42 (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.42 / (download) - annotate - [select for diffs], Wed Jan 14 11:59:10 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.41: +9 -9 lines
Diff to previous 1.41 (colored)

Replace "errx(1, "malloc failed")" with "err(1, NULL)" to get
standard "Cannot allocate memory" message.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Jan 13 21:45:53 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.40: +6 -3 lines
Diff to previous 1.40 (colored)

Fix printing of number of whitelist entries in debug mode.

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jan 13 21:42:59 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.39: +16 -13 lines
Diff to previous 1.39 (colored)

Use address-family specific lists of addr/mask entries instead of
a union that can store either ipv4 or ipv6.  The old method used
4x as much memory as was really needed for ipv4.  The spamd-setup
protocol has changed from: tag;message;a/m;a/m;a/m...\n
to :tag;message;af;count;a/m;a/m;a/m...[af;count;a/m;a/m;a/m]\n
OK phessler@ "nice" beck@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Oct 9 02:43:43 2014 UTC (9 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.38: +7 -6 lines
Diff to previous 1.38 (colored)

obvious reallocarray() conversions

Revision 1.38 / (download) - annotate - [select for diffs], Tue Dec 4 02:24:47 2012 UTC (11 years, 6 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
Changes since 1.37: +1 -2 lines
Diff to previous 1.37 (colored)

remove some unnecessary sys/param.h inclusions

Revision 1.37 / (download) - annotate - [select for diffs], Wed Sep 9 16:05:55 2009 UTC (14 years, 9 months ago) by claudio
Branch: MAIN
CVS Tags: 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.36: +68 -80 lines
Diff to previous 1.36 (colored)

Change the way memory is allocated to reduce memory footprint. Loading the
large uatraps uses now around 8 times less memory. Other cleanup includes
a fast implementation of imask() (stolen from bgpd), killing some unused
code and try to estimate the memory needed in add_blacklist() to reduce the
realloc() calls.
Tested by many (sthen, matthieu, Stephan A. Rickauer)
OK beck@, sthen@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jun 2 22:38:45 2009 UTC (15 years ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.35: +5 -3 lines
Diff to previous 1.35 (colored)

Protect errno.

OK millert

Revision 1.35 / (download) - annotate - [select for diffs], Fri Oct 3 18:58:52 2008 UTC (15 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

-D before -d;

Revision 1.34 / (download) - annotate - [select for diffs], Fri Oct 3 14:25:10 2008 UTC (15 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +10 -4 lines
Diff to previous 1.33 (colored)

New option -D to daemonize spamd-setup for early bootup use.  This avoids
spamd-setup hanging if there are various (network?) issues and the system
not proceeding to multiuser so that this can be debugged.  We do not use
& for startup in /etc/rc because this makes the spamd-setup a child of the
rc scripts after bootup (that is gross)
Problem reported in PR 5864, change discussed with beck, ok millert

Revision 1.33 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:20 2007 UTC (16 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.32 / (download) - annotate - [select for diffs], Tue Feb 27 02:10:58 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.31: +7 -7 lines
Diff to previous 1.31 (colored)

Flag day for spamd -
1) config files move to /etc/mail
2) -g option goes away in spamd-setup and spamd - greylisting is now the default
3) option change to spamd, -b addr becomes -l addr.
4) -b option in spamd-setup and spamd to turn on old blacklisting mode.

Man page shortly to be flensed to make this easier to explain
ok deraadt@ millert@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Feb 25 22:59:38 2007 UTC (17 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.30: +17 -1 lines
Diff to previous 1.30 (colored)

Add usage() and error out if given bogus arguments.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Feb 24 19:28:13 2007 UTC (17 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.29: +43 -30 lines
Diff to previous 1.29 (colored)

When greylisting we don't actually need to use the <spamd> pf table.
We just do no-rdr for things in <spamd-white> and rdr the rest to spamdb.
OK beck@

Revision 1.29 / (download) - annotate - [select for diffs], Wed Feb 14 01:16:22 2007 UTC (17 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.28: +7 -13 lines
Diff to previous 1.28 (colored)

Fix some realloc() off-by-one errors found by ray@.
Also simplify fix_quoted_colons() to avoid realloc entirely since
the output buffer is at most 2x the length of the input buffer.
Parts adapted from a diff from tdeval@.  OK ray@, beck@

Revision 1.28 / (download) - annotate - [select for diffs], Fri Feb 9 19:12:29 2007 UTC (17 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Fix off by one in blacklist memory allocation.  From tdeval@

Revision 1.27 / (download) - annotate - [select for diffs], Thu May 11 15:37:21 2006 UTC (18 years, 1 month ago) by dhill
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.26: +13 -10 lines
Diff to previous 1.26 (colored)

fix some type definitions

ok beck

Revision 1.26 / (download) - annotate - [select for diffs], Sun Mar 26 23:54:00 2006 UTC (18 years, 2 months ago) by kjell
Branch: MAIN
Changes since 1.25: +1 -2 lines
Diff to previous 1.25 (colored)

Remove an extraneous prototype
From Andrey Matveev

Revision 1.25 / (download) - annotate - [select for diffs], Sun Mar 26 19:56:21 2006 UTC (18 years, 2 months ago) by kjell
Branch: MAIN
Changes since 1.24: +76 -76 lines
Diff to previous 1.24 (colored)

More KNF. Prodding from ray@
No binary change.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 26 19:18:49 2006 UTC (18 years, 2 months ago) by kjell
Branch: MAIN
Changes since 1.23: +19 -30 lines
Diff to previous 1.23 (colored)

Get this closer to KNF (get rid of block-declared vars)
ok beck@

Revision 1.23 / (download) - annotate - [select for diffs], Sun Mar 26 05:21:28 2006 UTC (18 years, 2 months ago) by kjell
Branch: MAIN
Changes since 1.22: +27 -27 lines
Diff to previous 1.22 (colored)

KNF. No binary change.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jan 17 17:52:49 2006 UTC (18 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Include <sys/param.h> to get MAX macro

Revision 1.21 / (download) - annotate - [select for diffs], Wed Mar 2 16:45:30 2005 UTC (19 years, 3 months ago) by dhartmei
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored)

process the last line of an address list even if it's not terminated
by newline. found by Rod Whitworth. ok beck@

Revision 1.20 / (download) - annotate - [select for diffs], Thu Sep 16 05:35:24 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.19: +14 -19 lines
Diff to previous 1.19 (colored)

clean C for a change

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jun 29 11:19:07 2004 UTC (19 years, 11 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.18: +1 -2 lines
Diff to previous 1.18 (colored)

absolutely no need to include machine/endian.h after sys/types.h and sys/types.h after sys/param.h

Revision 1.18 / (download) - annotate - [select for diffs], Wed Apr 28 07:32:57 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.17: +4 -2 lines
Diff to previous 1.17 (colored)

fd leaks; beck ok

Revision 1.17 / (download) - annotate - [select for diffs], Thu Feb 26 08:18:56 2004 UTC (20 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.16: +11 -2 lines
Diff to previous 1.16 (colored)

paranoia; beck ok

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jan 21 08:07:41 2004 UTC (20 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +44 -12 lines
Diff to previous 1.15 (colored)

New spamd configuration method.  Many people have trouble with the spam
RBL sites being slow, so now we will provide the maps ourselves through
our www mirrors around the world.  We can also now write our own internal
translators for maps that are in bad formats, and place them into the www
space in the correct format.  tested by beck, djm

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jan 21 02:49:34 2004 UTC (20 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.14: +19 -15 lines
Diff to previous 1.14 (colored)

cleanup

Revision 1.14 / (download) - annotate - [select for diffs], Fri Aug 22 21:50:34 2003 UTC (20 years, 9 months ago) by david
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

pf spelling police
ok dhartmei@ jmc@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 29 18:39:23 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

spaces

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jul 6 21:57:27 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +25 -1 lines
Diff to previous 1.11 (colored)

bring protos into scope

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jun 11 14:24:46 2003 UTC (21 years ago) by deraadt
Branch: MAIN
Changes since 1.10: +3 -5 lines
Diff to previous 1.10 (colored)

ansi cleanup; ok ian markus

Revision 1.10 / (download) - annotate - [select for diffs], Fri May 16 01:01:33 2003 UTC (21 years ago) by beck
Branch: MAIN
Changes since 1.9: +32 -19 lines
Diff to previous 1.9 (colored)

use inet_net_pton, and fix probelem where spamd-setup would crash on a file
consisting only of invalid input

Revision 1.9 / (download) - annotate - [select for diffs], Mon Apr 28 19:13:51 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

return from main

Revision 1.8 / (download) - annotate - [select for diffs], Thu Mar 13 21:20:42 2003 UTC (21 years, 3 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (colored)

make spamd-setup/spamd use/require a reserved source port for the
configuration connection.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Mar 10 19:36:13 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +11 -11 lines
Diff to previous 1.6 (colored)

nothing of import

Revision 1.6 / (download) - annotate - [select for diffs], Mon Mar 10 19:35:21 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

fix exit code, stupid bob, spotted by lebel

Revision 1.5 / (download) - annotate - [select for diffs], Sun Mar 9 19:22:26 2003 UTC (21 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.4: +15 -9 lines
Diff to previous 1.4 (colored)

Fix a few typos, Make spamd and spamd-setup use /etc/services to find
their ports. Adds "spamd" and "spamd-cfg" services to /etc/services.
Mostly from Daniel Lucq <daniel@lucq.org>.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Mar 9 02:50:54 2003 UTC (21 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

missed memset, found by dhartmei@

Revision 1.3 / (download) - annotate - [select for diffs], Sat Mar 8 22:06:02 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +6 -1 lines
Diff to previous 1.2 (colored)

knf

Revision 1.2 / (download) - annotate - [select for diffs], Sat Mar 8 18:29:16 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +103 -72 lines
Diff to previous 1.1 (colored)

KNF

Revision 1.1 / (download) - annotate - [select for diffs], Sat Mar 8 18:17:04 2003 UTC (21 years, 3 months ago) by beck
Branch: MAIN

spamd-setup, in c. ok deraadt@, he wants to clean in situ.

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.