]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.11-20250624
authorWietse Z Venema <wietse@porcupine.org>
Tue, 24 Jun 2025 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Wed, 25 Jun 2025 05:43:18 +0000 (15:43 +1000)
52 files changed:
postfix/HISTORY
postfix/README_FILES/DATABASE_README
postfix/html/DATABASE_README.html
postfix/html/postconf.1.html
postfix/man/man1/postconf.1
postfix/proto/DATABASE_README.html
postfix/proto/stop
postfix/proto/stop.double-cc
postfix/proto/stop.double-history
postfix/src/global/dict_ldap.c
postfix/src/global/dict_mongodb.c
postfix/src/global/dict_mysql.c
postfix/src/global/dict_pgsql.c
postfix/src/global/dict_proxy.c
postfix/src/global/dict_sqlite.c
postfix/src/global/mail_version.h
postfix/src/postconf/Makefile.in
postfix/src/postconf/postconf.c
postfix/src/postconf/postconf_dbms.c
postfix/src/postconf/test77-main.cf [new file with mode: 0644]
postfix/src/postconf/test77.ref [new file with mode: 0644]
postfix/src/util/Makefile.in
postfix/src/util/dict.c
postfix/src/util/dict.h
postfix/src/util/dict_cdb.c
postfix/src/util/dict_cidr.c
postfix/src/util/dict_db.c
postfix/src/util/dict_dbm.c
postfix/src/util/dict_debug.c
postfix/src/util/dict_debug.h [new file with mode: 0644]
postfix/src/util/dict_debug_test.ref [new file with mode: 0644]
postfix/src/util/dict_debug_test.sh [new file with mode: 0644]
postfix/src/util/dict_env.c
postfix/src/util/dict_fail.c
postfix/src/util/dict_inline.c
postfix/src/util/dict_lmdb.c
postfix/src/util/dict_ni.c
postfix/src/util/dict_nis.c
postfix/src/util/dict_nisplus.c
postfix/src/util/dict_open.c
postfix/src/util/dict_pcre.c
postfix/src/util/dict_pipe.c
postfix/src/util/dict_random.c
postfix/src/util/dict_regexp.c
postfix/src/util/dict_sdbm.c
postfix/src/util/dict_sockmap.c
postfix/src/util/dict_static.c
postfix/src/util/dict_surrogate.c
postfix/src/util/dict_tcp.c
postfix/src/util/dict_thash.c
postfix/src/util/dict_union.c
postfix/src/util/dict_unix.c

index 7f07ff36c61138cc06ebb7f3dc6e26a6bdde784f..f103cac513aee38c172312fef3a5afdef3352325 100644 (file)
@@ -29282,3 +29282,30 @@ Apologies for any names omitted.
        levels, because changing the level alone is not sufficient.
        Server-side TLS requires that at least one private key and
        corresponding public-key certificate chain are configured.
+
+20250624
+
+       Feature: a new debug: pseudo lookup table. Specify
+       debug:maptype:mapname to encapsulate a maptype:mapname
+       lookup table and log all access. This builds on existing
+       but unused code to log table access. Richard Hansen
+       (rhansen@rhansen.org). Files: proto/DATABASE_README.html,
+       postconf/Makefile.in, /postconf/postconf.c,
+       postconf/postconf_dbms.c, postconf/test77-main.cf,
+       postconf/test77.ref, util/Makefile.in, util/dict_debug.c,
+       util/dict_debug.h, util/dict_debug_test.ref,
+       util/dict_debug_test.sh, util/dict_open.c.
+
+       Cleanup: To keep the dict_debug: code clean, Wietse removed
+       support for the DICT_FLAG_DEBUG feature that had not been
+       used for decades. Files: util/dict_debug.c, util/dict.c,
+       util/dict.h, src/global/dict_ldap.c, global/dict_mongodb.c,
+       global/dict_mysql.c, global/dict_pgsql.c, global/dict_proxy.c,
+       global/dict_sqlite.c, util/dict_cdb.c, util/dict_cidr.c,
+       util/dict_db.c, util/dict_dbm.c, util/dict_env.c,
+       util/dict_fail.c, util/dict_inline.c, util/dict_lmdb.c,
+       util/dict_ni.c, util/dict_nis.c, util/dict_nisplus.c,
+       util/dict_pcre.c, util/dict_pipe.c, util/dict_random.c,
+       util/dict_regexp.c, util/dict_sdbm.c, util/dict_sockmap.c,
+       util/dict_static.c, util/dict_surrogate.c, util/dict_tcp.c,
+       util/dict_thash.c, util/dict_union.c, util/dict_unix.c.
index f1629e925910a41ed0bab02126e9fdfa53beae5f..afea256810e334563f7b5612af54ca9f9d46507c 100644 (file)
@@ -200,6 +200,15 @@ To find out what database types your Postfix system supports, use the "p\bpo\bos\bs
         databases are maintained by Postfix daemons. The lookup table name as
         used in "dbm:table" is the database file name without the ".dir" or
         ".pag" suffix.
+    d\bde\beb\bbu\bug\bg
+        An adapter for another table that causes all accesses to be logged.
+        Example usage: "debug:hash:/etc/postfix/example". The formats of the
+        log messages are unspecified and subject to change. Warning: If a query
+        or the underlying table contains sensitive information (such as a
+        password), that information might be logged.
+
+        This feature is available with Postfix 3.11 and later.
+
     e\ben\bnv\bvi\bir\bro\bon\bn
         The UNIX process environment array. The lookup key is the variable
         name. The lookup table name in "environ:table" is ignored.
index 454fd64ea7c5a6a5d608823bf2ad915e7fb42a90..6b56ef65b008b137c2ddd8555e6dae34552aa03f 100644 (file)
@@ -293,6 +293,19 @@ databases are maintained by Postfix daemons. The lookup table name
 as used in "<a href="DATABASE_README.html#types">dbm</a>:table" is the database file name without the ".dir"
 or ".pag" suffix.  </dd>
 
+<dt> <b>debug</b> </dt>
+
+<dd>
+<p> An adapter for another table that causes all accesses to be
+logged.  Example usage: "debug:<a href="DATABASE_README.html#types">hash</a>:/etc/postfix/example".  The
+formats of the log messages are unspecified and subject to change.
+Warning: If a query or the underlying table contains sensitive
+information (such as a password), that information might be
+logged. </p>
+
+<p> This feature is available with Postfix 3.11 and later. </p>
+</dd>
+
 <dt> <b>environ</b> </dt>
 
 <dd> The UNIX process environment array. The lookup key is the
index 65d1a198d4ca3cc11e26b56a6715f68f66b1046d..67d256e06c2b3bc64f80adc277a18cde33b861ac 100644 (file)
@@ -226,6 +226,16 @@ POSTCONF(1)                                                        POSTCONF(1)
               <b>dbm</b>    An indexed file type based on hashing.  Available on sys-
                      tems with support for DBM databases.
 
