]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-19990330
authorWietse Venema <wietse@porcupine.org>
Tue, 30 Mar 1999 05:00:00 +0000 (00:00 -0500)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 03:34:04 +0000 (22:34 -0500)
15 files changed:
postfix/HISTORY
postfix/conf/sample-misc.cf
postfix/conf/sample-smtp.cf
postfix/global/mail_version.h
postfix/local/alias.c
postfix/master/multi_server.c
postfix/postalias/postalias.c
postfix/postmap/postmap.c
postfix/smtpd/smtpd_check.c
postfix/util/dict_db.c
postfix/util/dict_nis.c
postfix/util/dict_open.c
postfix/util/dict_pcre.c
postfix/util/dict_regexp.c
postfix/util/match_ops.c

index bce74a964b1fc8c32c34c172ed5bb0dfaebaca9e..ccc96896be6b9a14875fcd3061b01c4c790f5d91 100644 (file)
@@ -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
index d8b25fdc8abe2a190a04d8002028199e9494a0b7..90dea7c219ee860b29402f6a967d1988f62a12f7 100644 (file)
@@ -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
index 64ac7d7516d7480955c0adfc9d636e18c2b64087..69819ffbbcfa5124579418839ec3e41f33176488 100644 (file)
@@ -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
index e1976f88ea1693bc0b779988704b18298cfedc4a..4ddf7132a7d0b5b98d8877bc648c7c8074bd3059 100644 (file)
@@ -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
index bbbbe9df0b36883ed7313b067833c7bfce076bba..982567babd3546c18442677c4cbaee645a73d2bd 100644 (file)
@@ -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 {
index 5f60c63dbf273037e7d2a84932cc07c1b0d48d92..0e8eb368b3f0c66087fc7859febea6917faadc5a 100644 (file)
@@ -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.
index 4159a63b9ab53c0b2d405a1e0790d954b7a07996..905d497cead75722f46627c013a85e96cae8a7a1 100644 (file)
@@ -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
index fc660d80d4b963f7a52b6f46ea1e349e2a285010..21e88d12e6f3cba817b6a0ff1eb11bff049a04e1 100644 (file)
@@ -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
index 5dc20d6380ac2d6fec9ddf0eaa7393eaeb306ee1..570b15e94e1f7ee539b856ba21fb2df92f05887a 100644 (file)
@@ -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, '.'));
 
index 4603f066dcda41d94fda611e5a8a3f1996c3d8ea..6933975893dbe03bfa74ff1c821476f57f43b6df 100644 (file)
@@ -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
index 78d76f52b80348b485a5c565f516dd7079c8dbc5..36bb99bb34b0caa785187922ea7ee0fc0c451274 100644 (file)
@@ -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);
index ff65b7d2e4f51e07b3b84ba60496e4caddb6a7b4..8d47e8dd95e040417d7c74013b520e60f64d659c 100644 (file)
 /*     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 <stdlib.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 /* Utility library. */
 
index 6657b03c53c5e01f85d3d3fdef054e47911fdcc4..a8d2458625ba002e193fb86abc86ace943f00311 100644 (file)
@@ -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;
 
index 099ac4c1015365b85e85dbef6d7c02eef20e2972..6cc5696c70efe4e66f73ab07dbb871dc80df4ff6 100644 (file)
@@ -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;
index 039e90eaed78d371ef1ef924738f5315e0dfc4e1..564d579c103335dfcdb4c247706b029976b7597c 100644 (file)
@@ -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);