Thanks to visit codestin.com
Credit goes to cvsweb.openbsd.org

OpenBSD CVS

CVS log for src/usr.sbin/smtpd/makemap.c


[BACK] Up to [local] / src / usr.sbin / smtpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.77 / (download) - annotate - [select for diffs], Tue May 7 12:10:06 2024 UTC (16 months, 2 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_7_BASE, OPENBSD_7_7, OPENBSD_7_6_BASE, OPENBSD_7_6, HEAD
Changes since 1.76: +3 -2 lines
Diff to previous 1.76 (colored)

change the smtpd table protocol

Using imsg for the "proc" table (external programs) has proven quite
painful in practice since a lot of smtpd internals (structs, enums,
etc..) have to be kept in sync with the various tables implementations.

Instead, a filter-like protocol for tables decouples the implementations
and allows to write and test tables easily.

The new text-based transport protocol is documented in the (added)
smtpd-tables(7) manpage.

The old imsg protocol is no longer supported and existing tables have to
be converted.  In particular, users of opensmtpd-extras tables will need
install the new opensmtpd-table-* packages.

With lots of suggestions and improvements from gilles and a tweak
from Philipp (philipp+openbsd [at] bureaucracy [dot] de), thanks!

ok gilles

Revision 1.76 / (download) - annotate - [select for diffs], Sun Feb 11 09:24:26 2024 UTC (19 months, 1 week ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.75: +33 -49 lines
Diff to previous 1.75 (colored)

unify smtpd and makemap table parser

These are supposed to parse the same file format but have subtle
difference in the handling of comments, continuation lines and escaping.

Converge both to the simpler smtpd parser which doesn't handle
continuation lines nor escaping, and support comments only at the start
of the line.

improvements and ok millert@

Revision 1.75 / (download) - annotate - [select for diffs], Mon Jun 14 17:58:15 2021 UTC (4 years, 3 months ago) by eric
Branch: MAIN
CVS Tags: 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
Changes since 1.74: +1 -9 lines
Diff to previous 1.74 (colored)

add required headers for smtpd.h and remove unnecessary ones in other files.

ok jung@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jan 27 07:20:27 2021 UTC (4 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.73: +1 -2 lines
Diff to previous 1.73 (colored)

makemap does not need a common which it does not use.

Revision 1.72.2.1 / (download) - annotate - [select for diffs], Mon Feb 24 16:20:06 2020 UTC (5 years, 6 months ago) by millert
Branch: OPENBSD_6_5
Changes since 1.72: +9 -4 lines
Diff to previous 1.72 (colored) next main 1.73 (colored)

OpenBSD 6.5 errata 031, February 24, 2020:

An out of bounds read in smtpd allows an attacker to inject arbitrary
commands into the envelope file which are then executed as root.
Separately, missing privilege revocation in smtpctl allows arbitrary
commands to be run with the _smtpq group.

Revision 1.72.4.1 / (download) - annotate - [select for diffs], Mon Feb 24 16:19:32 2020 UTC (5 years, 6 months ago) by millert
Branch: OPENBSD_6_6
Changes since 1.72: +9 -4 lines
Diff to previous 1.72 (colored) next main 1.73 (colored)

OpenBSD 6.6 errata 021, February 24, 2020:

An out of bounds read in smtpd allows an attacker to inject arbitrary
commands into the envelope file which are then executed as root.
Separately, missing privilege revocation in smtpctl allows arbitrary
commands to be run with the _smtpq group.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Feb 24 16:16:07 2020 UTC (5 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.72: +9 -4 lines
Diff to previous 1.72 (colored)

Fix two security vulnerabilities discovered by Qualys.
An out of bounds read in smtpd allows an attacker to inject arbitrary
commands into the envelope file which are then executed as root.
Separately, missing privilege revocation in smtpctl allows arbitrary
commands to be run with the _smtpq group.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Dec 28 11:40:29 2018 UTC (6 years, 8 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_5_BASE
Branch point for: OPENBSD_6_6, OPENBSD_6_5
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

remove the tag workaround for table_create() and table_find(),
now that static tables handle their updates internally.

ok gilles@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Jul 3 01:34:43 2018 UTC (7 years, 2 months ago) by mortimer
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.70: +5 -9 lines
Diff to previous 1.70 (colored)

unbreak newaliases.
ok millert@

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jun 16 19:41:26 2018 UTC (7 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored)

rework the table API so that it takes a struct smtpd * context in parameter
of functions creating, looking up or destroying tables.

this is a first step in cleaning up parse.y so it doesn't have side effects
outside of parse_config(), bringing nothing but making code cleaner.

ok millert@

Revision 1.69 / (download) - annotate - [select for diffs], Thu May 31 21:06:12 2018 UTC (7 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored)

remove 'where' parameter from all x*() functions in utils.c, it doesn't
really help us with anything, propagate the change in codebase

ok millert@

Revision 1.68 / (download) - annotate - [select for diffs], Thu Apr 26 20:57:59 2018 UTC (7 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

sync log.h with other daemons

ok gilles@

Revision 1.67 / (download) - annotate - [select for diffs], Thu Jul 27 18:48:30 2017 UTC (8 years, 1 month ago) by sunil
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.66: +7 -12 lines
Diff to previous 1.66 (colored)

smtpctl(8): Use an int to determine mode instead of __progname.

Ok millert@ gilles@

Revision 1.66 / (download) - annotate - [select for diffs], Mon Jan 9 09:53:23 2017 UTC (8 years, 8 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.65: +2 -2 lines
Diff to previous 1.65 (colored)

smtpd joins the 7 other daemons that share the same log.c file.

The only major difference was the "log_trace" concept that is only
used by smtpd - move it from log.c into util.c and make it a local
concept.  This also needed to rename the global "verbose" variable to
"tracing" in a few places.

OK krw@ gilles@ eric@

Revision 1.65 / (download) - annotate - [select for diffs], Thu Mar 17 19:40:43 2016 UTC (9 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

Last parameter to execl[e]() functions *must* be cast to a pointer.
Just NULL is not good practise as NULL is theoretically allowed to
be an integer rather than a pointer.

Use (char *)NULL consistently instead of scattering a few (char *)0
and (void *)NULL into the mix.

Prompted by and probably ok deraadt@ millert@ kettenis@

Definitely ok mestre@ ratchov@

Revision 1.64 / (download) - annotate - [select for diffs], Sat Feb 13 08:53:18 2016 UTC (9 years, 7 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.63: +1 -3 lines
Diff to previous 1.63 (colored)

remove support for 'dbm' which is really 'recno' from our makemap, it can't
work because it requires dbopen() to be the call that creates the db, while
we want mkstemp() to create an empty db ourselves.

it has never worked, no one could ever create a recno db with our makemap &
no one actually noticed so drop it.

ok millert@, sunil@, jung@

Revision 1.63 / (download) - annotate - [select for diffs], Fri Feb 12 03:11:16 2016 UTC (9 years, 7 months ago) by sunil
Branch: MAIN
Changes since 1.62: +19 -5 lines
Diff to previous 1.62 (colored)

Cleanup getopt(3) mis-use in sendmail compat code.

Avoid multiple getopt(3) evaluations without optreset set and
unspecified behavior of optind = 0 as per POSIX. Instead, iterate
over argv the first time for classification. Fixes -portable without
any divergence from -current, and all newaliases opts are handled
in one place.

Looks good to me millert@
Ok gilles@ jung@ eric@

Revision 1.62 / (download) - annotate - [select for diffs], Wed Feb 10 09:23:53 2016 UTC (9 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

when creating a db map, we use a temporary file to work on and atomically
move to destination when done. this causes dbopen() to be called with an
empty file which happens to... not work with other db libraries.

adding O_TRUNC is noop for us, fixes the issue for other libraries and
lets us reduce delta between us and portable.

ok sunil@, ok eric@

Revision 1.61 / (download) - annotate - [select for diffs], Mon Dec 28 22:08:30 2015 UTC (9 years, 8 months ago) by jung
Branch: MAIN
Changes since 1.60: +8 -8 lines
Diff to previous 1.60 (colored)

remove spaces after '!'

no binary change

ok millert

Revision 1.60 / (download) - annotate - [select for diffs], Tue Dec 15 06:05:15 2015 UTC (9 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.59: +18 -3 lines
Diff to previous 1.59 (colored)

Sync the DB file once when done with fsync(), not on each write with O_SYNC.
The DB file being written is a temp file, so O_EXLOCK is unnecesary.

ok sunil@ gilles@

Revision 1.59 / (download) - annotate - [select for diffs], Sun Dec 13 11:06:19 2015 UTC (9 years, 9 months ago) by sunil
Branch: MAIN
Changes since 1.58: +24 -27 lines
Diff to previous 1.58 (colored)

Move some variables local to makemap().

Suggested by guenther@ Ok gilles@

Revision 1.58 / (download) - annotate - [select for diffs], Fri Dec 11 07:10:06 2015 UTC (9 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.57: +42 -3 lines
Diff to previous 1.57 (colored)

Add -U option like the sendmail makemap, for dumping DB files back to text

ok sunil@ gilles@

Revision 1.57 / (download) - annotate - [select for diffs], Mon Dec 7 12:29:19 2015 UTC (9 years, 9 months ago) by sunil
Branch: MAIN
Changes since 1.56: +19 -20 lines
Diff to previous 1.56 (colored)

Merge makemap(8) into smtpctl(8).

Ok gilles@, jung@

Revision 1.56 / (download) - annotate - [select for diffs], Mon Oct 26 16:38:06 2015 UTC (9 years, 10 months ago) by sunil
Branch: MAIN
Changes since 1.55: +6 -6 lines
Diff to previous 1.55 (colored)

Fix makemap(8) for values containing a '#'.

Ok millert@ gilles@

Revision 1.55 / (download) - annotate - [select for diffs], Sat Oct 17 19:44:07 2015 UTC (9 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.54: +3 -10 lines
Diff to previous 1.54 (colored)

makemap shout strip initial and trailing whitespaces using strip()

ok millert@, ok jung@

Revision 1.54 / (download) - annotate - [select for diffs], Mon Oct 12 07:58:19 2015 UTC (9 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.53: +1 -4 lines
Diff to previous 1.53 (colored)

do not umask() [with the wrong umask] around mkstemp() calls, no matter
how broken other systems are.
ok guenther gilles

Revision 1.53 / (download) - annotate - [select for diffs], Tue Oct 6 06:04:46 2015 UTC (9 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

fix values passed to umask(), they should be octal.
the permissions are even more restrictive than they should.

misc bug reported by qualys

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jan 20 17:37:54 2015 UTC (10 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

use <limits.h> comprehensively.  For now try to push <> includes to
each .c file, and out of the .h files.  To avoid overinclude.
ok gilles, in principle.  If this has been done right, -portable should
become easier to maintain.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:20 2015 UTC (10 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (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.50 / (download) - annotate - [select for diffs], Sat Oct 25 18:48:30 2014 UTC (10 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

newaliases / makemap should parse multi-line aliases entries

Revision 1.49 / (download) - annotate - [select for diffs], Tue Jul 8 13:49:09 2014 UTC (11 years, 2 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.48: +6 -0 lines
Diff to previous 1.48 (colored)

Update the table API: lookup functions can take an optional parameters
dictionnary (currently not set). While there, add a helper for forking
external backends, and remove unused table functions.

ok gilles@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Dec 26 17:25:32 2013 UTC (11 years, 8 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

bcopy -> memmove
bzero -> memset

Revision 1.47 / (download) - annotate - [select for diffs], Thu Nov 28 10:43:37 2013 UTC (11 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.46: +6 -6 lines
Diff to previous 1.46 (colored)

unsigned char casts for ctype
ok gilles@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Oct 29 10:50:55 2013 UTC (11 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

sort includes

Revision 1.45 / (download) - annotate - [select for diffs], Fri May 24 17:03:14 2013 UTC (12 years, 4 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.44: +28 -27 lines
Diff to previous 1.44 (colored)

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.44 / (download) - annotate - [select for diffs], Fri Mar 29 12:56:19 2013 UTC (12 years, 5 months ago) by tobias
Branch: MAIN
Changes since 1.43: +24 -26 lines
Diff to previous 1.43 (colored)

Prevent race conditions in db file handling.

ok gilles

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jan 31 18:34:43 2013 UTC (12 years, 7 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.42: +5 -4 lines
Diff to previous 1.42 (colored)

assorted fixes spotted by Coverity.
some log message updates.

ok gilles@

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jan 26 09:37:23 2013 UTC (12 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.41: +8 -16 lines
Diff to previous 1.41 (colored)

Sync with our smtpd repo:

* first bricks of ldap and sqlite support (not finished but both working)
* new table API to replace map API, all lookups are done through tables
* improved handling of temporary errors throughout the daemon
* improved scheduler and mta logic: connection reuse, optimizes batches
* improved queue: more tolerant to admin errors, new layout, less disk-IO
* improved memory usage under high load
* SSL certs/keys isolated to lookup process to avoid facing network
* VIRTUAL support improved, fully virtual setups possible now
* runtime tracing of processes through smtpctl trace
* ssl_privsep.c sync-ed with relayd
* ssl.c no longer contains smtpd specific interfaces
* smtpd-specific ssl bits moved to ssl_smtpd.c
* update mail address in copyright

FLUSH YOUR QUEUE. FLUSH YOUR QUEUE. FLUSH YOUR QUEUE. FLUSH YOUR QUEUE.

smtpd.conf(5) simplified, it will require adaptations

ok eric@

Revision 1.41 / (download) - annotate - [select for diffs], Fri Nov 23 10:55:25 2012 UTC (12 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.40: +15 -11 lines
Diff to previous 1.40 (colored)

knf

ok gilles@

Revision 1.40 / (download) - annotate - [select for diffs], Sat Oct 13 09:44:25 2012 UTC (12 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.39: +14 -2 lines
Diff to previous 1.39 (colored)

when makemap is executed in sendmail mode, check if ".db" is part of the
filename and imply it otherwise so that the following works:

	makemap hash /etc/mail/aliases < aliases

Revision 1.39 / (download) - annotate - [select for diffs], Mon Oct 8 19:45:11 2012 UTC (12 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.38: +7 -5 lines
Diff to previous 1.38 (colored)

when building a db map, always lowercase the key before a lookup in makemap

smtpd already does it, but this allows spotting a cycle at makemap time, so
user isn't surprised at runtime.

while at it, be more tolerant when user specifies /etc/mail/aliases instead
of /etc/mail/aliases.db

Revision 1.38 / (download) - annotate - [select for diffs], Sun Oct 7 16:57:14 2012 UTC (12 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.37: +39 -13 lines
Diff to previous 1.37 (colored)

We need to provide a sendmail-like interface to makemap so that some tools
that assume sendmail do not break ... add support for reading map source
from stdin, for specifying the DBTYPE of a map, and teach OUR makemap to
emulate sendmail interface.

ok eric@

Revision 1.37 / (download) - annotate - [select for diffs], Thu Sep 27 20:34:15 2012 UTC (12 years, 11 months ago) by chl
Branch: MAIN
Changes since 1.36: +4 -11 lines
Diff to previous 1.36 (colored)

use xstrdup() helper

ok eric@ gilles@

Revision 1.36 / (download) - annotate - [select for diffs], Wed Sep 19 12:59:59 2012 UTC (13 years ago) by eric
Branch: MAIN
Changes since 1.35: +1 -2 lines
Diff to previous 1.35 (colored)

expandnodes must be bzero()'d before parsing to be sure there is no bogus
data left on return, since the RB compare functions uses memcmp().  While
there, remove all calls to bzero() before alias_parse().

ok gilles@

Revision 1.35 / (download) - annotate - [select for diffs], Wed Sep 19 12:45:04 2012 UTC (13 years ago) by eric
Branch: MAIN
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored)

rename variables for consistency

ok gilles@

Revision 1.34 / (download) - annotate - [select for diffs], Sun Aug 19 14:16:58 2012 UTC (13 years, 1 month ago) by chl
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

coding style: replace all occurences of u_int* with uint*

ok eric@

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jul 29 17:21:43 2012 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

- introduce xlowercase() and allow lowercase() to fail gracefully
- replace all calls to lowercase() with calls to xlowercase()
- in the format string expansion, lowercase() all formats

we will have to reassess all calls to xlowercase() even though it has never
triggered as far as I know, we can probably gracefully fail some of them.
right now we're just keeping former behaviour.

this commit fixes issue reported by Hugo Osvaldo Barrera where a %u format
could lead to a delivery failure (ie: [email protected] should be expanded
to gilles, not GILLES ... only for local deliveries).

ok chl@ on the idea, ok eric@ on the diff

Revision 1.32 / (download) - annotate - [select for diffs], Mon May 16 21:27:38 2011 UTC (14 years, 4 months ago) by jasper
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
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

plug leak in make_aliases()

with/ok gilles@

Revision 1.31 / (download) - annotate - [select for diffs], Mon May 9 09:36:55 2011 UTC (14 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.30: +2 -3 lines
Diff to previous 1.30 (colored)

fix segfault in newaliases after global env move.

spotted by Christopher Zimmermann
ok gilles@

Revision 1.30 / (download) - annotate - [select for diffs], Sun May 1 12:57:11 2011 UTC (14 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.29: +11 -6 lines
Diff to previous 1.29 (colored)

the smtpd env is meant to be global, so do not pass it all around.

discussed with and ok gilles@

Revision 1.29 / (download) - annotate - [select for diffs], Sun Apr 17 13:36:07 2011 UTC (14 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.28: +8 -9 lines
Diff to previous 1.28 (colored)

cleanups, cosmethic changes, functions that should be static are now static
no functionnal change

Revision 1.28 / (download) - annotate - [select for diffs], Sun Nov 28 14:35:58 2010 UTC (14 years, 9 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

remove all unused headers

Revision 1.27 / (download) - annotate - [select for diffs], Sun Nov 28 13:56:43 2010 UTC (14 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.26: +3 -1 lines
Diff to previous 1.26 (colored)

a bit of .h cleanups, no functionnal change

Revision 1.26 / (download) - annotate - [select for diffs], Tue Apr 27 09:49:23 2010 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.25: +11 -27 lines
Diff to previous 1.25 (colored)

initial work at fixing aliases support:
- kill struct alias, struct expandnode is used instead
- introduce map_parse_alias() and map_parse_virtual()
- aliases and virtual code no longer assume db(3) but use the map API which
  lets them become backend agnostic AND value-checked. this actually makes
  the code simpler by removing all values parsing from aliases.c
- rename K_SECRETS -> K_SECRET, K_ALIASES -> K_ALIAS for consistency the
  enum has singular names.
- aliases, virtual and forward now work with an expandtree and deal with
  multiple levels of resolving by merging expandtree's

more coming soon ;)

Revision 1.25 / (download) - annotate - [select for diffs], Wed Apr 21 21:40:56 2010 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.24: +5 -1 lines
Diff to previous 1.24 (colored)

when creating a map, make sure we do not store a key/val separator at the
beginning of the key (ie: "gilles: bleh" should not be stored as
key[gilles] val[ bleh])

Revision 1.24 / (download) - annotate - [select for diffs], Sun Nov 8 23:08:56 2009 UTC (15 years, 10 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

rework a bit expansion and data structures involved in the expansion so we
no longer have a direct mapping between structures saved in aliases/virtual
db and structures used at runtime during expansion.

side effects ? struct alias is smaller, databases are smaller and it is no
longer necessary to rebuild aliases/virtual databases each time jacekm@ or
I make changes to some obscure structure used indirectely during expansion

rebuild databases, flush queues, make clean

Revision 1.23 / (download) - annotate - [select for diffs], Tue Nov 3 22:57:41 2009 UTC (15 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.22: +57 -7 lines
Diff to previous 1.22 (colored)

teach makemap how to build a set, which is a map containing only keys.
smtpd is now capable of looking primary domains at runtime in a set, which
means that the following becomes possible:

	map "primary" { source db "/etc/mail/primary.db" }
	accept for domain map "primary" deliver to mbox

while at it fix a couple bugs in the aliases resolution path which caused
recipients to bounce if a ruleset did not have an "accept for local" rule

"diff reads good" jacekm@, flush queue & make clean

Revision 1.22 / (download) - annotate - [select for diffs], Sat Oct 17 12:46:47 2009 UTC (15 years, 11 months ago) by sobrado
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

sort flags.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Oct 12 18:19:46 2009 UTC (15 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.20: +20 -1 lines
Diff to previous 1.20 (colored)

to support virtual domains properly, smtpd needed to have the domain stored
as a key in the virtual map, which means that to support virtual domain for
openbsd.org I would do:

openbsd.org		whatevervalue
[email protected]	gilles

this commit teaches makemap how to deduce the special domain keys based on
the entries for that domain, so that only the second line is needed now.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Aug 8 00:02:22 2009 UTC (16 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

import some changes from portable smtpd to reduce the delta between both.
this commit contains mostly missing casts and cosmethic changes, do not
expect to build this anywhere but on OpenBSD, it does not contain any of
the portable glue.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jul 28 20:51:50 2009 UTC (16 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

slightly change how makemap parses its lines so that we consider #
as a comment only when it starts a line or is preceded by whitespaces.

fixes a bug that was reported to me twice and which i ran into,
ok jacekm@

Revision 1.18 / (download) - annotate - [select for diffs], Sat May 30 23:53:41 2009 UTC (16 years, 3 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

It is now possible to specify a certificate to use when relaying to another
host which requests client certificates:

	accept [...] relay via [...] ssl certificate "mycert"

diff from Josh Elsasser <[email protected]>, tested and okayed by me with
no change but the addition of status 554 to the state machine to deal with
remote host telling us it doesn't like our certificate.

Revision 1.17 / (download) - annotate - [select for diffs], Sun May 10 11:29:40 2009 UTC (16 years, 4 months ago) by jacekm
Branch: MAIN
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

assert copyright; ok gilles@

Revision 1.16 / (download) - annotate - [select for diffs], Fri Apr 24 10:02:35 2009 UTC (16 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored)

Make aliases case-insensitive, issue reported by Daniel Ouelett; ok gilles@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Mar 19 22:03:33 2009 UTC (16 years, 6 months ago) by jacekm
Branch: MAIN
Changes since 1.14: +15 -10 lines
Diff to previous 1.14 (colored)

since maps may contain secrets, carry ownership and perms from source file
to db file; ok gilles@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Mar 9 16:31:09 2009 UTC (16 years, 6 months ago) by jacekm
Branch: MAIN
Changes since 1.13: +5 -19 lines
Diff to previous 1.13 (colored)

Drop ALIAS_TEXT, plain maps got implemented in a different way; ok gilles@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Mar 6 23:32:34 2009 UTC (16 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.12: +6 -1 lines
Diff to previous 1.12 (colored)

make_plain() deals with a c-string, val->size should contain the nul-byte
or we will truncate the last character of every value we store in a map.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Mar 6 23:29:06 2009 UTC (16 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

fix a bug in the generation of plain maps which would cause the value not
to be correctly inserted into the map.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Feb 22 11:44:29 2009 UTC (16 years, 7 months ago) by form
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

replace MAX* constants by sizeof where possible

ok jacekm@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Feb 17 23:50:58 2009 UTC (16 years, 7 months ago) by jacekm
Branch: MAIN
Changes since 1.9: +13 -2 lines
Diff to previous 1.9 (colored)

- flock input file while the database is being built
- make newaliases finish with short summary

ok gilles@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Feb 17 23:43:57 2009 UTC (16 years, 7 months ago) by jacekm
Branch: MAIN
Changes since 1.8: +56 -4 lines
Diff to previous 1.8 (colored)

make newaliases read aliases path from smtpd.conf; idea discussed with
gilles@, pyr@ and henning@, diff ok gilles@.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Feb 14 18:37:12 2009 UTC (16 years, 7 months ago) by jacekm
Branch: MAIN
Changes since 1.7: +142 -118 lines
Diff to previous 1.7 (colored)

Implement makemap -t and -o, for output type and dest resp.; ok gilles@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jan 1 16:15:47 2009 UTC (16 years, 8 months ago) by jacekm
Branch: MAIN
Changes since 1.6: +1 -3 lines
Diff to previous 1.6 (colored)

remove unnecessary includes; ok gilles@

Revision 1.6 / (download) - annotate - [select for diffs], Sun Dec 21 12:59:05 2008 UTC (16 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

Add more compile time checking; fix one warning reported by gcc.
From: Nicholas Marriott <[email protected]>

Revision 1.5 / (download) - annotate - [select for diffs], Thu Dec 18 15:19:33 2008 UTC (16 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.4: +7 -1 lines
Diff to previous 1.4 (colored)

Don't err() on blank lines.

ok gilles@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Dec 17 23:09:23 2008 UTC (16 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.3: +6 -1 lines
Diff to previous 1.3 (colored)

Warn if empty map is being created; this catches at least usage
error such as "makemap foo.db".

ok gilles@

Revision 1.3 / (download) - annotate - [select for diffs], Wed Dec 17 22:59:36 2008 UTC (16 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.2: +144 -112 lines
Diff to previous 1.2 (colored)

Merge newaliases into makemap.

ok gilles@

Revision 1.2 / (download) - annotate - [select for diffs], Sat Dec 13 13:15:38 2008 UTC (16 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.1: +1 -3 lines
Diff to previous 1.1 (colored)

Declare alias_parse in smtpd.h, and fix callers that pass it wrong
number of arguments.

ok gilles@

Revision 1.1 / (download) - annotate - [select for diffs], Wed Dec 3 21:20:20 2008 UTC (16 years, 9 months ago) by gilles
Branch: MAIN

- smtpd's db maps are incompatible with sendmail's and needs a distinct
	makemap utility, this is needed for virtual users support amongst
	other things. links to smtpd's aliases.c and only provides a
	frontent to parse map descriptions. contains code from pyr@, chl@
	and I. Should have also been imported with smtpd.

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.