From: Wietse Venema Date: Tue, 30 Mar 1999 05:00:00 +0000 (-0500) Subject: snapshot-19990330 X-Git-Tag: v20010228~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04e16ab3d5a6ef141e9ed8fd4612870999d5a4fd;p=thirdparty%2Fpostfix.git snapshot-19990330 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index bce74a964..ccc96896b 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -2461,7 +2461,9 @@ Apologies for any names omitted. and appending null bytes to key/value. The latter was needed for a clean implementation of NIS master alias maps support. - Feature: POSIX regular expressions by Lamont Jones. + Feature: POSIX regular expressions by Lamont Jones. See + config/sample-regexp.c. Right now, enabled on *BSD and + LINUX only. 19990328 @@ -2493,6 +2495,12 @@ Apologies for any names omitted. Feature: new dictionary types can be registered with dict_open_register(). File: util/dict_open.c. +1990330 + + Bug fix: match_list membership dictionary lookups were case + sensitive when they should not. Patch by Lutz Jaenicke, + BTU Cottbus, Germany. + Future: Planned: must be able to list the same hash table in diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf index d8b25fdc8..90dea7c21 100644 --- a/postfix/conf/sample-misc.cf +++ b/postfix/conf/sample-misc.cf @@ -7,6 +7,12 @@ # always_bcc = +# The daemon_timeout parameter specifies how much time a daemon may +# take to handle a request before it assumes it is wedged and commits +# suicide. +# +daemon_timeout = 18000 + # The default_database_type parameter specifies the default database # type to use in postalias(1) and postmap(1) commands. On many UNIX # systems the default type is either `dbm' or `hash'. The default is diff --git a/postfix/conf/sample-smtp.cf b/postfix/conf/sample-smtp.cf index 64ac7d751..69819ffbb 100644 --- a/postfix/conf/sample-smtp.cf +++ b/postfix/conf/sample-smtp.cf @@ -59,7 +59,8 @@ smtp_destination_recipient_limit = $default_destination_recipient_limit # TIMEOUT CONTROLS # # Note: if you set SMTP timeouts to large values you must update the -# global ipc_timeout parameter as well. See sample-misc.cf for details. +# global ipc_timeout and daemon_timeout parameters as well. See +# sample-misc.cf for details. # # The smtp_connect_timeout parameter specifies the SMTP client diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index e1976f88e..4ddf7132a 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-19990329" +#define DEF_MAIL_VERSION "Snapshot-19990330" extern char *var_mail_version; /* LICENSE diff --git a/postfix/local/alias.c b/postfix/local/alias.c index bbbbe9df0..982567bab 100644 --- a/postfix/local/alias.c +++ b/postfix/local/alias.c @@ -130,6 +130,7 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) uid_t alias_uid; struct mypasswd *alias_pwd; VSTRING *canon_owner; + DICT *dict; /* * Make verbose logging easier to understand. @@ -185,9 +186,17 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) * With aliases that have an owner- alias, the latter is used to set the * sender and owner attributes. Otherwise, the owner attribute is reset * (the alias is globally visible and could be sent to by anyone). + * + * Don't match aliases that are based on regexps. */ for (cpp = maps->argv->argv; *cpp; cpp++) { - if ((alias_result = dict_lookup(*cpp, state.msg_attr.local)) != 0) { + if ((dict = dict_handle(*cpp)) == 0) + msg_panic("%s: dictionary not found: %s", myname, *cpp); + if ((dict->flags & DICT_FLAG_FIXED) == 0) { + msg_warn("invalid alias map type: %s", *cpp); + continue; + } + if ((alias_result = dict_get(dict, state.msg_attr.local)) != 0) { if (msg_verbose) msg_info("%s: %s: %s = %s", myname, *cpp, state.msg_attr.local, alias_result); @@ -228,6 +237,8 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) * Use the owner- alias if one is specified, otherwise reset the * owner attribute and use the include file ownership if we can. * Save the dict_lookup() result before something clobbers it. + * + * Don't match aliases that are based on regexps. */ #define STR(x) vstring_str(x) #define OWNER_ASSIGN(own) \ @@ -235,7 +246,8 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) concatenate("owner-", state.msg_attr.local, (char *) 0))) expansion = mystrdup(alias_result); - if (OWNER_ASSIGN(owner) != 0 && maps_find(maps, owner, 0)) { + if (OWNER_ASSIGN(owner) != 0 && maps_find(maps, owner, + DICT_FLAG_FIXED)) { canon_owner = canon_addr_internal(vstring_alloc(10), owner); SET_OWNER_ATTR(state.msg_attr, STR(canon_owner), state.level); } else { diff --git a/postfix/master/multi_server.c b/postfix/master/multi_server.c index 5f60c63db..0e8eb368b 100644 --- a/postfix/master/multi_server.c +++ b/postfix/master/multi_server.c @@ -308,7 +308,6 @@ static void multi_server_accept_inet(int unused_event, char *context) int listen_fd = (int) context; int time_left = -1; int fd; - VSTREAM *stream; /* * Some buggy systems cause Postfix to lock up. diff --git a/postfix/postalias/postalias.c b/postfix/postalias/postalias.c index 4159a63b9..905d497ce 100644 --- a/postfix/postalias/postalias.c +++ b/postfix/postalias/postalias.c @@ -28,6 +28,8 @@ /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. +/* .IP \f\B-w\fR +/* Do not warn about duplicate entries; silently ignore them. /* .PP /* Arguments: /* .IP \fIfile_type\fR diff --git a/postfix/postmap/postmap.c b/postfix/postmap/postmap.c index fc660d80d..21e88d12e 100644 --- a/postfix/postmap/postmap.c +++ b/postfix/postmap/postmap.c @@ -47,6 +47,8 @@ /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. +/* .IP \f\B-w\fR +/* Do not warn about duplicate entries; silently ignore them. /* .PP /* Arguments: /* .IP \fIfile_type\fR diff --git a/postfix/smtpd/smtpd_check.c b/postfix/smtpd/smtpd_check.c index 5dc20d638..570b15e94 100644 --- a/postfix/smtpd/smtpd_check.c +++ b/postfix/smtpd/smtpd_check.c @@ -925,12 +925,12 @@ static int check_domain_access(SMTPD_STATE *state, char *table, for (name = low_domain; (next = strchr(name, '.')) != 0; name = next + 1) { if ((dict = dict_handle(table)) == 0) msg_panic("%s: dictionary not found: %s", myname, table); - if (flags != 0 && (flags & dict->flags) == 0) - continue; - if ((value = dict_get(dict, name)) != 0) - CHK_DOMAIN_RETURN(check_table_result(state, table, value, domain)); - if (dict_errno != 0) - msg_fatal("%s: table lookup problem", table); + if (flags == 0 || (flags & dict->flags) != 0) { + if ((value = dict_get(dict, name)) != 0) + CHK_DOMAIN_RETURN(check_table_result(state, table, value, domain)); + if (dict_errno != 0) + msg_fatal("%s: table lookup problem", table); + } flags = PARTIAL; } CHK_DOMAIN_RETURN(SMTPD_CHECK_DUNNO); @@ -957,12 +957,12 @@ static int check_addr_access(SMTPD_STATE *state, char *table, char *address, do { if ((dict = dict_handle(table)) == 0) msg_panic("%s: dictionary not found: %s", myname, table); - if (flags != 0 && (flags & dict->flags) == 0) - continue; - if ((value = dict_get(dict, addr)) != 0) - return (check_table_result(state, table, value, address)); - if (dict_errno != 0) - msg_fatal("%s: table lookup problem", table); + if (flags == 0 || (flags & dict->flags) != 0) { + if ((value = dict_get(dict, addr)) != 0) + return (check_table_result(state, table, value, address)); + if (dict_errno != 0) + msg_fatal("%s: table lookup problem", table); + } flags = PARTIAL; } while (split_at_right(addr, '.')); diff --git a/postfix/util/dict_db.c b/postfix/util/dict_db.c index 4603f066d..693397589 100644 --- a/postfix/util/dict_db.c +++ b/postfix/util/dict_db.c @@ -267,6 +267,5 @@ DICT *dict_btree_open(const char *path, int open_flags, int dict_flags) return (dict_db_open(path, open_flags, DB_BTREE, (void *) &tweak, dict_flags)); } -/**INDENT** Error@188: Unmatched #endif */ #endif diff --git a/postfix/util/dict_nis.c b/postfix/util/dict_nis.c index 78d76f52b..36bb99bb3 100644 --- a/postfix/util/dict_nis.c +++ b/postfix/util/dict_nis.c @@ -65,7 +65,6 @@ typedef struct { DICT dict; /* generic members */ char *map; /* NIS map name */ - int flags; /* see below */ } DICT_NIS; /* @@ -154,12 +153,12 @@ static const char *dict_nis_lookup(DICT *dict, const char *key) * See if this NIS map was written with one null byte appended to key and * value. */ - if (dict_nis->flags & DICT_FLAG_TRY1NULL) { + if (dict->flags & DICT_FLAG_TRY1NULL) { err = yp_match(dict_nis_domain, dict_nis->map, (void *) key, strlen(key) + 1, &result, &result_len); if (err == 0) { - dict_nis->flags &= ~DICT_FLAG_TRY0NULL; + dict->flags &= ~DICT_FLAG_TRY0NULL; return (result); } } @@ -168,12 +167,12 @@ static const char *dict_nis_lookup(DICT *dict, const char *key) * See if this NIS map was written with no null byte appended to key and * value. This should never be the case, but better play safe. */ - if (dict_nis->flags & DICT_FLAG_TRY0NULL) { + if (dict->flags & DICT_FLAG_TRY0NULL) { err = yp_match(dict_nis_domain, dict_nis->map, (void *) key, strlen(key), &result, &result_len); if (err == 0) { - dict_nis->flags &= ~DICT_FLAG_TRY1NULL; + dict->flags &= ~DICT_FLAG_TRY1NULL; if (buf == 0) buf = vstring_alloc(10); vstring_strncpy(buf, result, result_len); diff --git a/postfix/util/dict_open.c b/postfix/util/dict_open.c index ff65b7d2e..8d47e8dd9 100644 --- a/postfix/util/dict_open.c +++ b/postfix/util/dict_open.c @@ -49,14 +49,14 @@ /* support duplicate keys. The default is to terminate with a fatal /* error. /* .IP DICT_FLAG_TRY0NULL -/* With maps where this is appropriate, append no null byte to +/* With maps where this is appropriate, append no null byte to /* keys and values. /* When neither DICT_FLAG_TRY0NULL nor DICT_FLAG_TRY1NULL are /* specified, the software guesses what format to use for reading; /* and in the absence of definite information, a system-dependent /* default is chosen for writing. /* .IP DICT_FLAG_TRY1NULL -/* With maps where this is appropriate, append one null byte to +/* With maps where this is appropriate, append one null byte to /* keys and values. /* When neither DICT_FLAG_TRY0NULL nor DICT_FLAG_TRY1NULL are /* specified, the software guesses what format to use for reading; @@ -268,6 +268,7 @@ void dict_open_register(const char *type, #include #include +#include /* Utility library. */ diff --git a/postfix/util/dict_pcre.c b/postfix/util/dict_pcre.c index 6657b03c5..a8d245862 100644 --- a/postfix/util/dict_pcre.c +++ b/postfix/util/dict_pcre.c @@ -144,7 +144,6 @@ static const char *dict_pcre_lookup(DICT *dict, const char *name) int name_len = strlen(name); struct dict_pcre_context ctxt; static VSTRING *buf; - char *at; dict_errno = 0; diff --git a/postfix/util/dict_regexp.c b/postfix/util/dict_regexp.c index 099ac4c10..6cc5696c7 100644 --- a/postfix/util/dict_regexp.c +++ b/postfix/util/dict_regexp.c @@ -136,7 +136,6 @@ static const char *dict_regexp_lookup(DICT *dict, const char *name) DICT_REGEXP_RULE *rule; struct dict_regexp_context ctxt; static VSTRING *buf; - char *at; int error; dict_errno = 0; diff --git a/postfix/util/match_ops.c b/postfix/util/match_ops.c index 039e90eae..564d579c1 100644 --- a/postfix/util/match_ops.c +++ b/postfix/util/match_ops.c @@ -86,7 +86,7 @@ int match_string(const char *string, const char *pattern) */ if (strchr(pattern, ':') != 0) { key = lowercase(mystrdup(string)); - match = (dict_lookup(pattern, string) != 0); + match = (dict_lookup(pattern, key) != 0); myfree(key); if (match != 0) return (1);