+              <b>debug</b>  An  adapter for another table that causes all accesses to
+                     be logged.  The table name syntax is <i>type</i><b>:</b><i>name</i>.   Example
+                     usage:  <b>debug:<a href="DATABASE_README.html#types">hash</a>:/etc/postfix/example</b>.   The formats of
+                     the log messages are unspecified and subject  to  change.
+                     Warning: If a query or the underlying table contains sen-
+                     sitive information (such as a password), that information
+                     might be logged.
+
+                     This feature is available with Postfix 3.11 and later.
+
               <b>environ</b>
                      The UNIX process environment array. The lookup key is the
                      environment variable name; the  table  name  is  ignored.
index 41218063fc9c4a4303862dc85ba3414b5618ccdd..5b8ca5382c067231224ea0a5c1b15b0355ef3ed5 100644 (file)
@@ -258,6 +258,16 @@ This feature is available with Postfix 2.2 and later.
 .IP \fBdbm\fR
 An indexed file type based on hashing.  Available on systems
 with support for DBM databases.
+.IP \fBdebug\fR
+An adapter for another table that causes all accesses to be
+logged.  The table name syntax is \fItype\fB:\fIname\fR.
+Example usage: \fBdebug:hash:/etc/postfix/example\fR.  The
+formats of the log messages are unspecified and subject to
+change.  Warning: If a query or the underlying table contains
+sensitive information (such as a password), that information
+might be logged.
+
+This feature is available with Postfix 3.11 and later.
 .IP \fBenviron\fR
 The UNIX process environment array. The lookup key is the
 environment variable name; the table name is ignored.  Originally
index 42a54ac7ca1b2d920cbe5ecc91771dadf2cee9d0..4182bb8c8229d74ba01eebabf4063456c97cbfa9 100644 (file)
@@ -293,6 +293,19 @@ databases are maintained by Postfix daemons. The lookup table name
 as used in "dbm:table" is the database file name without the ".dir"
 or ".pag" suffix.  </dd>
 
+<dt> <b>debug</b> </dt>
+
+<dd>
+<p> An adapter for another table that causes all accesses to be
+logged.  Example usage: "debug:hash:/etc/postfix/example".  The
+formats of the log messages are unspecified and subject to change.
+Warning: If a query or the underlying table contains sensitive
+information (such as a password), that information might be
+logged. </p>
+
+<p> This feature is available with Postfix 3.11 and later. </p>
+</dd>
+
 <dt> <b>environ</b> </dt>
 
 <dd> The UNIX process environment array. The lookup key is the
index ef6aab0a2e443a9526f8fc9acb5857df3864f3a7..c09b1c34eecfeef71ab381c59e80965f3a390720 100644 (file)
@@ -1682,3 +1682,4 @@ Hendrickx
 typofix
 LD
 PRELOAD
+rhansen
index 0179fe90fc3a4594dc479a88db2249100c39ec91..1a39b324948286f33fc40e260b4888f4e30958cf 100644 (file)
@@ -344,3 +344,4 @@ ignored  ignored
 USE_TLSRPT  USE_TLSRPT 
 encoded  encoded text can contain only alpha digit 
 ossl_digest_new  ossl_digest_new returns NULL after error ossl_digest_data 
+ Richard Hansen rhansen rhansen org 
index 12c01a031355bb8c790ffc6139056c09a65e3b2f..2fc207315ccf713252df27cc3ad070f35e0d6271 100644 (file)
@@ -175,3 +175,5 @@ proto  proto socketmap_table
  Files smtp smtp h 
 proto  proto COMPATIBILITY_README html 
  smtp smtp c tlsproxy tlsproxy c proto postconf proto 
+ rhansen rhansen org Files proto DATABASE_README html 
+ postconf Makefile in postconf postconf c 
index 7310a96618f94ed5641309b257e5ffe306120b12..9236639a1deff9e295e0656fa53d25d37a55018d 100644 (file)
@@ -1876,7 +1876,7 @@ DICT   *dict_ldap_open(const char *ldapsource, int open_flags, int dict_flags)
      * Return the new dict_ldap structure.
      */
     dict_ldap->dict.owner = cfg_get_owner(dict_ldap->parser);
-    return (DICT_DEBUG (&dict_ldap->dict));
+    return (&dict_ldap->dict);
 }
 
 #endif
index 18144b7198f4d02b2baac78e1bf8e91ea53dd43f..dcd743136529d3fa92c51894a34b10b4a2e0d112 100644 (file)
@@ -564,7 +564,7 @@ DICT   *dict_mongodb_open(const char *name, int open_flags, int dict_flags)
 
     mongoc_uri_destroy(uri);
     mongoc_client_set_error_api(dict_mongodb->client, MONGOC_ERROR_API_VERSION_2);
-    return (DICT_DEBUG (&dict_mongodb->dict));
+    return (&dict_mongodb->dict);
 }
 
 #endif
index 6124d6e1961b08c41750873a4bee6249d0ce7955..89ec3c1ff086c16eadd80a1b4de3916b5e94cf39 100644 (file)
@@ -759,7 +759,7 @@ static void mysql_parse_config(DICT_MYSQL *dict_mysql, const char *mysqlcf)
     }
     /* Don't blacklist the load balancer! */
     if (dict_mysql->hosts->argc == 1)
-        argv_add(dict_mysql->hosts, dict_mysql->hosts->argv[0], (char *) 0);
+       argv_add(dict_mysql->hosts, dict_mysql->hosts->argv[0], (char *) 0);
     myfree(hosts);
 }
 
@@ -797,7 +797,7 @@ DICT   *dict_mysql_open(const char *name, int open_flags, int dict_flags)
     if (dict_mysql->pldb == NULL)
        msg_fatal("couldn't initialize pldb!\n");
     dict_mysql->dict.owner = cfg_get_owner(dict_mysql->parser);
-    return (DICT_DEBUG (&dict_mysql->dict));
+    return (&dict_mysql->dict);
 }
 
 /*
index 81a11a167b2c1c3a0e66e58aeec1c7fd75bc3e44..f5e97321d9f14e5cde60223d1d55f4657d26b031 100644 (file)
@@ -744,7 +744,7 @@ DICT   *dict_pgsql_open(const char *name, int open_flags, int dict_flags)
        return (ret);
     }
     dict_pgsql->dict.owner = cfg_get_owner(dict_pgsql->parser);
-    return (DICT_DEBUG (&dict_pgsql->dict));
+    return (&dict_pgsql->dict);
 }
 
 /* plpgsql_init - initialize a PGSQL database */
index 5aa915309049cc100f18b364cfd2062a2ead6625..0157d01a2ba48dd2beb329ce51a34b1112eec90e 100644 (file)
@@ -520,7 +520,7 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
            case PROXY_STAT_OK:
                dict_proxy->dict.flags = (dict_flags & ~DICT_FLAG_IMPL_MASK)
                    | (server_flags & DICT_FLAG_IMPL_MASK);
