diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2012-10-04 19:49:54 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2012-10-04 19:49:54 +0000 |
commit | 878f28b620bcae626edf6a81612b811287400da8 (patch) | |
tree | 5d12dbc8148fff4d469fb45c985832a99ae0af2c /usr.sbin/smtpd/parse.y | |
parent | 0df231583402364f3fd4921e5803ec4ec72f942e (diff) |
default map source to S_PLAIN, this allows us to simplify smtpd.conf:
map aliases source plain "/etc/mail/aliases"
can be reduced to:
map aliases "/etc/mail/aliases"
Diffstat (limited to 'usr.sbin/smtpd/parse.y')
-rw-r--r-- | usr.sbin/smtpd/parse.y | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index 9313ac9e796..3e067ab715a 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.104 2012/09/30 17:25:09 chl Exp $ */ +/* $OpenBSD: parse.y,v 1.105 2012/10/04 19:49:53 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -440,29 +440,35 @@ main : QUEUE INTERVAL interval { */ ; -mapsource : PLAIN STRING { +mapsource : SOURCE PLAIN STRING { map->m_src = S_PLAIN; - if (strlcpy(map->m_config, $2, sizeof(map->m_config)) + if (strlcpy(map->m_config, $3, sizeof(map->m_config)) >= sizeof(map->m_config)) err(1, "pathname too long"); } - | DB STRING { + | STRING { + map->m_src = S_PLAIN; + if (strlcpy(map->m_config, $1, sizeof(map->m_config)) + >= sizeof(map->m_config)) + err(1, "pathname too long"); + } + | SOURCE DB STRING { map->m_src = S_DB; - if (strlcpy(map->m_config, $2, sizeof(map->m_config)) + if (strlcpy(map->m_config, $3, sizeof(map->m_config)) >= sizeof(map->m_config)) err(1, "pathname too long"); } /* - | LDAP STRING { + | SOURCE LDAP STRING { map->m_src = S_LDAP; - if (strlcpy(map->m_config, $2, sizeof(map->m_config)) + if (strlcpy(map->m_config, $3, sizeof(map->m_config)) >= sizeof(map->m_config)) err(1, "pathname too long"); } */ ; -mapopt : SOURCE mapsource { } +mapopt : mapsource { } map : MAP STRING { map = map_create(S_NONE, $2); |