]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.8-20220416
authorWietse Venema <wietse@porcupine.org>
Sat, 16 Apr 2022 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Mon, 18 Apr 2022 19:15:40 +0000 (15:15 -0400)
postfix/HISTORY
postfix/src/global/dynamicmaps.c
postfix/src/global/mail_version.h
postfix/src/global/mkmap_open.c

index 5dfd81eda6aa582a0db9e02d4856e01b0c5a10ca..7445e5e9f34f50cf9f3eb28fac7801093261b4a7 100644 (file)
@@ -26338,7 +26338,7 @@ Apologies for any names omitted.
 20220403
 
        (Rolled back because there was too much collateral damage)
-       Cleanup: milter_hader_checks maps are now opened before the
+       Cleanup: milter_header_checks maps are now opened before the
        cleanup server enters the chroot jail. Files: cleanup/cleanup.h,
        cleanup/cleanup_init.c, cleanup/cleanup_milter.c,
        global/header_body_checks.c, global/header_body_checks.h,
@@ -26363,10 +26363,10 @@ Apologies for any names omitted.
        The text was based on an early Postfix implementation.
        File: proto/postconf.proto.
 
-       Cleanup: milter_hader_checks maps are now opened before the
-       cleanup server enters the chroot jail. Files: cleanup/cleanup.h,
-       cleanup/cleanup_init.c, cleanup/cleanup_milter.c,
-       cleanup/cleanup_state.c.
+       Cleanup (problem introduced: Postfix 2.7): milter_header_checks
+       maps are now opened before the cleanup server enters the
+       chroot jail. Files: cleanup/cleanup.h, cleanup/cleanup_init.c,
+       cleanup/cleanup_milter.c, cleanup/cleanup_state.c.
 
 20220407
 
@@ -26378,9 +26378,10 @@ Apologies for any names omitted.
 
 20220415
 
-       Cleanup: with dynamic map loading enabled, an attempt to
-       create a map with "postmap regexp:path" would result in a
-       bogus error message "Is the postfix-regexp package installed?"
-       instead of "unsupported map type for this operation".
-       Implemented a workaround for all map types including regexp
-       that have no 'bulk create' support. File: global mkmap_open.c.
+       Cleanup (problem introduced: Postfix 3.0): with dynamic map
+       loading enabled, an attempt to create a map with "postmap
+       regexp:path" would result in a bogus error message "Is the
+       postfix-regexp package installed?" instead of "unsupported
+       map type for this operation". This happened with all built-in
+       map types (static, cidr, etc.) that have no 'bulk create'
+       support. File: global/dynamicmaps.c.
index 55d622aa2c731eca22c43836e15910bc99e42111..f0213d39d8dbd4bbdf664829db0b4ae541970032 100644 (file)
@@ -168,11 +168,23 @@ static MKMAP_OPEN_FN dymap_mkmap_lookup(const char *dict_type)
      * All errors are fatal. If the postmap(1) or postalias(1) command can't
      * create the requested database, then graceful degradation is not
      * useful.
+     * 
+     * Fix 20220416: if this dictionary type is registered for some non-mkmap
+     * purpose, then don't talk nonsense about a missing package.
      */
-    if ((dp = (DYMAP_INFO *) htable_find(dymap_info, dict_type)) == 0)
+    if ((dp = (DYMAP_INFO *) htable_find(dymap_info, dict_type)) == 0) {
+       ARGV   *types = dict_mapnames();
+       char  **cpp;
+
+       for (cpp = types->argv; *cpp; cpp++) {
+           if (strcmp(dict_type, *cpp) == 0)
+               msg_fatal("unsupported dictionary type: %s does not support "
+                         "bulk-mode creation.", dict_type);
+       }
        msg_fatal("unsupported dictionary type: %s. "
                  "Is the postfix-%s package installed?",
                  dict_type, dict_type);
+    }
     if (!dp->mkmap_name)
        msg_fatal("unsupported dictionary type: %s does not support "
                  "bulk-mode creation.", dict_type);