-               return (DICT_DEBUG (&dict_proxy->dict));
+               return (&dict_proxy->dict);
            default:
                msg_warn("%s open failed for table \"%s\": unexpected status %d",
                         dict_proxy->service, dict_proxy->dict.name, status);
index c8881f368124961ca8bc87121150663119807a09..c8d2d5a5105ec53f1b3b59c8025d90d0ca6b1e6d 100644 (file)
@@ -377,7 +377,7 @@ DICT   *dict_sqlite_open(const char *name, int open_flags, int dict_flags)
     }
     dict_sqlite->dict.owner = cfg_get_owner(dict_sqlite->parser);
 
-    return (DICT_DEBUG (&dict_sqlite->dict));
+    return (&dict_sqlite->dict);
 }
 
 #endif
index 1e6b617e623a2fbdafa3d17eb68bb23ed2f8a038..d8c67baf7ae3f855edcdbf78c90f1a3dd0ab648b 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      "20250623"
+#define MAIL_RELEASE_DATE      "20250624"
 #define MAIL_VERSION_NUMBER    "3.11"
 
 #ifdef SNAPSHOT
index 163900bb7e4a8c2e4a39d280a2aa48fd137198a9..dcb5a78c05036b97e54a194c8d62b93aa8bea60c 100644 (file)
@@ -1065,6 +1065,15 @@ test76:  $(PROG) test76.ref
        diff /dev/null test76.tmp
        rm -f main.cf master.cf test76.tmp
 
+test77: $(PROG) test77-main.cf test77.ref
+       rm -f main.cf master.cf
+       cp test77-main.cf main.cf
+       touch master.cf
+       touch -t 197701010000 main.cf
+       $(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test77.tmp 2>&1
+       diff test77.ref test77.tmp
+       rm -f main.cf master.cf test77.tmp
+
 # Warn about unused, deprecated, or deleted parameters.
 test78:        $(PROG) test78.ref
        rm -f main.cf master.cf
@@ -1175,6 +1184,7 @@ postconf_builtin.o: time_vars.h
 postconf_dbms.o: ../../include/argv.h
 postconf_dbms.o: ../../include/check_arg.h
 postconf_dbms.o: ../../include/dict.h
+postconf_dbms.o: ../../include/dict_debug.h
 postconf_dbms.o: ../../include/dict_ht.h
 postconf_dbms.o: ../../include/dict_ldap.h
 postconf_dbms.o: ../../include/dict_memcache.h
index 74f13b2cd20c373b6f32bfba1cd45b71f4ee6527..402c96d7f291ceb64c0589cee145fa9687275e41 100644 (file)
 /* .IP \fBdbm\fR
 /*     An indexed file type based on hashing.  Available on systems
 /*     with support for DBM databases.
+/* .IP \fBdebug\fR
+/*     An adapter for another table that causes all accesses to be
+/*     logged.  The table name syntax is \fItype\fB:\fIname\fR.
+/*     Example usage: \fBdebug:hash:/etc/postfix/example\fR.  The
+/*     formats of the log messages are unspecified and subject to
+/*     change.  Warning: If a query or the underlying table contains
+/*     sensitive information (such as a password), that information
+/*     might be logged.
+/*
+/*     This feature is available with Postfix 3.11 and later.
 /* .IP \fBenviron\fR
 /*     The UNIX process environment array. The lookup key is the
 /*     environment variable name; the table name is ignored.  Originally
index 105ae85eaa014e800f1726d79c5773a557cd9da2..d6fa2a2ee90a6017fc9e3e929caedba0100390ed 100644 (file)
@@ -74,6 +74,7 @@
 
 #include <mail_conf.h>
 #include <mail_params.h>
+#include <dict_debug.h>
 #include <dict_ht.h>
 #include <dict_proxy.h>
 #include <dict_ldap.h>
@@ -280,11 +281,12 @@ static void pcf_register_dbms_helper(int mode, char *str_value,
        }
 
        /*
-        * Skip over "proxy:" maptypes, to emulate the proxymap(8) server's
-        * behavior when opening a local database configuration file.
+        * Skip over adapter maptypes "proxy:" and "debug:", to emulate their
+        * behavior when wrapping a local database configuration file.
         */
        while ((prefix = split_at(db_type, ':')) != 0
-              && strcmp(db_type, DICT_TYPE_PROXY) == 0)
+              && (strcmp(db_type, DICT_TYPE_PROXY) == 0 ||
+                  strcmp(db_type, DICT_TYPE_DEBUG) == 0))
            db_type = prefix;
 
        if (prefix == 0)
