From: Wietse Z Venema Date: Tue, 24 Jun 2025 05:00:00 +0000 (-0500) Subject: postfix-3.11-20250624 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=646ffe205bca7ae89c88e6ef5686706e0ef768f4;p=thirdparty%2Fpostfix.git postfix-3.11-20250624 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 7f07ff36c..f103cac51 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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. diff --git a/postfix/README_FILES/DATABASE_README b/postfix/README_FILES/DATABASE_README index f1629e925..afea25681 100644 --- a/postfix/README_FILES/DATABASE_README +++ b/postfix/README_FILES/DATABASE_README @@ -200,6 +200,15 @@ To find out what database types your Postfix system supports, use the "ppooss 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. + ddeebbuugg + 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. + eennvviirroonn The UNIX process environment array. The lookup key is the variable name. The lookup table name in "environ:table" is ignored. diff --git a/postfix/html/DATABASE_README.html b/postfix/html/DATABASE_README.html index 454fd64ea..6b56ef65b 100644 --- a/postfix/html/DATABASE_README.html +++ b/postfix/html/DATABASE_README.html @@ -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. +
debug
+ +
+

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.

+
+
environ
The UNIX process environment array. The lookup key is the diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index 65d1a198d..67d256e06 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -226,6 +226,16 @@ POSTCONF(1) POSTCONF(1) dbm An indexed file type based on hashing. Available on sys- tems with support for DBM databases. + debug An adapter for another table that causes all accesses to + be logged. The table name syntax is type:name. 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 sen- + sitive information (such as a password), that information + might be logged. + + This feature is available with Postfix 3.11 and later. + environ The UNIX process environment array. The lookup key is the environment variable name; the table name is ignored. diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1 index 41218063f..5b8ca5382 100644 --- a/postfix/man/man1/postconf.1 +++ b/postfix/man/man1/postconf.1 @@ -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 diff --git a/postfix/proto/DATABASE_README.html b/postfix/proto/DATABASE_README.html index 42a54ac7c..4182bb8c8 100644 --- a/postfix/proto/DATABASE_README.html +++ b/postfix/proto/DATABASE_README.html @@ -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.
+
debug
+ +
+

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.