index 73534c62a625ae0492107bf32ecf1e5ad5c00d6d..265c540378616e5195707cb21e90dec07a88886a 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20220415"
+#define MAIL_RELEASE_DATE      "20220416"
 #define MAIL_VERSION_NUMBER    "3.8"
 
 #ifdef SNAPSHOT
index 1fd566015f8c28ca3c21035c569fd63a50a45625..9d15eec30a27f0557c590458e1cddc165ad45e01 100644 (file)
 #include <mymalloc.h>
 #include <stringops.h>
 
- /*
-  * Workaround for map types that have no 'bulk create' support, for example
-  * regexp. When dynamic map loading is enabled, an attempt to create a map
-  * with "postmap regexp:/path" would result in a bogus error message with
-  * "Is the postfix-regexp package installed?" instead of the expected
-  * "unsupported map type for this operation: regexp". The workaround is to
-  * provide explicit definitions for mkmap_open() so that it knows what map
-  * types exist without a 'bulk create' open function.
-  * 
-  * The solution is to merge the {maptype, function} tables that are currently
-  * managed separately by mkmap_open() (for bulk-mode map create operations)
-  * and by dict_open() (for all other operations). That change would be too
-  * invasive for a stable release.
-  */
-#ifdef USE_DYNAMIC_MAPS
-#include <dict_env.h>
-#include <dict_ht.h>
-#include <dict_unix.h>
-#include <dict_tcp.h>
-#include <dict_nis.h>
-#include <dict_nisplus.h>
-#include <dict_ni.h>
-#include <dict_regexp.h>
-#include <dict_static.h>
-#include <dict_cidr.h>
-#include <dict_thash.h>
-#include <dict_sockmap.h>
-#include <dict_pipe.h>
-#include <dict_random.h>
-#include <dict_union.h>
-#include <dict_inline.h>
-#endif
-
 /* Global library. */
 
 #include "mkmap.h"
@@ -170,32 +137,6 @@ static const MKMAP_OPEN_INFO mkmap_open_info[] = {
     DICT_TYPE_BTREE, mkmap_btree_open,
 #endif
     DICT_TYPE_FAIL, mkmap_fail_open,
-#ifdef USE_DYNAMIC_MAPS                        /* Begin workaround */
-    DICT_TYPE_ENVIRON, 0,
-    DICT_TYPE_HT, 0,
-    DICT_TYPE_UNIX, 0,
-    DICT_TYPE_TCP, 0,
-#ifdef HAS_NIS
-    DICT_TYPE_NIS, 0,
-#endif
-#ifdef HAS_NISPLUS
-    DICT_TYPE_NISPLUS, 0,
-#endif
-#ifdef HAS_NETINFO
-    DICT_TYPE_NETINFO, 0,
-#endif
-#ifdef HAS_POSIX_REGEXP
-    DICT_TYPE_REGEXP, 0,
-#endif
-    DICT_TYPE_STATIC, 0,
-    DICT_TYPE_CIDR, 0,
-    DICT_TYPE_THASH, 0,
-    DICT_TYPE_SOCKMAP, 0,
-    DICT_TYPE_PIPE, 0,
-    DICT_TYPE_RANDOM, 0,
-    DICT_TYPE_UNION, 0,
-    DICT_TYPE_INLINE, 0,
-#endif                                 /* End workaround */
     0,
 };
 
@@ -311,10 +252,9 @@ MKMAP  *mkmap_open(const char *type, const char *path,
            mkmap_open_register(type, open_fn);
            mp = (MKMAP_OPEN_INFO *) htable_find(mkmap_open_hash, type);
        }
+       if (mp == 0)
+           msg_fatal("unsupported map type for this operation: %s", type);
     }
-    if (mp == 0 || mp->before_open == 0)
-       msg_fatal("unsupported map type for this operation: %s", type);
-
     if (msg_verbose)
        msg_info("open %s %s", type, path);