diff --git a/postfix/src/postconf/test77-main.cf b/postfix/src/postconf/test77-main.cf
new file mode 100644 (file)
index 0000000..0a9ed62
--- /dev/null
@@ -0,0 +1,67 @@
+# Test that debug:$dbtype:$dbname in a parameter value is processed like
+# $dbtype:$dbname.  Specifically, all $dbname_$dbparamsuffix parameters (where
+# $dbparamsuffix is a recognized parameter suffix for $dbtype) should be marked
+# as used if debug:$dbtype:$dbname is in a used parameter.
+#
+# See also: test28, test29
+
+_debug = debug
+
+header_checks =
+ ldap:_baseline
+ debug:ldap:_debug
+ ${_debug}:ldap:_debugvar
+ proxy:debug:ldap:_proxy_debug
+ debug:proxy:ldap:_debug_proxy
+ pipemap:{debug:ldap:_pipemap_debug}
+ debug:pipemap:{ldap:_debug_pipemap}
+ unionmap:{debug:ldap:_unionmap_debug}
+ debug:unionmap:{ldap:_debug_unionmap}
+
+# The following parameters should be considered in-use because *_domain is a
+# recognized parameter suffix for the ldap: table type.
+_baseline_domain = whatever
+_debug_domain = whatever
+_debugvar_domain = whatever
+_debug_proxy_domain = whatever
+_proxy_debug_domain = whatever
+_pipemap_debug_domain = whatever
+_debug_pipemap_domain = whatever
+_unionmap_debug_domain = whatever
+_debug_unionmap_domain = whatever
+
+# These parameters should cause unused warnings because *_foo is not a
+# recognized parameter suffix for the ldap: table type.
+_baseline_foo = whatever
+_debug_foo = whatever
+_debugvar_foo = whatever
+_debug_proxy_foo = whatever
+_proxy_debug_foo = whatever
+_pipemap_debug_foo = whatever
+_debug_pipemap_foo = whatever
+_unionmap_debug_foo = whatever
+_debug_unionmap_foo = whatever
+
+# $_unused_tables is an unused parameter, so none of the tables mentioned in its
+# value should cause any $dbname_$dbparamsuffix parameter to be marked as
+# in-use.
+_unused_tables =
+ ldap:_unused_baseline
+ debug:ldap:_unused_debug
+ ${_debug}:ldap:_unused_debugvar
+ proxy:debug:ldap:_unused_proxy_debug
+ debug:proxy:ldap:_unused_debug_proxy
+ pipemap:{debug:ldap:_unused_pipemap_debug}
+ debug:pipemap:{ldap:_unused_debug_pipemap}
+ unionmap:{debug:ldap:_unused_unionmap_debug}
+ debug:unionmap:{ldap:_unused_debug_unionmap}
+
+_unused_baseline_domain = whatever
+_unused_debug_domain = whatever
+_unused_debugvar_domain = whatever
+_unused_debug_proxy_domain = whatever
+_unused_proxy_debug_domain = whatever
+_unused_pipemap_debug_domain = whatever
+_unused_debug_pipemap_domain = whatever
+_unused_unionmap_debug_domain = whatever
+_unused_debug_unionmap_domain = whatever
diff --git a/postfix/src/postconf/test77.ref b/postfix/src/postconf/test77.ref
new file mode 100644 (file)
index 0000000..c8f7f04
--- /dev/null
@@ -0,0 +1,31 @@
+_baseline_domain = whatever
+_debug = debug
+_debug_domain = whatever
+_debug_pipemap_domain = whatever
+_debug_proxy_domain = whatever
+_debug_unionmap_domain = whatever
+_debugvar_domain = whatever
+_pipemap_debug_domain = whatever
+_proxy_debug_domain = whatever
+_unionmap_debug_domain = whatever
+config_directory = .
+header_checks = ldap:_baseline debug:ldap:_debug ${_debug}:ldap:_debugvar proxy:debug:ldap:_proxy_debug debug:proxy:ldap:_debug_proxy pipemap:{debug:ldap:_pipemap_debug} debug:pipemap:{ldap:_debug_pipemap} unionmap:{debug:ldap:_unionmap_debug} debug:unionmap:{ldap:_debug_unionmap}
+./postconf: warning: ./main.cf: unused parameter: _unused_debug_pipemap_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_pipemap_debug_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _unionmap_debug_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_unionmap_debug_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_baseline_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _debugvar_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_tables=ldap:_unused_baseline debug:ldap:_unused_debug ${_debug}:ldap:_unused_debugvar proxy:debug:ldap:_unused_proxy_debug debug:proxy:ldap:_unused_debug_proxy pipemap:{debug:ldap:_unused_pipemap_debug} debug:pipemap:{ldap:_unused_debug_pipemap} unionmap:{debug:ldap:_unused_unionmap_debug} debug:unionmap:{ldap:_unused_debug_unionmap}
+./postconf: warning: ./main.cf: unused parameter: _debug_pipemap_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _debug_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _pipemap_debug_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_debug_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_proxy_debug_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _debug_proxy_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_debugvar_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_debug_unionmap_domain=whatever
+./postconf: warning: ./main.cf: unused parameter: _baseline_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _proxy_debug_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _debug_unionmap_foo=whatever
+./postconf: warning: ./main.cf: unused parameter: _unused_debug_proxy_domain=whatever
index c6573320f6e4b3ade93079243f6ebf65529101b2..ed1df23edf61867275ce17c0cd3eecf9fd28d83e 100644 (file)
@@ -104,7 +104,8 @@ MAP_OBJ     = dict_pcre.o dict_cdb.o dict_lmdb.o dict_sdbm.o slmdb.o \
        mkmap_cdb.o mkmap_lmdb.o mkmap_sdbm.o 
 HDRS   = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \
        chroot_uid.h cidr_match.h clean_env.h connect.h ctable.h dict.h \
-       dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_env.h dict_ht.h \
+       dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_debug.h dict_env.h \
+       dict_ht.h \
        dict_lmdb.h dict_ni.h dict_nis.h dict_nisplus.h dict_pcre.h dict_regexp.h \
        dict_sdbm.h dict_static.h dict_tcp.h dict_unix.h dir_forest.h \
        events.h exec_command.h find_inet.h fsspace.h fullname.h \
@@ -667,7 +668,7 @@ dict_tests: all dict_test \
        dict_regexp_file_test dict_cidr_file_test \
        dict_static_file_test dict_random_test dict_random_file_test \
        dict_inline_file_test dict_stream_test dict_inline_regexp_test \
-       dict_inline_cidr_test
+       dict_inline_cidr_test dict_debug_test
 
 dict_pcre_tests: dict_pcre_test miss_endif_pcre_test dict_pcre_file_test \
        dict_inline_pcre_test
@@ -1112,6 +1113,11 @@ dict_inline_cidr_test: dict_open dict_inline_cidr.ref
        diff dict_inline_cidr.ref dict_inline_cidr.tmp
        rm -f dict_inline_cidr.tmp
 
+dict_debug_test: dict_open dict_debug_test.sh dict_debug_test.ref
+       $(SHLIB_ENV) ./dict_debug_test.sh >dict_debug_test.tmp 2>&1
+       diff dict_debug_test.ref dict_debug_test.tmp
+       rm -f dict_debug_test.tmp
+
 find_inet_test: find_inet find_inet.ref
        $(SHLIB_ENV) ${VALGRIND} ./find_inet >find_inet.tmp 2>&1
        diff find_inet.ref find_inet.tmp
@@ -1550,6 +1556,7 @@ dict_debug.o: argv.h
 dict_debug.o: check_arg.h
 dict_debug.o: dict.h
 dict_debug.o: dict_debug.c
+dict_debug.o: dict_debug.h
 dict_debug.o: msg.h
 dict_debug.o: myflock.h
 dict_debug.o: mymalloc.h
@@ -1677,6 +1684,7 @@ dict_open.o: dict_cdb.h
 dict_open.o: dict_cidr.h
 dict_open.o: dict_db.h
 dict_open.o: dict_dbm.h
+dict_open.o: dict_debug.h
 dict_open.o: dict_env.h
 dict_open.o: dict_fail.h
 dict_open.o: dict_ht.h