+
+
environ
The UNIX process environment array. The lookup key is the diff --git a/postfix/proto/stop b/postfix/proto/stop index ef6aab0a2..c09b1c34e 100644 --- a/postfix/proto/stop +++ b/postfix/proto/stop @@ -1682,3 +1682,4 @@ Hendrickx typofix LD PRELOAD +rhansen diff --git a/postfix/proto/stop.double-cc b/postfix/proto/stop.double-cc index 0179fe90f..1a39b3249 100644 --- a/postfix/proto/stop.double-cc +++ b/postfix/proto/stop.double-cc @@ -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 diff --git a/postfix/proto/stop.double-history b/postfix/proto/stop.double-history index 12c01a031..2fc207315 100644 --- a/postfix/proto/stop.double-history +++ b/postfix/proto/stop.double-history @@ -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 diff --git a/postfix/src/global/dict_ldap.c b/postfix/src/global/dict_ldap.c index 7310a9661..9236639a1 100644 --- a/postfix/src/global/dict_ldap.c +++ b/postfix/src/global/dict_ldap.c @@ -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 diff --git a/postfix/src/global/dict_mongodb.c b/postfix/src/global/dict_mongodb.c index 18144b719..dcd743136 100644 --- a/postfix/src/global/dict_mongodb.c +++ b/postfix/src/global/dict_mongodb.c @@ -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 diff --git a/postfix/src/global/dict_mysql.c b/postfix/src/global/dict_mysql.c index 6124d6e19..89ec3c1ff 100644 --- a/postfix/src/global/dict_mysql.c +++ b/postfix/src/global/dict_mysql.c @@ -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); } /* diff --git a/postfix/src/global/dict_pgsql.c b/postfix/src/global/dict_pgsql.c index 81a11a167..f5e97321d 100644 --- a/postfix/src/global/dict_pgsql.c +++ b/postfix/src/global/dict_pgsql.c @@ -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 */ diff --git a/postfix/src/global/dict_proxy.c b/postfix/src/global/dict_proxy.c index 5aa915309..0157d01a2 100644 --- a/postfix/src/global/dict_proxy.c +++ b/postfix/src/global/dict_proxy.c @@ -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); diff --git a/postfix/src/global/dict_sqlite.c b/postfix/src/global/dict_sqlite.c index c8881f368..c8d2d5a51 100644 --- a/postfix/src/global/dict_sqlite.c +++ b/postfix/src/global/dict_sqlite.c @@ -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 diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 1e6b617e6..d8c67baf7 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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 diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index 163900bb7..dcb5a78c0 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -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 diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 74f13b2cd..402c96d7f 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -252,6 +252,16 @@ /* .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 diff --git a/postfix/src/postconf/postconf_dbms.c b/postfix/src/postconf/postconf_dbms.c index 105ae85ea..d6fa2a2ee 100644 --- a/postfix/src/postconf/postconf_dbms.c +++ b/postfix/src/postconf/postconf_dbms.c @@ -74,6 +74,7 @@ #include #include +#include #include #include #include @@ -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 index 000000000..0a9ed625d --- /dev/null +++ b/postfix/src/postconf/test77-main.cf @@ -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 index 000000000..c8f7f04a2 --- /dev/null +++ b/postfix/src/postconf/test77.ref @@ -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 diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index c6573320f..ed1df23ed 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -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 diff --git a/postfix/src/util/dict.c b/postfix/src/util/dict.c index 1fe169d2d..5fcf84294 100644 --- a/postfix/src/util/dict.c +++ b/postfix/src/util/dict.c @@ -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 */ diff --git a/postfix/src/util/dict.h b/postfix/src/util/dict.h index a6badac26..780f5c06d 100644 --- a/postfix/src/util/dict.h +++ b/postfix/src/util/dict.h @@ -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 */ diff --git a/postfix/src/util/dict_cdb.c b/postfix/src/util/dict_cdb.c index 885efc289..25b52fbfa 100644 --- a/postfix/src/util/dict_cdb.c +++ b/postfix/src/util/dict_cdb.c @@ -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 */ diff --git a/postfix/src/util/dict_cidr.c b/postfix/src/util/dict_cidr.c index 726d11cd6..bf59ba758 100644 --- a/postfix/src/util/dict_cidr.c +++ b/postfix/src/util/dict_cidr.c @@ -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); } diff --git a/postfix/src/util/dict_db.c b/postfix/src/util/dict_db.c index 0a3a87afb..7ac034641 100644 --- a/postfix/src/util/dict_db.c +++ b/postfix/src/util/dict_db.c @@ -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 */ diff --git a/postfix/src/util/dict_dbm.c b/postfix/src/util/dict_dbm.c index e47b7eedf..0b81134d7 100644 --- a/postfix/src/util/dict_dbm.c +++ b/postfix/src/util/dict_dbm.c @@ -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 diff --git a/postfix/src/util/dict_debug.c b/postfix/src/util/dict_debug.c index 46634d40c..8e2af64fd 100644 --- a/postfix/src/util/dict_debug.c +++ b/postfix/src/util/dict_debug.c @@ -4,23 +4,20 @@ /* SUMMARY /* dictionary manager, logging proxy /* SYNOPSIS -/* #include +/* #include /* -/* 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 @@ -32,17 +29,24 @@ /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA +/* +/* Richard Hansen +/* +/* Wietse Venema +/* porcupine.org /*--*/ /* System libraries. */ #include +#include /* Utility library. */ #include #include #include +#include /* 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 index 000000000..dcd66f0f1 --- /dev/null +++ b/postfix/src/util/dict_debug.h @@ -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 +/* DESCRIPTION +/* .nf + + /* + * Utility library. + */ +#include + + /* + * 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 +/*--*/ + +#endif diff --git a/postfix/src/util/dict_debug_test.ref b/postfix/src/util/dict_debug_test.ref new file mode 100644 index 000000000..71e438f91 --- /dev/null +++ b/postfix/src/util/dict_debug_test.ref @@ -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 index 000000000..a8c051d80 --- /dev/null +++ b/postfix/src/util/dict_debug_test.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -ex +! ${VALGRIND} ./dict_open 'debug:' read fold_buf = vstring_alloc(10); dict->owner.status = DICT_OWNER_TRUSTED; - return (DICT_DEBUG (dict)); + return (dict); } diff --git a/postfix/src/util/dict_fail.c b/postfix/src/util/dict_fail.c index c8d9a195f..5b9744eb7 100644 --- a/postfix/src/util/dict_fail.c +++ b/postfix/src/util/dict_fail.c @@ -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); } diff --git a/postfix/src/util/dict_inline.c b/postfix/src/util/dict_inline.c index d7f934466..ca3c94de2 100644 --- a/postfix/src/util/dict_inline.c +++ b/postfix/src/util/dict_inline.c @@ -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); } diff --git a/postfix/src/util/dict_lmdb.c b/postfix/src/util/dict_lmdb.c index bed20e0c4..88e4a03bf 100644 --- a/postfix/src/util/dict_lmdb.c +++ b/postfix/src/util/dict_lmdb.c @@ -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 diff --git a/postfix/src/util/dict_ni.c b/postfix/src/util/dict_ni.c index 3f625599f..956fb669f 100644 --- a/postfix/src/util/dict_ni.c +++ b/postfix/src/util/dict_ni.c @@ -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 diff --git a/postfix/src/util/dict_nis.c b/postfix/src/util/dict_nis.c index 357011f80..913bf8d92 100644 --- a/postfix/src/util/dict_nis.c +++ b/postfix/src/util/dict_nis.c @@ -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 diff --git a/postfix/src/util/dict_nisplus.c b/postfix/src/util/dict_nisplus.c index 1f5e1266a..e14cdd0c4 100644 --- a/postfix/src/util/dict_nisplus.c +++ b/postfix/src/util/dict_nisplus.c @@ -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 diff --git a/postfix/src/util/dict_open.c b/postfix/src/util/dict_open.c index c3b90d497..bc42c06fc 100644 --- a/postfix/src/util/dict_open.c +++ b/postfix/src/util/dict_open.c @@ -337,6 +337,7 @@ #include #include #include +#include #include #include #include @@ -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, }; diff --git a/postfix/src/util/dict_pcre.c b/postfix/src/util/dict_pcre.c index 20eee02c1..f65f440a6 100644 --- a/postfix/src/util/dict_pcre.c +++ b/postfix/src/util/dict_pcre.c @@ -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 */ diff --git a/postfix/src/util/dict_pipe.c b/postfix/src/util/dict_pipe.c index 9002bd369..7a4b92437 100644 --- a/postfix/src/util/dict_pipe.c +++ b/postfix/src/util/dict_pipe.c @@ -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); } diff --git a/postfix/src/util/dict_random.c b/postfix/src/util/dict_random.c index 36f79b355..6b13f1018 100644 --- a/postfix/src/util/dict_random.c +++ b/postfix/src/util/dict_random.c @@ -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); } diff --git a/postfix/src/util/dict_regexp.c b/postfix/src/util/dict_regexp.c index 661d9393d..e5356c424 100644 --- a/postfix/src/util/dict_regexp.c +++ b/postfix/src/util/dict_regexp.c @@ -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 diff --git a/postfix/src/util/dict_sdbm.c b/postfix/src/util/dict_sdbm.c index 23371dc7c..f6644138e 100644 --- a/postfix/src/util/dict_sdbm.c +++ b/postfix/src/util/dict_sdbm.c @@ -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 diff --git a/postfix/src/util/dict_sockmap.c b/postfix/src/util/dict_sockmap.c index 8c0d4e014..9bd0a9d27 100644 --- a/postfix/src/util/dict_sockmap.c +++ b/postfix/src/util/dict_sockmap.c @@ -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); } diff --git a/postfix/src/util/dict_static.c b/postfix/src/util/dict_static.c index 448dde0c7..46cfce86a 100644 --- a/postfix/src/util/dict_static.c +++ b/postfix/src/util/dict_static.c @@ -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)); } diff --git a/postfix/src/util/dict_surrogate.c b/postfix/src/util/dict_surrogate.c index a23cba358..8d81c7085 100644 --- a/postfix/src/util/dict_surrogate.c +++ b/postfix/src/util/dict_surrogate.c @@ -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); } diff --git a/postfix/src/util/dict_tcp.c b/postfix/src/util/dict_tcp.c index 922f449a4..b98b751bb 100644 --- a/postfix/src/util/dict_tcp.c +++ b/postfix/src/util/dict_tcp.c @@ -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); } diff --git a/postfix/src/util/dict_thash.c b/postfix/src/util/dict_thash.c index bae4a6374..e95a95739 100644 --- a/postfix/src/util/dict_thash.c +++ b/postfix/src/util/dict_thash.c @@ -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); } diff --git a/postfix/src/util/dict_union.c b/postfix/src/util/dict_union.c index cda3fe177..bdb367aa3 100644 --- a/postfix/src/util/dict_union.c +++ b/postfix/src/util/dict_union.c @@ -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); } diff --git a/postfix/src/util/dict_unix.c b/postfix/src/util/dict_unix.c index 463534430..dec8006bf 100644 --- a/postfix/src/util/dict_unix.c +++ b/postfix/src/util/dict_unix.c @@ -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); }