index 1fe169d2dd050def24b4fa6c05431291597314d1..5fcf8429403cbe34fe2915034953dadb1fec7f38 100644 (file)
@@ -646,7 +646,7 @@ static const NAME_MASK dict_mask[] = {
     "lock", DICT_FLAG_LOCK,            /* lock before access */
     "replace", DICT_FLAG_DUP_REPLACE,  /* if file, replace dups */
     "sync_update", DICT_FLAG_SYNC_UPDATE,      /* if file, sync updates */
-    "debug", DICT_FLAG_DEBUG,          /* log access */
+    /*"debug", DICT_FLAG_DEBUG,                /* log access */
     "no_regsub", DICT_FLAG_NO_REGSUB,  /* disallow regexp substitution */
     "no_proxy", DICT_FLAG_NO_PROXY,    /* disallow proxy mapping */
     "no_unauth", DICT_FLAG_NO_UNAUTH,  /* disallow unauthenticated data */
index a6badac26dc9e15692b079ce5e5233a5f9f89cea..780f5c06ddd29605a4908a0bebfb914c51a0ef54 100644 (file)
@@ -102,10 +102,6 @@ typedef struct DICT {
 extern DICT *dict_alloc(const char *, const char *, ssize_t);
 extern void dict_free(DICT *);
 
-extern DICT *dict_debug(DICT *);
-
-#define DICT_DEBUG(d) ((d)->flags & DICT_FLAG_DEBUG ? dict_debug(d) : (d))
-
  /*
   * See dict_open.c embedded manpage for flag definitions.
   */
@@ -119,7 +115,7 @@ extern DICT *dict_debug(DICT *);
 #define DICT_FLAG_LOCK         (1<<6)  /* use temp lock before access */
 #define DICT_FLAG_DUP_REPLACE  (1<<7)  /* replace dups if supported */
 #define DICT_FLAG_SYNC_UPDATE  (1<<8)  /* sync updates if supported */
-#define DICT_FLAG_DEBUG                (1<<9)  /* log access */
+/*#define DICT_FLAG_DEBUG      (1<<9)  /* log access */
 /*#define DICT_FLAG_FOLD_KEY   (1<<10) /* lowercase the lookup key */
 #define DICT_FLAG_NO_REGSUB    (1<<11) /* disallow regexp substitution */
 #define DICT_FLAG_NO_PROXY     (1<<12) /* disallow proxy mapping */
index 885efc289df79bbb9e1b33168f5f8aecff848811..25b52fbfad309e6fada7e792293ecfc1f96714cd 100644 (file)
@@ -297,7 +297,7 @@ static DICT *dict_cdbq_open(const char *path, int dict_flags)
     if (dict_flags & DICT_FLAG_FOLD_FIX)
        dict_cdbq->dict.fold_buf = vstring_alloc(10);
 
-    DICT_CDBQ_OPEN_RETURN(DICT_DEBUG (&dict_cdbq->dict));
+    DICT_CDBQ_OPEN_RETURN(&dict_cdbq->dict);
 }
 
 /* dict_cdbm_update - add database entry, create mode */
@@ -486,7 +486,7 @@ static DICT *dict_cdbm_open(const char *path, int dict_flags)
     if (dict_flags & DICT_FLAG_FOLD_FIX)
        dict_cdbm->dict.fold_buf = vstring_alloc(10);
 
-    DICT_CDBM_OPEN_RETURN(DICT_DEBUG (&dict_cdbm->dict));
+    DICT_CDBM_OPEN_RETURN(&dict_cdbm->dict);
 }
 
 /* dict_cdb_open - open data base for query mode or create mode */
@@ -494,7 +494,7 @@ static DICT *dict_cdbm_open(const char *path, int dict_flags)
 DICT   *dict_cdb_open(const char *path, int open_flags, int dict_flags)
 {
     switch (open_flags & (O_RDONLY | O_RDWR | O_WRONLY | O_CREAT | O_TRUNC)) {
-    case O_RDONLY:                             /* query mode */
+       case O_RDONLY:                  /* query mode */
        return dict_cdbq_open(path, dict_flags);
     case O_WRONLY | O_CREAT | O_TRUNC:         /* create mode */
     case O_RDWR | O_CREAT | O_TRUNC:           /* sloppiness */
index 726d11cd6fb4117532d0d8a798f13a60310e307a..bf59ba758f12feb29565dc4d928e8b336f1fbca4 100644 (file)
@@ -358,5 +358,5 @@ DICT   *dict_cidr_open(const char *mapname, int open_flags, int dict_flags)
        (void) mvect_free(&mvect);
 
     dict_file_purge_buffers(&dict_cidr->dict);
-    DICT_CIDR_OPEN_RETURN(DICT_DEBUG (&dict_cidr->dict));
+    DICT_CIDR_OPEN_RETURN(&dict_cidr->dict);
 }
index 0a3a87afb6836d291f165886673f4461e470d50a..7ac03464108ead692cf29d1efb4df11e6cdd4af0 100644 (file)
@@ -821,7 +821,7 @@ static DICT *dict_db_open(const char *class, const char *path, int open_flags,
     dict_db->val_buf = 0;
 
     myfree(db_path);
-    return (DICT_DEBUG (&dict_db->dict));
+    return (&dict_db->dict);
 }
 
 /* dict_hash_open - create association with data base */
index e47b7eedff978df23c35ba622343df59d084c2c6..0b81134d7641b127810ae9003f966972a51189bb 100644 (file)
@@ -497,7 +497,7 @@ DICT   *dict_dbm_open(const char *path, int open_flags, int dict_flags)
     dict_dbm->key_buf = 0;
     dict_dbm->val_buf = 0;
 
-    DICT_DBM_OPEN_RETURN(DICT_DEBUG (&dict_dbm->dict));
+    DICT_DBM_OPEN_RETURN(&dict_dbm->dict);
 }
 
 #endif
index 46634d40cd48c04d97cc5e263e948bd8a0edae3f..8e2af64fd8d9d3a0c926c38f4b50c75e7ee495be 100644 (file)
@@ -4,23 +4,20 @@
 /* SUMMARY
 /*     dictionary manager, logging proxy
 /* SYNOPSIS
-/*     #include <dict.h>
+/*     #include <dict_debug.h>
 /*
-/*     DICT    *dict_debug(dict_handle)
-/*     DICT    *dict_handle;
-/*
-/*     DICT    *DICT_DEBUG(dict_handle)
-/*     DICT    *dict_handle;
+/*     DICT    *dict_debug_open(name, open_flags, dict_flags);
+/*     const char *name;
+/*     int     open_flags;
+/*     int     dict_flags;
 /* DESCRIPTION
-/*     dict_debug() encapsulates the given dictionary object and returns
-/*     a proxy object that logs all access to the encapsulated object.
-/*     This is more convenient than having to add logging capability
-/*     to each individual dictionary access method.
+/*     dict_debug_open() encapsulates the named dictionary object and
+/*     returns a proxy object that logs all access to the encapsulated
+/*     object.
 /*
-/*     DICT_DEBUG() is an unsafe macro that returns the original object if
-/*     the object's debugging flag is not set, and that otherwise encapsulates
-/*     the object with dict_debug(). This macro simplifies usage by avoiding
-/*     clumsy expressions. The macro evaluates its argument multiple times.
+/*     If the encapsulated dictionary is not already registered, it is
+/*     opened with a call to dict_open(\fIname\fR, \fIopen_flags\fR,
+/*     \fIdict_flags\fR) before registering it.
 /* DIAGNOSTICS
 /*     Fatal errors: out of memory.
 /* LICENSE
 /*     IBM T.J. Watson Research
 /*     P.O. Box 704
 /*     Yorktown Heights, NY 10598, USA
+/*
+/*     Richard Hansen <rhansen@rhansen.org>
+/*
+/*     Wietse Venema
+/*     porcupine.org
 /*--*/
 
 /* System libraries. */
 
 #include <sys_defs.h>
+#include <string.h>
 
 /* Utility library. */
 
 #include <msg.h>
 #include <mymalloc.h>
 #include <dict.h>
+#include <dict_debug.h>
 
 /* Application-specific. */
 
@@ -62,7 +66,7 @@ static const char *dict_debug_lookup(DICT *dict, const char *key)
     real_dict->flags = dict->flags;
     result = dict_get(real_dict, key);
     dict->flags = real_dict->flags;
-    msg_info("%s:%s lookup: \"%s\" = \"%s\"", dict->type, dict->name, key,
+    msg_info("%s lookup: \"%s\" = \"%s\"", dict->name, key,
             result ? result : real_dict->error ? "error" : "not_found");
     DICT_ERR_VAL_RETURN(dict, real_dict->error, result);
 }
@@ -78,7 +82,7 @@ static int dict_debug_update(DICT *dict, const char *key, const char *value)
     real_dict->flags = dict->flags;
     result = dict_put(real_dict, key, value);
     dict->flags = real_dict->flags;
-    msg_info("%s:%s update: \"%s\" = \"%s\": %s", dict->type, dict->name,
+    msg_info("%s update: \"%s\" = \"%s\": %s", dict->name,
             key, value, result == 0 ? "success" : real_dict->error ?
             "error" : "failed");
     DICT_ERR_VAL_RETURN(dict, real_dict->error, result);
@@ -95,7 +99,7 @@ static int dict_debug_delete(DICT *dict, const char *key)
     real_dict->flags = dict->flags;
     result = dict_del(real_dict, key);
     dict->flags = real_dict->flags;
-    msg_info("%s:%s delete: \"%s\": %s", dict->type, dict->name, key,
+    msg_info("%s delete: \"%s\": %s", dict->name, key,
             result == 0 ? "success" : real_dict->error ?
             "error" : "failed");
     DICT_ERR_VAL_RETURN(dict, real_dict->error, result);
@@ -114,10 +118,9 @@ static int dict_debug_sequence(DICT *dict, int function,
     result = dict_seq(real_dict, function, key, value);
     dict->flags = real_dict->flags;
     if (result == 0)
-       msg_info("%s:%s sequence: \"%s\" = \"%s\"", dict->type, dict->name,
-                *key, *value);
+       msg_info("%s sequence: \"%s\" = \"%s\"", dict->name, *key, *value);
     else
-       msg_info("%s:%s sequence: found EOF", dict->type, dict->name);
+       msg_info("%s sequence: found EOF", dict->name);
     DICT_ERR_VAL_RETURN(dict, real_dict->error, result);
 }
 
@@ -125,20 +128,39 @@ static int dict_debug_sequence(DICT *dict, int function,
 
 static void dict_debug_close(DICT *dict)
 {
-    DICT_DEBUG *dict_debug = (DICT_DEBUG *) dict;
-
-    dict_close(dict_debug->real_dict);
+    /* TODO(wietse) use the annotated name from dict_make_registered_name(). */
+    dict_unregister(dict->name);
     dict_free(dict);
 }
 
-/* dict_debug - encapsulate dictionary object and install proxies */
+/* dict_debug_open - encapsulate dictionary object and install proxies */
 
-DICT   *dict_debug(DICT *real_dict)
+DICT   *dict_debug_open(const char *name, int open_flags, int dict_flags)
 {
-    DICT_DEBUG *dict_debug;
+    static const char myname[] = "dict_debug_open";
+
+    if (msg_verbose)
+       msg_info("%s: %s", myname, name);
+
+    /*
+     * Reuse a previously registered table if present. This prevents a config
+     * containing both debug:foo:bar and foo:bar from creating two DICT
+     * objects for foo:bar.
+     * 
+     * TODO(wietse) use the annotated name from dict_make_registered_name().
+     */
+    DICT   *real_dict = dict_handle(name);
+
+    if (real_dict == 0)
+       real_dict = dict_open(name, open_flags, dict_flags);
+    dict_register(name, real_dict);
+
+    /*
+     * Encapsulate the real dictionary.
+     */
+    DICT_DEBUG *dict_debug = (DICT_DEBUG *) dict_alloc(DICT_TYPE_DEBUG, name,
+                                                      sizeof(*dict_debug));
 
-    dict_debug = (DICT_DEBUG *) dict_alloc(real_dict->type,
-                                     real_dict->name, sizeof(*dict_debug));
     dict_debug->dict.flags = real_dict->flags; /* XXX not synchronized */
     dict_debug->dict.lookup = dict_debug_lookup;
     dict_debug->dict.update = dict_debug_update;
@@ -146,5 +168,6 @@ DICT   *dict_debug(DICT *real_dict)
     dict_debug->dict.sequence = dict_debug_sequence;
     dict_debug->dict.close = dict_debug_close;
     dict_debug->real_dict = real_dict;
+    dict_debug->dict.owner = real_dict->owner;
     return (&dict_debug->dict);
 }
diff --git a/postfix/src/util/dict_debug.h b/postfix/src/util/dict_debug.h
new file mode 100644 (file)
index 0000000..dcd66f0
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _DICT_DEBUG_H_INCLUDED_
+#define _DICT_DEBUG_H_INCLUDED_
+
+/*++
+/* NAME
+/*     dict_debug 3h
+/* SUMMARY
+/*     dictionary manager interface for "debug" tables
+/* SYNOPSIS
+/*     #include <dict_debug.h>
+/* DESCRIPTION
+/* .nf
+
+ /*
+  * Utility library.
+  */
+#include <dict.h>
+
+ /*
+  * External interface.
+  */
+#define DICT_TYPE_DEBUG "debug"
+
+extern DICT *dict_debug_open(const char *, int, int);
+
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Richard Hansen <rhansen@rhansen.org>
+/*--*/
+
+#endif
diff --git a/postfix/src/util/dict_debug_test.ref b/postfix/src/util/dict_debug_test.ref
new file mode 100644 (file)
index 0000000..71e438f
--- /dev/null
@@ -0,0 +1,51 @@
++ ./dict_open debug: read
+./dict_open: fatal: open dictionary: expecting "type:name" form instead of "debug:"
++ ./dict_open debug:missing_colon_and_name read
+./dict_open: fatal: open dictionary: expecting "type:name" form instead of "missing_colon_and_name"
++ ./dict_open 'debug:static:{space in name}' read
+owner=trusted (uid=2147483647)
+> get k
+./dict_open: static:{space in name} lookup: "k" = "space in name"
+k=space in name
++ ./dict_open debug:debug:static:value read
+owner=trusted (uid=2147483647)
+> get k
+./dict_open: static:value lookup: "k" = "value"
+./dict_open: debug:static:value lookup: "k" = "value"
+k=value
++ ./dict_open debug:internal:name write
+owner=trusted (uid=2147483647)
+> get k
+./dict_open: internal:name lookup: "k" = "not_found"
+k: not found
+> put k=v
+./dict_open: internal:name update: "k" = "v": success
+> get k
+./dict_open: internal:name lookup: "k" = "v"
+k=v
+> first
+./dict_open: internal:name sequence: "k" = "v"
+k=v
+> next
+./dict_open: internal:name sequence: found EOF
+not found
+> del k
+./dict_open: internal:name delete: "k": success
+k: deleted
+> get k
+./dict_open: internal:name lookup: "k" = "not_found"
+k: not found
+> del k
+./dict_open: internal:name delete: "k": failed
+k: not found
+> first
+./dict_open: internal:name sequence: found EOF
+not found
++ ./dict_open 'debug:fail:{oh no}' read
+owner=trusted (uid=2147483647)
+> get k
+./dict_open: fail:{oh no} lookup: "k" = "error"
+k: error
+> first
+./dict_open: fail:{oh no} sequence: found EOF
+error
diff --git a/postfix/src/util/dict_debug_test.sh b/postfix/src/util/dict_debug_test.sh
new file mode 100644 (file)
index 0000000..a8c051d
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -ex
+! ${VALGRIND} ./dict_open 'debug:' read </dev/null || exit 1
+! ${VALGRIND} ./dict_open 'debug:missing_colon_and_name' read </dev/null || exit 1
+${VALGRIND} ./dict_open 'debug:static:{space in name}' read <<EOF
+get k
+EOF
+${VALGRIND} ./dict_open 'debug:debug:static:value' read <<EOF
+get k
+EOF
+${VALGRIND} ./dict_open 'debug:internal:name' write <<EOF
+get k
+put k=v
+get k
+first
+next
+del k
+get k
+del k
+first
+EOF
+${VALGRIND} ./dict_open 'debug:fail:{oh no}' read <<EOF
+get k
+first
+EOF
index 1635b8d8263d31be4c4d7ccd9a9d1602e68c6f79..05bdeea53fd41f54bea79c09c6949d4634dca9c9 100644 (file)
@@ -108,5 +108,5 @@ DICT   *dict_env_open(const char *name, int unused_flags, int dict_flags)
     if (dict_flags & DICT_FLAG_FOLD_FIX)
        dict->fold_buf = vstring_alloc(10);
     dict->owner.status = DICT_OWNER_TRUSTED;
-    return (DICT_DEBUG (dict));
+    return (dict);
 }
index c8d9a195fd9cb624b95f2cf6fb0ca482d8fe78b3..5b9744eb7e36e79fb3f8c0be91bd4af8fa013414 100644 (file)
@@ -111,5 +111,5 @@ DICT   *dict_fail_open(const char *name, int open_flags, int dict_flags)
     dp->dict.flags = dict_flags | DICT_FLAG_PATTERN;
     dp->dict_errno = DICT_ERR_RETRY;
     dp->dict.owner.status = DICT_OWNER_TRUSTED;
-    return (DICT_DEBUG (&dp->dict));
+    return (&dp->dict);
 }
index d7f934466e05ed825d4be34a5b7f176d74cf2fe8..ca3c94de282fd76c176f69bb42ff1c30ff011f4f 100644 (file)
@@ -146,5 +146,5 @@ DICT   *dict_inline_open(const char *name, int open_flags, int dict_flags)
     dict->owner.status = DICT_OWNER_TRUSTED;
 
     dict_file_purge_buffers(dict);
-    DICT_INLINE_RETURN(DICT_DEBUG (dict));
+    DICT_INLINE_RETURN(dict);
 }
index bed20e0c450c1571b4fd33a6d389ffb753774fc8..88e4a03bf49ca321161fb0461398ecfd25129d4f 100644 (file)
@@ -700,7 +700,7 @@ DICT   *dict_lmdb_open(const char *path, int open_flags, int dict_flags)
        dict_lmdb_notify((void *) dict_lmdb, MDB_SUCCESS,
                         slmdb_curr_limit(&dict_lmdb->slmdb));
 
-    DICT_LMDB_OPEN_RETURN(DICT_DEBUG (&dict_lmdb->dict));
+    DICT_LMDB_OPEN_RETURN(&dict_lmdb->dict);
 }
 
 #endif
index 3f625599f4059d93e49fd3b3fd86d818c212f30a..956fb669f74fa1b5763b715eb2260394de613ad3 100644 (file)
@@ -188,7 +188,7 @@ DICT   *dict_ni_open(const char *path, int unused_flags, int dict_flags)
        d->dict.fold_buf = vstring_alloc(10);
     d->dict.owner.status = DICT_OWNER_TRUSTED;
 
-    return (DICT_DEBUG (&d->dict));
+    return (&d->dict);
 }
 
 #endif
index 357011f80cfe6e6ef47aa2d85a63678436563da1..913bf8d923092e0c16215d894636f86b4ebae1c6 100644 (file)
@@ -241,7 +241,7 @@ DICT   *dict_nis_open(const char *map, int open_flags, int dict_flags)
     if (dict_nis_domain == 0)
        dict_nis_init();
     dict_nis->dict.owner.status = DICT_OWNER_TRUSTED;
-    return (DICT_DEBUG (&dict_nis->dict));
+    return (&dict_nis->dict);
 }
 
 #endif
index 1f5e1266aa446cbf924932da1be696965ca954cd..e14cdd0c48b3eb23b0c896a8ded23a507edc8a17 100644 (file)
@@ -298,7 +298,7 @@ DICT   *dict_nisplus_open(const char *map, int open_flags, int dict_flags)
     if (msg_verbose)
        msg_info("%s: opened NIS+ table %s for column %d",
                 myname, dict_nisplus->template, dict_nisplus->column);
-    return (DICT_DEBUG (&dict_nisplus->dict));
+    return (&dict_nisplus->dict);
 }
 
 #endif
index c3b90d497f9e8fe1e14b1d0174b4ee2b2e557778..bc42c06fc0de1fee40d47e7ba9807060ed3d9e0e 100644 (file)
 #include <msg.h>
 #include <dict.h>
 #include <dict_cdb.h>
+#include <dict_debug.h>
 #include <dict_env.h>
 #include <dict_unix.h>
 #include <dict_tcp.h>
@@ -415,6 +416,7 @@ static const DICT_OPEN_INFO dict_open_info[] = {
     DICT_TYPE_LMDB, dict_lmdb_open, mkmap_lmdb_open,
 #endif
 #endif                                 /* !USE_DYNAMIC_MAPS */
+    DICT_TYPE_DEBUG, dict_debug_open, 0,
     0,
 };
 
index 20eee02c112c85c08f42ab9d015fbc956e3010ff..f65f440a65f9a734148b6e4c1cbaecef2a3c14fa 100644 (file)
@@ -1115,7 +1115,7 @@ DICT   *dict_pcre_open(const char *mapname, int open_flags, int dict_flags)
        (void) mvect_free(&mvect);
 
     dict_file_purge_buffers(&dict_pcre->dict);
-    DICT_PCRE_OPEN_RETURN(DICT_DEBUG (&dict_pcre->dict));
+    DICT_PCRE_OPEN_RETURN(&dict_pcre->dict);
 }
 
 #endif                                 /* HAS_PCRE */
index 9002bd369e9391c08e61866684645b038a0a5f2f..7a4b92437c6f5d269d95166c978564bcda8daa2a 100644 (file)
@@ -200,5 +200,5 @@ DICT   *dict_pipe_open(const char *name, int open_flags, int dict_flags)
     reg_name_buf = 0;
     dict_pipe->map_pipe = argv;
     argv = 0;
-    DICT_PIPE_RETURN(DICT_DEBUG (&dict_pipe->dict));
+    DICT_PIPE_RETURN(&dict_pipe->dict);
 }
index 36f79b355c39b9e48ac92f3fadee54f32a1f69a4..6b13f1018998cb6d4464300180a131db1b53708d 100644 (file)
@@ -175,5 +175,5 @@ DICT   *dict_random_open(const char *name, int open_flags, int dict_flags)
                                          "%s", err));
     }
     dict_file_purge_buffers(&dict_random->dict);
-    DICT_RANDOM_RETURN(DICT_DEBUG (&dict_random->dict));
+    DICT_RANDOM_RETURN(&dict_random->dict);
 }
index 661d9393dc7987771e7a1dba8f5eb1112ff00626..e5356c424926a73f5888d327838b0b367f30d3b1 100644 (file)
@@ -868,7 +868,7 @@ DICT   *dict_regexp_open(const char *mapname, int open_flags, int dict_flags)
            (regmatch_t *) mymalloc(sizeof(regmatch_t) * (max_sub + 1));
 
     dict_file_purge_buffers(&dict_regexp->dict);
-    DICT_REGEXP_OPEN_RETURN(DICT_DEBUG (&dict_regexp->dict));
+    DICT_REGEXP_OPEN_RETURN(&dict_regexp->dict);
 }
 
 #endif
index 23371dc7c72efd46df8d0da70d6eafa981af7e9b..f6644138ee2f535bbae950a7ab357bb8c8bccca1 100644 (file)
@@ -477,7 +477,7 @@ DICT   *dict_sdbm_open(const char *path, int open_flags, int dict_flags)
     if ((dict_flags & DICT_FLAG_LOCK))
        myfree(dbm_path);
 
-    return (DICT_DEBUG (&dict_sdbm->dict));
+    return (&dict_sdbm->dict);
 }
 
 #endif
index 8c0d4e01453998b56e5c07d71d758dbcd57a05b6..9bd0a9d27b6f624b5bab18028b1509f551c5792d 100644 (file)
@@ -380,5 +380,5 @@ DICT   *dict_sockmap_open(const char *mapname, int open_flags, int dict_flags)
     /* Don't look up parent domains or network superblocks. */
     dp->dict.flags = dict_flags | DICT_FLAG_PATTERN;
 
-    DICT_SOCKMAP_OPEN_RETURN(DICT_DEBUG (&dp->dict));
+    DICT_SOCKMAP_OPEN_RETURN(&dp->dict);
 }
index 448dde0c75776f417e122cca3f47920bd02d35d4..46cfce86a7e6bddd124249bf83ecf864068c0fd3 100644 (file)
@@ -147,5 +147,5 @@ DICT   *dict_static_open(const char *name, int open_flags, int dict_flags)
     dict_static->value = mystrdup(value);
     dict_file_purge_buffers(&dict_static->dict);
 
-    DICT_STATIC_OPEN_RETURN(DICT_DEBUG (&(dict_static->dict)));
+    DICT_STATIC_OPEN_RETURN(&(dict_static->dict));
 }
index a23cba3589326fafefbc089122dff65ff9a8613e..8d81c7085e84f93a7be668993b37de583db8cfa3 100644 (file)
@@ -176,5 +176,5 @@ DICT   *dict_surrogate(const char *dict_type, const char *dict_name,
     vstring_vsprintf(buf, fmt, ap2);
     va_end(ap2);
     dp->reason = vstring_export(buf);
-    return (DICT_DEBUG (&dp->dict));
+    return (&dp->dict);
 }
index 922f449a4d9110dd03c5b73a316291cd1ae1d54c..b98b751bb472593d4b84bce7826d6c266aa1890c 100644 (file)
@@ -311,5 +311,5 @@ DICT   *dict_tcp_open(const char *map, int open_flags, int dict_flags)
     if (dict_flags & DICT_FLAG_FOLD_MUL)
        dict_tcp->dict.fold_buf = vstring_alloc(10);
 
-    return (DICT_DEBUG (&dict_tcp->dict));
+    return (&dict_tcp->dict);
 }
index bae4a63746f53aed09337eedde8eab0b57cf7711..e95a95739fcf1a432f7c88bfdd62f72c52f6dcc4 100644 (file)
@@ -251,5 +251,5 @@ DICT   *dict_thash_open(const char *path, int open_flags, int dict_flags)
     dict->owner.uid = st.st_uid;
     dict->owner.status = (st.st_uid != 0);
 
-    DICT_THASH_OPEN_RETURN(DICT_DEBUG (dict));
+    DICT_THASH_OPEN_RETURN(dict);
 }
index cda3fe1773166ea3147f973cd03b6972b43136ae..bdb367aa35555d8bb8636d2bf4446060a652b900 100644 (file)
@@ -213,5 +213,5 @@ DICT   *dict_union_open(const char *name, int open_flags, int dict_flags)
     reg_name_buf = 0;
     dict_union->map_union = argv;
     argv = 0;
-    DICT_UNION_RETURN(DICT_DEBUG (&dict_union->dict));
+    DICT_UNION_RETURN(&dict_union->dict);
 }
index 4635344300dfc75abf7466805c9bc88165582e31..dec8006bfd9623be1bdc09f4b2f95b31f65a4d51 100644 (file)
@@ -200,5 +200,5 @@ DICT   *dict_unix_open(const char *map, int open_flags, int dict_flags)
        dict_unix->dict.fold_buf = vstring_alloc(10);
     dict_unix->dict.owner.status = DICT_OWNER_TRUSTED;
 
-    return (DICT_DEBUG (&dict_unix->dict));
+    return (&dict_unix->dict);
 }