From: Wietse Venema Date: Wed, 24 Dec 2014 05:00:00 +0000 (-0500) Subject: postfix-2.12-20141224-nonprod X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F20141214-nonprod;p=thirdparty%2Fpostfix.git postfix-2.12-20141224-nonprod --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 5f7977c21..661bc84ad 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -21094,35 +21094,82 @@ Apologies for any names omitted. format check, making it a noop. Viktor Dukhovni. File: util/sys_defs.h. - Maintainability: argument typechecking for the variadic - attribute-value read/write functions. For full typechecking - compile with -DVARARGS_ATTR_DEBUG. Files: anvil/anvil.c, - bounce/bounce.c, cleanup/cleanup.c, dnsblog/dnsblog.c, - flush/flush.c, global/abounce.c, global/anvil_clnt.c, - global/bounce.c, global/defer.c, global/deliver_pass.c, - global/deliver_request.c, global/dict_proxy.c, global/dsb_scan.c, - global/dsn_print.c, global/flush_clnt.c, - global/mail_command_client.c, global/mail_stream.c, - global/msg_stats_print.c, global/msg_stats_scan.c, - global/post_mail.c, global/rcpt_buf.c, global/rcpt_print.c, - global/resolve_clnt.c, global/rewrite_clnt.c, global/scache_clnt.c, - global/trace.c, global/verify_clnt.c, local/forward.c, - milter/milter.c, milter/milter8.c, milter/milter_macros.c, - oqmgr/qmgr_deliver.c, pickup/pickup.c, postdrop/postdrop.c, - postscreen/postscreen_dnsbl.c, postscreen/postscreen_send.c, - postscreen/postscreen_starttls.c, proxymap/proxymap.c, - qmgr/qmgr_deliver.c, qmqpd/qmqpd.c, scache/scache.c, - smtpd/smtpd.c, smtpd/smtpd_check.c, tls/tls_mgr.c, - tls/tls_proxy_clnt.c, tls/tls_proxy_print.c, tls/tls_proxy_scan.c, - tlsmgr/tlsmgr.c, tlsproxy/tlsproxy.c, trivial-rewrite/resolve.c, - trivial-rewrite/rewrite.c, trivial-rewrite/trivial-rewrite.c, - util/attr.h. + Maintainability: compile-time argument typechecking for + variadic attribute-value read/write functions. Files: + anvil/anvil.c, bounce/bounce.c, cleanup/cleanup.c, + dnsblog/dnsblog.c, flush/flush.c, global/abounce.c, + global/anvil_clnt.c, global/bounce.c, global/defer.c, + global/deliver_pass.c, global/deliver_request.c, + global/dict_proxy.c, global/dsb_scan.c, global/dsn_print.c, + global/flush_clnt.c, global/mail_command_client.c, + global/mail_stream.c, global/msg_stats_print.c, + global/msg_stats_scan.c, global/post_mail.c, global/rcpt_buf.c, + global/rcpt_print.c, global/resolve_clnt.c, global/rewrite_clnt.c, + global/scache_clnt.c, global/trace.c, global/verify_clnt.c, + local/forward.c, milter/milter.c, milter/milter8.c, + milter/milter_macros.c, oqmgr/qmgr_deliver.c, pickup/pickup.c, + postdrop/postdrop.c, postscreen/postscreen_dnsbl.c, + postscreen/postscreen_send.c, postscreen/postscreen_starttls.c, + proxymap/proxymap.c, qmgr/qmgr_deliver.c, qmqpd/qmqpd.c, + scache/scache.c, smtpd/smtpd.c, smtpd/smtpd_check.c, + tls/tls_mgr.c, tls/tls_proxy_clnt.c, tls/tls_proxy_print.c, + tls/tls_proxy_scan.c, tlsmgr/tlsmgr.c, tlsproxy/tlsproxy.c, + trivial-rewrite/resolve.c, trivial-rewrite/rewrite.c, + trivial-rewrite/trivial-rewrite.c, util/attr.h. 20141217 - Replaced argment typechecking based on inline functions - with an implementation based on ternary expressions with - unreachable assignments to dummy variables. This should - produce the exact same result as the approach based on - inline functions (which were standardized with C99). Files: - util/check_arg.h, util/attr.h, util/attr.c. + Replaced compile-time argument typechecking based on inline + functions with an implementation based on ternary expressions + with unreachable assignments to dummy variables. This + should produce the exact same result as the approach based + on inline functions (which were standardized with C99). + Files: util/check_arg.h, util/attr.h, util/attr.c. + +20141221 + + Portability: proof-of-concept template for OpenBSD build + with shared libpostfix etc. libraries. File: makedefs. + +20141223 + + Cleanup: compile-time variadic argument type checking for + attribute-value APIs of vstream, vstream_popen, vstring, + pipe_command, spawn_command, attr_override, and mail_server + skeletons. Based on mostly automatic conversion and checking, + with a manual inspection of the remainder. Files: + anvil/anvil.c, bounce/bounce.c, cleanup/cleanup.c, + cleanup/cleanup_api.c, discard/discard.c, dnsblog/dnsblog.c, + error/error.c, flush/flush.c, global/attr_override.c, + global/attr_override.h, global/mail_connect.c, global/mail_queue.c, + global/mail_stream.c, global/mail_stream.h, global/pipe_command.c, + global/pipe_command.h, global/smtp_stream.c, global/timed_ipc.c, + local/command.c, local/local.c, master/event_server.c, + master/mail_server.h, master/multi_server.c, + master/single_server.c, milter/milter.c, milter/milter8.c, + oqmgr/qmgr.c, oqmgr/qmgr_transport.c, pickup/pickup.c, + pipe/pipe.c, postalias/postalias.c, postcat/postcat.c, + postdrop/postdrop.c, postmap/postmap.c, postscreen/postscreen.c, + postscreen/postscreen_dnsbl.c, postscreen/postscreen_haproxy.c, + postscreen/postscreen_starttls.c, posttls-finger/posttls-finger.c, + proxymap/proxymap.c, qmgr/qmgr.c, qmgr/qmgr_transport.c, + qmqpd/qmqpd.c, scache/scache.c, showq/showq.c, smtp/smtp.c, + smtpd/smtpd.c, smtpd/smtpd_check.c, smtpd/smtpd_proxy.c, + smtpstone/smtp-source.c, spawn/spawn.c, tls/tls_proxy_clnt.c, + tls/tls_stream.c, tlsmgr/tlsmgr.c, tlsproxy/tlsproxy.c, + trivial-rewrite/trivial-rewrite.c, util/auto_clnt.c, + util/ctable.c, util/dict_cache.c, util/dict_cache.h, + util/dict_lmdb.c, util/dict_tcp.c, util/netstring.c, + util/recv_pass_attr.c, util/slmdb.c, util/slmdb.h, + util/spawn_command.c, util/spawn_command.h, util/vstream.c, + util/vstream.h, util/vstream_popen.c, util/vstream_tweak.c, + util/vstring.c, util/vstring.h, verify/verify.c, + virtual/virtual.c, xsasl/xsasl_dovecot_server.c. + +20141224 + + Cleanup: the compile-time argument typechecks for attribute-value + APIs are now by default implemented with inline functions. + Compile with -DNO_INLINE to implement the argument typechecks + with ternary operators and unreachable assignments. Files: + util/check_arg.h and its consumers. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 44a424d41..f2abd42ba 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -59,6 +59,14 @@ Maintainers may also benefit from the makedefs documentation (mantools/srctoman - makedefs | nroff -man | less) with information about build options that are not described in the INSTALL instructions. +Major changes with snapshot 20141224 +==================================== + +Compile-time argument typechecks of non-printf/scanf-like variadic +function argument lists. This change produces no directly-visible +result, but it makes Postfix code easier to maintain, and therefore +makes new functionality easier to add. + Major changes with snapshot 20141207 ==================================== diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 76d3939bf..6da5d5c73 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -12,6 +12,14 @@ Wish list: support for regexp: and cidr: tables. Factor out and reuse code that already exists in inline: and other tables. + Solaris poll() does not work as expected. With Solaris10, + write_wait() hangs until timeout when invoked after peekfd() + has received an ECONNRESET error indication. This happens + when a client sends QUIT and closes the connection immediately. + Apparently the ECONNRESET error condition is not persistent. + + Fix "postfix-install: daemon_directory: not found' on Solaris. + Log command=good/bad statistics in postscreen? Implement smtpd_client_auth_rate limit? diff --git a/postfix/html/lmtp.8.html b/postfix/html/lmtp.8.html index 12e631e4c..37f1a1986 100644 --- a/postfix/html/lmtp.8.html +++ b/postfix/html/lmtp.8.html @@ -299,7 +299,7 @@ SMTP(8) SMTP(8) delivery status code or explanatory text of successful or unsuc- cessful deliveries. - smtp_dns_reply_filter ($default_dns_reply_filter) + smtp_dns_reply_filter (empty) Optional filter for Postfix SMTP client DNS lookup results. MIME PROCESSING CONTROLS @@ -801,7 +801,7 @@ SMTP(8) SMTP(8) client should bind to when making an IPv6 connection. smtp_helo_name ($myhostname) - The hostname to send in the SMTP EHLO or HELO command. + The hostname to send in the SMTP HELO or EHLO command. lmtp_lhlo_name ($myhostname) The hostname to send in the LMTP LHLO command. diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 95d65ef14..b3d7e8b5f 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -781,7 +781,9 @@ and postdrop(1). when not present. Postfix 2.6 and later add these headers only when clients match the local_header_rewrite_clients parameter setting. Earlier Postfix versions always add these headers; this -may break DKIM signatures that cover non-existent headers.

+may break DKIM signatures that cover non-existent headers. +The undisclosed_recipients_header parameter setting determines +whether a To: header will be added.

diff --git a/postfix/html/smtp-sink.1.html b/postfix/html/smtp-sink.1.html index e58394ec3..b9424202c 100644 --- a/postfix/html/smtp-sink.1.html +++ b/postfix/html/smtp-sink.1.html @@ -102,12 +102,18 @@ SMTP-SINK(1) SMTP-SINK(1) Use hostname in the SMTP greeting, in the HELO response, and in the EHLO response. The default hostname is "smtp-sink". + -H delay + Delay the first read operation after receiving DATA (time in + seconds). Combine with a large test message and a small TCP win- + dow size (see the -T option) to test the Postfix client + write_wait() implementation. + -L Enable LMTP instead of SMTP. -m count (default: 256) An upper bound on the maximal number of simultaneous connections - that smtp-sink will handle. This prevents the process from run- - ning out of file descriptors. Excess connections will stay + that smtp-sink will handle. This prevents the process from run- + ning out of file descriptors. Excess connections will stay queued in the TCP/IP stack. -M count @@ -120,69 +126,69 @@ SMTP-SINK(1) SMTP-SINK(1) -p Do not announce support for ESMTP command pipelining. - -P Change the server greeting so that it appears to come through a + -P Change the server greeting so that it appears to come through a CISCO PIX system. Implies -e. -q command,command,... - Disconnect (without replying) after receiving one of the speci- + Disconnect (without replying) after receiving one of the speci- fied commands. - Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, - VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by - white space or commas, and use quotes to protect white space + Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, + VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by + white space or commas, and use quotes to protect white space from the shell. Command names are case-insensitive. -Q command,command,... Send a 421 reply and disconnect after receiving one of the spec- ified commands. - Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, - VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by - white space or commas, and use quotes to protect white space + Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, + VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by + white space or commas, and use quotes to protect white space from the shell. Command names are case-insensitive. -r command,command,... - Reject the specified commands with a soft (4xx) error code. + Reject the specified commands with a soft (4xx) error code. This option implies -p. - Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, - VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by - white space or commas, and use quotes to protect white space + Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, + VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by + white space or commas, and use quotes to protect white space from the shell. Command names are case-insensitive. -R root-directory - Change the process root directory to the specified location. - This option requires super-user privileges. See also the -u + Change the process root directory to the specified location. + This option requires super-user privileges. See also the -u option. -s command,command,... Log the named commands to syslogd. - Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, - VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by - white space or commas, and use quotes to protect white space + Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, + VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by + white space or commas, and use quotes to protect white space from the shell. Command names are case-insensitive. -S start-string - An optional string that is prepended to each message that is - written to a dump file (see the dump file format description - below). The following C escape sequences are supported: \a - (bell), \b (backslace), \f (formfeed), \n (newline), \r (car- - riage return), \t (horizontal tab), \v (vertical tab), \ddd (up + An optional string that is prepended to each message that is + written to a dump file (see the dump file format description + below). The following C escape sequences are supported: \a + (bell), \b (backslace), \f (formfeed), \n (newline), \r (car- + riage return), \t (horizontal tab), \v (vertical tab), \ddd (up to three octal digits) and \\ (the backslash character). -t timeout (default: 100) - Limit the time for receiving a command or sending a response. + Limit the time for receiving a command or sending a response. The time limit is specified in seconds. -T windowsize - Override the default TCP window size. To work around broken TCP + Override the default TCP window size. To work around broken TCP window scaling implementations, specify a value > 0 and < 65536. -u username - Switch to the specified user privileges after opening the net- - work socket and optionally changing the process root directory. - This option is required when the process runs with super-user + Switch to the specified user privileges after opening the net- + work socket and optionally changing the process root directory. + This option is required when the process runs with super-user privileges. See also the -R option. -v Show the SMTP conversations. @@ -191,27 +197,27 @@ SMTP-SINK(1) SMTP-SINK(1) Wait delay seconds before responding to a DATA command. -W command:delay[:odds] - Wait delay seconds before responding to command. If odds is - also specified (a number between 1-99 inclusive), wait for a - random multiple of delay. The random multiplier is equal to the + Wait delay seconds before responding to command. If odds is + also specified (a number between 1-99 inclusive), wait for a + random multiple of delay. The random multiplier is equal to the number of times the program needs to roll a dice with a range of - 0..99 inclusive, before the dice produces a result greater than + 0..99 inclusive, before the dice produces a result greater than or equal to odds. [inet:][host]:port - Listen on network interface host (default: any interface) TCP - port port. Both host and port may be specified in numeric or + Listen on network interface host (default: any interface) TCP + port port. Both host and port may be specified in numeric or symbolic form. unix:pathname Listen on the UNIX-domain socket at pathname. backlog - The maximum length the queue of pending connections, as defined + The maximum length the queue of pending connections, as defined by the listen(2) system call. DUMP FILE FORMAT - Each dumped message contains a sequence of text lines, terminated with + Each dumped message contains a sequence of text lines, terminated with the newline character. The sequence of information is as follows: o The optional string specified with the -S option. @@ -225,41 +231,41 @@ SMTP-SINK(1) SMTP-SINK(1) The format of the smtp-sink generated headers is as follows: X-Client-Addr: text - The client IP address without enclosing []. An IPv6 address is + The client IP address without enclosing []. An IPv6 address is prefixed with "ipv6:". This record is always present. X-Client-Proto: text - The client protocol: SMTP, ESMTP or LMTP. This record is always + The client protocol: SMTP, ESMTP or LMTP. This record is always present. X-Helo-Args: text - The arguments of the last HELO or EHLO command before this mail - delivery transaction. This record is present only if the client - sent a recognizable HELO or EHLO command before the DATA com- + The arguments of the last HELO or EHLO command before this mail + delivery transaction. This record is present only if the client + sent a recognizable HELO or EHLO command before the DATA com- mand. X-Mail-Args: text - The arguments of the MAIL command that started this mail deliv- + The arguments of the MAIL command that started this mail deliv- ery transaction. This record is present exactly once. X-Rcpt-Args: text - The arguments of an RCPT command within this mail delivery + The arguments of an RCPT command within this mail delivery transaction. There is one record for each RCPT command, and they are in the order as sent by the client. Received: text - A message header for compatibility with mail processing soft- - ware. This three-line header marks the end of the headers pro- + A message header for compatibility with mail processing soft- + ware. This three-line header marks the end of the headers pro- vided by smtp-sink, and is formatted as follows: from helo ([addr]) - The HELO or EHLO command argument and client IP address. - If the client did not send HELO or EHLO, the client IP + The HELO or EHLO command argument and client IP address. + If the client did not send HELO or EHLO, the client IP address is used instead. by host (smtp-sink) with proto id random; - The hostname specified with the -h option, the client - protocol (see X-Client-Proto above), and the pseudo-ran- + The hostname specified with the -h option, the client + protocol (see X-Client-Proto above), and the pseudo-ran- dom portion of the per-message capture file name. time-stamp diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html index 12e631e4c..37f1a1986 100644 --- a/postfix/html/smtp.8.html +++ b/postfix/html/smtp.8.html @@ -299,7 +299,7 @@ SMTP(8) SMTP(8) delivery status code or explanatory text of successful or unsuc- cessful deliveries. - smtp_dns_reply_filter ($default_dns_reply_filter) + smtp_dns_reply_filter (empty) Optional filter for Postfix SMTP client DNS lookup results. MIME PROCESSING CONTROLS @@ -801,7 +801,7 @@ SMTP(8) SMTP(8) client should bind to when making an IPv6 connection. smtp_helo_name ($myhostname) - The hostname to send in the SMTP EHLO or HELO command. + The hostname to send in the SMTP HELO or EHLO command. lmtp_lhlo_name ($myhostname) The hostname to send in the LMTP LHLO command. diff --git a/postfix/makedefs b/postfix/makedefs index 58eb0cca4..e024cda40 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -51,6 +51,10 @@ # are known to support it. # .IP \fB-DNO_EAI\fR # Do not build with EAI (SMTPUTF8) support. +# .IP \fB-DNO_INLINE\fR +# Do not require support for C99 "inline" functions. Instead, +# implement argument typechecks for non-printf/scanf-like +# functions with ternary operators and unreachable code. # .IP \fB-DNO_IPV6\fR # Do not build with IPv6 support. # By default, IPv6 support is compiled in on platforms that @@ -240,6 +244,13 @@ case "$SYSTEM.$RELEASE" in OpenBSD.4*) SYSTYPE=OPENBSD4 ;; OpenBSD.5*) SYSTYPE=OPENBSD5 + : ${CC=cc} + : ${SHLIB_SUFFIX=.so.1.0} + : ${SHLIB_CFLAGS=-fPIC} + : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} + : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} + : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} + : ${PLUGIN_LD="${CC} -shared"} ;; ekkoBSD.1*) SYSTYPE=EKKOBSD1 ;; diff --git a/postfix/man/man1/smtp-sink.1 b/postfix/man/man1/smtp-sink.1 index da45ae7fd..136475b7c 100644 --- a/postfix/man/man1/smtp-sink.1 +++ b/postfix/man/man1/smtp-sink.1 @@ -101,6 +101,11 @@ Disable XFORWARD support. .IP "\fB-h\fI hostname\fR" Use \fIhostname\fR in the SMTP greeting, in the HELO response, and in the EHLO response. The default hostname is "smtp-sink". +.IP "\fB-H\fI delay\fR" +Delay the first read operation after receiving DATA (time +in seconds). Combine with a large test message and a small +TCP window size (see the \fB-T\fR option) to test the Postfix +client write_wait() implementation. .IP \fB-L\fR Enable LMTP instead of SMTP. .IP "\fB-m \fIcount\fR (default: 256)" diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index c06e544df..69603ad35 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -458,6 +458,8 @@ when not present. Postfix 2.6 and later add these headers only when clients match the local_header_rewrite_clients parameter setting. Earlier Postfix versions always add these headers; this may break DKIM signatures that cover non-existent headers. +The undisclosed_recipients_header parameter setting determines +whether a To: header will be added. .SH always_bcc (default: empty) Optional address that receives a "blind carbon copy" of each message that is received by the Postfix mail system. diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8 index ffcac6c9c..6a9de639e 100644 --- a/postfix/man/man8/smtp.8 +++ b/postfix/man/man8/smtp.8 @@ -282,7 +282,7 @@ Available in Postfix version 2.12 and later: Optional filter for the \fBsmtp\fR(8) delivery agent to change the delivery status code or explanatory text of successful or unsuccessful deliveries. -.IP "\fBsmtp_dns_reply_filter ($default_dns_reply_filter)\fR" +.IP "\fBsmtp_dns_reply_filter (empty)\fR" Optional filter for Postfix SMTP client DNS lookup results. .SH "MIME PROCESSING CONTROLS" .na @@ -702,7 +702,7 @@ should bind to when making an IPv4 connection. An optional numerical network address that the Postfix SMTP client should bind to when making an IPv6 connection. .IP "\fBsmtp_helo_name ($myhostname)\fR" -The hostname to send in the SMTP EHLO or HELO command. +The hostname to send in the SMTP HELO or EHLO command. .IP "\fBlmtp_lhlo_name ($myhostname)\fR" The hostname to send in the LMTP LHLO command. .IP "\fBsmtp_host_lookup (dns)\fR" diff --git a/postfix/proto/INSTALL.html b/postfix/proto/INSTALL.html index 7636ce690..8a1b958ef 100644 --- a/postfix/proto/INSTALL.html +++ b/postfix/proto/INSTALL.html @@ -734,6 +734,11 @@ that are known to support this feature. (SMTPUTF8) support. By default, EAI support is compiled in when the "icuuc" library and header files are found. + -DNO_INLINE Do not require support +for C99 "inline" functions. Instead, implement argument typechecks +for non-printf/scanf-like functions with ternary operators and +unreachable code. + -DNO_IPV6 Do not build with IPv6 support. By default, IPv6 support is compiled in on platforms that are known to have IPv6 support. Note: this directive is for debugging diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 9341208db..eb6633cab 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -13563,7 +13563,9 @@ existing LMTP-based content filters.

when not present. Postfix 2.6 and later add these headers only when clients match the local_header_rewrite_clients parameter setting. Earlier Postfix versions always add these headers; this -may break DKIM signatures that cover non-existent headers.

+may break DKIM signatures that cover non-existent headers. +The undisclosed_recipients_header parameter setting determines +whether a To: header will be added.

%PARAM lmtp_header_checks diff --git a/postfix/src/anvil/anvil.c b/postfix/src/anvil/anvil.c index 59549e878..a4912defc 100644 --- a/postfix/src/anvil/anvil.c +++ b/postfix/src/anvil/anvil.c @@ -591,8 +591,8 @@ static ANVIL_REMOTE *anvil_remote_conn_update(VSTREAM *client_stream, const char anvil_local = (ANVIL_LOCAL *) mymalloc(sizeof(*anvil_local)); ANVIL_LOCAL_INIT(anvil_local); vstream_control(client_stream, - VSTREAM_CTL_CONTEXT, (void *) anvil_local, - VSTREAM_CTL_END); + VSTREAM_SCTL_CONTEXT((void *) anvil_local), + VSTREAM_SCTL_END); } ANVIL_LOCAL_ADD_ONE(anvil_local, anvil_remote); if (msg_verbose) @@ -954,10 +954,10 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; multi_server_main(argc, argv, anvil_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_SOLITARY, - MAIL_SERVER_PRE_DISCONN, anvil_service_done, - MAIL_SERVER_EXIT, anvil_status_dump, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_SOLITARY, + MAIL_SERVER_REQ_PRE_DISCONN(anvil_service_done), + MAIL_SERVER_REQ_EXIT(anvil_status_dump), 0); } diff --git a/postfix/src/bounce/bounce.c b/postfix/src/bounce/bounce.c index 2016a3433..82cb39e3b 100644 --- a/postfix/src/bounce/bounce.c +++ b/postfix/src/bounce/bounce.c @@ -656,11 +656,11 @@ int main(int argc, char **argv) * Pass control to the single-threaded service skeleton. */ single_server_main(argc, argv, bounce_service, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_UNLIMITED, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_UNLIMITED, 0); } diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c index 3c05943f9..d306bb647 100644 --- a/postfix/src/cleanup/cleanup.c +++ b/postfix/src/cleanup/cleanup.c @@ -570,14 +570,14 @@ int main(int argc, char **argv) * Pass control to the single-threaded service skeleton. */ single_server_main(argc, argv, cleanup_service, - MAIL_SERVER_INT_TABLE, cleanup_int_table, - MAIL_SERVER_BOOL_TABLE, cleanup_bool_table, - MAIL_SERVER_STR_TABLE, cleanup_str_table, - MAIL_SERVER_TIME_TABLE, cleanup_time_table, - MAIL_SERVER_PRE_INIT, cleanup_pre_jail, - MAIL_SERVER_POST_INIT, cleanup_post_jail, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_IN_FLOW_DELAY, - MAIL_SERVER_UNLIMITED, + MAIL_SERVER_REQ_INT_TABLE(cleanup_int_table), + MAIL_SERVER_REQ_BOOL_TABLE(cleanup_bool_table), + MAIL_SERVER_REQ_STR_TABLE(cleanup_str_table), + MAIL_SERVER_REQ_TIME_TABLE(cleanup_time_table), + MAIL_SERVER_REQ_PRE_INIT(cleanup_pre_jail), + MAIL_SERVER_REQ_POST_INIT(cleanup_post_jail), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_IN_FLOW_DELAY, + MAIL_SERVER_REQ_UNLIMITED, 0); } diff --git a/postfix/src/cleanup/cleanup_api.c b/postfix/src/cleanup/cleanup_api.c index 7e7c43c41..6f43dff40 100644 --- a/postfix/src/cleanup/cleanup_api.c +++ b/postfix/src/cleanup/cleanup_api.c @@ -304,13 +304,13 @@ int cleanup_flush(CLEANUP_STATE *state) state->queue_name = mystrdup(MAIL_QUEUE_HOLD); #endif mail_stream_ctl(state->handle, - MAIL_STREAM_CTL_QUEUE, state->queue_name, - MAIL_STREAM_CTL_CLASS, (char *) 0, - MAIL_STREAM_CTL_SERVICE, (char *) 0, + MAIL_STREAM_SCTL_QUEUE(state->queue_name), + MAIL_STREAM_SCTL_CLASS((char *) 0), + MAIL_STREAM_SCTL_SERVICE((char *) 0), #ifdef DELAY_ACTION - MAIL_STREAM_CTL_DELAY, state->defer_delay, + MAIL_STREAM_SCTL_DELAY(state->defer_delay), #endif - MAIL_STREAM_CTL_END); + MAIL_STREAM_SCTL_END); junk = cleanup_path; cleanup_path = mystrdup(VSTREAM_PATH(state->handle->stream)); myfree(junk); diff --git a/postfix/src/discard/Makefile.in b/postfix/src/discard/Makefile.in index d14751466..218f28bc5 100644 --- a/postfix/src/discard/Makefile.in +++ b/postfix/src/discard/Makefile.in @@ -69,6 +69,7 @@ discard.o: ../../include/dsn_buf.h discard.o: ../../include/dsn_util.h discard.o: ../../include/flush_clnt.h discard.o: ../../include/htable.h +discard.o: ../../include/mail_conf.h discard.o: ../../include/mail_queue.h discard.o: ../../include/mail_server.h discard.o: ../../include/mail_version.h diff --git a/postfix/src/discard/discard.c b/postfix/src/discard/discard.c index fec6a9f85..aeab6e701 100644 --- a/postfix/src/discard/discard.c +++ b/postfix/src/discard/discard.c @@ -237,6 +237,6 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, discard_service, - MAIL_SERVER_PRE_INIT, pre_init, + MAIL_SERVER_REQ_PRE_INIT(pre_init), 0); } diff --git a/postfix/src/dns/Makefile.in b/postfix/src/dns/Makefile.in index 4635cb190..d8551b0f8 100644 --- a/postfix/src/dns/Makefile.in +++ b/postfix/src/dns/Makefile.in @@ -162,6 +162,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' dns_lookup.o: ../../include/argv.h +dns_lookup.o: ../../include/check_arg.h dns_lookup.o: ../../include/dict.h dns_lookup.o: ../../include/maps.h dns_lookup.o: ../../include/msg.h @@ -177,6 +178,7 @@ dns_lookup.o: ../../include/vstream.h dns_lookup.o: ../../include/vstring.h dns_lookup.o: dns.h dns_lookup.o: dns_lookup.c +dns_rr.o: ../../include/check_arg.h dns_rr.o: ../../include/msg.h dns_rr.o: ../../include/myaddrinfo.h dns_rr.o: ../../include/mymalloc.h @@ -187,6 +189,7 @@ dns_rr.o: ../../include/vbuf.h dns_rr.o: ../../include/vstring.h dns_rr.o: dns.h dns_rr.o: dns_rr.c +dns_rr_eq_sa.o: ../../include/check_arg.h dns_rr_eq_sa.o: ../../include/msg.h dns_rr_eq_sa.o: ../../include/myaddrinfo.h dns_rr_eq_sa.o: ../../include/sock_addr.h @@ -196,6 +199,7 @@ dns_rr_eq_sa.o: ../../include/vstring.h dns_rr_eq_sa.o: dns.h dns_rr_eq_sa.o: dns_rr_eq_sa.c dns_rr_filter.o: ../../include/argv.h +dns_rr_filter.o: ../../include/check_arg.h dns_rr_filter.o: ../../include/dict.h dns_rr_filter.o: ../../include/maps.h dns_rr_filter.o: ../../include/msg.h @@ -208,6 +212,7 @@ dns_rr_filter.o: ../../include/vstream.h dns_rr_filter.o: ../../include/vstring.h dns_rr_filter.o: dns.h dns_rr_filter.o: dns_rr_filter.c +dns_rr_to_pa.o: ../../include/check_arg.h dns_rr_to_pa.o: ../../include/msg.h dns_rr_to_pa.o: ../../include/myaddrinfo.h dns_rr_to_pa.o: ../../include/sock_addr.h @@ -216,6 +221,7 @@ dns_rr_to_pa.o: ../../include/vbuf.h dns_rr_to_pa.o: ../../include/vstring.h dns_rr_to_pa.o: dns.h dns_rr_to_pa.o: dns_rr_to_pa.c +dns_rr_to_sa.o: ../../include/check_arg.h dns_rr_to_sa.o: ../../include/msg.h dns_rr_to_sa.o: ../../include/myaddrinfo.h dns_rr_to_sa.o: ../../include/sock_addr.h @@ -224,6 +230,7 @@ dns_rr_to_sa.o: ../../include/vbuf.h dns_rr_to_sa.o: ../../include/vstring.h dns_rr_to_sa.o: dns.h dns_rr_to_sa.o: dns_rr_to_sa.c +dns_sa_to_rr.o: ../../include/check_arg.h dns_sa_to_rr.o: ../../include/msg.h dns_sa_to_rr.o: ../../include/myaddrinfo.h dns_sa_to_rr.o: ../../include/sock_addr.h @@ -232,6 +239,7 @@ dns_sa_to_rr.o: ../../include/vbuf.h dns_sa_to_rr.o: ../../include/vstring.h dns_sa_to_rr.o: dns.h dns_sa_to_rr.o: dns_sa_to_rr.c +dns_strerror.o: ../../include/check_arg.h dns_strerror.o: ../../include/myaddrinfo.h dns_strerror.o: ../../include/sock_addr.h dns_strerror.o: ../../include/sys_defs.h @@ -239,6 +247,7 @@ dns_strerror.o: ../../include/vbuf.h dns_strerror.o: ../../include/vstring.h dns_strerror.o: dns.h dns_strerror.o: dns_strerror.c +dns_strrecord.o: ../../include/check_arg.h dns_strrecord.o: ../../include/msg.h dns_strrecord.o: ../../include/myaddrinfo.h dns_strrecord.o: ../../include/sock_addr.h @@ -247,6 +256,7 @@ dns_strrecord.o: ../../include/vbuf.h dns_strrecord.o: ../../include/vstring.h dns_strrecord.o: dns.h dns_strrecord.o: dns_strrecord.c +dns_strtype.o: ../../include/check_arg.h dns_strtype.o: ../../include/myaddrinfo.h dns_strtype.o: ../../include/sock_addr.h dns_strtype.o: ../../include/sys_defs.h @@ -255,6 +265,7 @@ dns_strtype.o: ../../include/vstring.h dns_strtype.o: dns.h dns_strtype.o: dns_strtype.c test_dns_lookup.o: ../../include/argv.h +test_dns_lookup.o: ../../include/check_arg.h test_dns_lookup.o: ../../include/msg.h test_dns_lookup.o: ../../include/msg_vstream.h test_dns_lookup.o: ../../include/myaddrinfo.h diff --git a/postfix/src/dnsblog/dnsblog.c b/postfix/src/dnsblog/dnsblog.c index d12ce69ae..fc46feb28 100644 --- a/postfix/src/dnsblog/dnsblog.c +++ b/postfix/src/dnsblog/dnsblog.c @@ -277,8 +277,8 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, dnsblog_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_UNLIMITED, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_UNLIMITED, 0); } diff --git a/postfix/src/error/Makefile.in b/postfix/src/error/Makefile.in index 31e32b7f7..c4f636ef3 100644 --- a/postfix/src/error/Makefile.in +++ b/postfix/src/error/Makefile.in @@ -71,6 +71,7 @@ error.o: ../../include/dsn_util.h error.o: ../../include/flush_clnt.h error.o: ../../include/htable.h error.o: ../../include/iostuff.h +error.o: ../../include/mail_conf.h error.o: ../../include/mail_proto.h error.o: ../../include/mail_queue.h error.o: ../../include/mail_server.h diff --git a/postfix/src/error/error.c b/postfix/src/error/error.c index 26aa01134..59b2fcc6e 100644 --- a/postfix/src/error/error.c +++ b/postfix/src/error/error.c @@ -250,6 +250,6 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, error_service, - MAIL_SERVER_PRE_INIT, pre_init, + MAIL_SERVER_REQ_PRE_INIT(pre_init), 0); } diff --git a/postfix/src/flush/flush.c b/postfix/src/flush/flush.c index 1f544bdef..ce0d8f023 100644 --- a/postfix/src/flush/flush.c +++ b/postfix/src/flush/flush.c @@ -828,8 +828,8 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, flush_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_UNLIMITED, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_UNLIMITED, 0); } diff --git a/postfix/src/fsstone/Makefile.in b/postfix/src/fsstone/Makefile.in index 564a3009a..532abe082 100644 --- a/postfix/src/fsstone/Makefile.in +++ b/postfix/src/fsstone/Makefile.in @@ -59,6 +59,7 @@ depend: $(MAKES) @$(EXPORT) make -f Makefile.in Makefile 1>&2 # do not edit below this line - it is generated by 'make depend' +fsstone.o: ../../include/check_arg.h fsstone.o: ../../include/mail_version.h fsstone.o: ../../include/msg.h fsstone.o: ../../include/msg_vstream.h diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index ad2082e4a..2f96f2521 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -708,6 +708,7 @@ anvil_clnt.o: anvil_clnt.c anvil_clnt.o: anvil_clnt.h anvil_clnt.o: mail_params.h anvil_clnt.o: mail_proto.h +attr_override.o: ../../include/check_arg.h attr_override.o: ../../include/msg.h attr_override.o: ../../include/stringops.h attr_override.o: ../../include/sys_defs.h @@ -717,6 +718,7 @@ attr_override.o: attr_override.c attr_override.o: attr_override.h attr_override.o: conv_time.h attr_override.o: mail_conf.h +been_here.o: ../../include/check_arg.h been_here.o: ../../include/htable.h been_here.o: ../../include/msg.h been_here.o: ../../include/mymalloc.h @@ -792,6 +794,7 @@ canon_addr.o: canon_addr.h canon_addr.o: mail_proto.h canon_addr.o: rewrite_clnt.h cfg_parser.o: ../../include/argv.h +cfg_parser.o: ../../include/check_arg.h cfg_parser.o: ../../include/dict.h cfg_parser.o: ../../include/msg.h cfg_parser.o: ../../include/myflock.h @@ -803,12 +806,14 @@ cfg_parser.o: ../../include/vstring.h cfg_parser.o: cfg_parser.c cfg_parser.o: cfg_parser.h cfg_parser.o: mail_conf.h +cleanup_strerror.o: ../../include/check_arg.h cleanup_strerror.o: ../../include/msg.h cleanup_strerror.o: ../../include/sys_defs.h cleanup_strerror.o: ../../include/vbuf.h cleanup_strerror.o: ../../include/vstring.h cleanup_strerror.o: cleanup_strerror.c cleanup_strerror.o: cleanup_user.h +cleanup_strflags.o: ../../include/check_arg.h cleanup_strflags.o: ../../include/msg.h cleanup_strflags.o: ../../include/sys_defs.h cleanup_strflags.o: ../../include/vbuf.h @@ -836,6 +841,7 @@ conv_time.o: ../../include/sys_defs.h conv_time.o: conv_time.c conv_time.o: conv_time.h data_redirect.o: ../../include/argv.h +data_redirect.o: ../../include/check_arg.h data_redirect.o: ../../include/dict.h data_redirect.o: ../../include/dict_cdb.h data_redirect.o: ../../include/dict_db.h @@ -856,6 +862,7 @@ data_redirect.o: data_redirect.h data_redirect.o: dict_proxy.h data_redirect.o: mail_params.h db_common.o: ../../include/argv.h +db_common.o: ../../include/check_arg.h db_common.o: ../../include/dict.h db_common.o: ../../include/match_list.h db_common.o: ../../include/msg.h @@ -914,6 +921,7 @@ defer.o: rcpt_print.h defer.o: recipient_list.h defer.o: trace.h defer.o: verify.h +deliver_completed.o: ../../include/check_arg.h deliver_completed.o: ../../include/msg.h deliver_completed.o: ../../include/sys_defs.h deliver_completed.o: ../../include/vbuf.h @@ -923,6 +931,7 @@ deliver_completed.o: deliver_completed.c deliver_completed.o: deliver_completed.h deliver_completed.o: rec_type.h deliver_completed.o: record.h +deliver_flock.o: ../../include/check_arg.h deliver_flock.o: ../../include/iostuff.h deliver_flock.o: ../../include/myflock.h deliver_flock.o: ../../include/sys_defs.h @@ -978,6 +987,7 @@ deliver_request.o: mail_queue.h deliver_request.o: msg_stats.h deliver_request.o: rcpt_buf.h deliver_request.o: recipient_list.h +delivered_hdr.o: ../../include/check_arg.h delivered_hdr.o: ../../include/htable.h delivered_hdr.o: ../../include/msg.h delivered_hdr.o: ../../include/mymalloc.h @@ -998,6 +1008,7 @@ delivered_hdr.o: rec_type.h delivered_hdr.o: record.h dict_ldap.o: ../../include/argv.h dict_ldap.o: ../../include/binhash.h +dict_ldap.o: ../../include/check_arg.h dict_ldap.o: ../../include/dict.h dict_ldap.o: ../../include/match_list.h dict_ldap.o: ../../include/msg.h @@ -1017,6 +1028,7 @@ dict_ldap.o: mail_conf.h dict_ldap.o: string_list.h dict_memcache.o: ../../include/argv.h dict_memcache.o: ../../include/auto_clnt.h +dict_memcache.o: ../../include/check_arg.h dict_memcache.o: ../../include/dict.h dict_memcache.o: ../../include/match_list.h dict_memcache.o: ../../include/msg.h @@ -1033,27 +1045,10 @@ dict_memcache.o: dict_memcache.c dict_memcache.o: dict_memcache.h dict_memcache.o: memcache_proto.h dict_memcache.o: string_list.h -dict_mysql.o: ../../include/argv.h -dict_mysql.o: ../../include/dict.h -dict_mysql.o: ../../include/events.h -dict_mysql.o: ../../include/find_inet.h -dict_mysql.o: ../../include/match_list.h -dict_mysql.o: ../../include/msg.h -dict_mysql.o: ../../include/myflock.h -dict_mysql.o: ../../include/mymalloc.h -dict_mysql.o: ../../include/myrand.h -dict_mysql.o: ../../include/split_at.h -dict_mysql.o: ../../include/stringops.h dict_mysql.o: ../../include/sys_defs.h -dict_mysql.o: ../../include/vbuf.h -dict_mysql.o: ../../include/vstream.h -dict_mysql.o: ../../include/vstring.h -dict_mysql.o: cfg_parser.h -dict_mysql.o: db_common.h dict_mysql.o: dict_mysql.c -dict_mysql.o: dict_mysql.h -dict_mysql.o: string_list.h dict_pgsql.o: ../../include/argv.h +dict_pgsql.o: ../../include/check_arg.h dict_pgsql.o: ../../include/dict.h dict_pgsql.o: ../../include/events.h dict_pgsql.o: ../../include/find_inet.h @@ -1094,6 +1089,7 @@ dict_proxy.o: dict_proxy.h dict_proxy.o: mail_params.h dict_proxy.o: mail_proto.h dict_sqlite.o: ../../include/argv.h +dict_sqlite.o: ../../include/check_arg.h dict_sqlite.o: ../../include/dict.h dict_sqlite.o: ../../include/match_list.h dict_sqlite.o: ../../include/msg.h @@ -1114,6 +1110,7 @@ domain_list.o: ../../include/match_list.h domain_list.o: ../../include/sys_defs.h domain_list.o: domain_list.c domain_list.o: domain_list.h +dot_lockfile.o: ../../include/check_arg.h dot_lockfile.o: ../../include/iostuff.h dot_lockfile.o: ../../include/mymalloc.h dot_lockfile.o: ../../include/stringops.h @@ -1124,6 +1121,7 @@ dot_lockfile.o: ../../include/warn_stat.h dot_lockfile.o: dot_lockfile.c dot_lockfile.o: dot_lockfile.h dot_lockfile.o: mail_params.h +dot_lockfile_as.o: ../../include/check_arg.h dot_lockfile_as.o: ../../include/msg.h dot_lockfile_as.o: ../../include/set_eugid.h dot_lockfile_as.o: ../../include/sys_defs.h @@ -1152,6 +1150,7 @@ dsn.o: ../../include/mymalloc.h dsn.o: ../../include/sys_defs.h dsn.o: dsn.c dsn.o: dsn.h +dsn_buf.o: ../../include/check_arg.h dsn_buf.o: ../../include/msg.h dsn_buf.o: ../../include/mymalloc.h dsn_buf.o: ../../include/sys_defs.h @@ -1161,6 +1160,7 @@ dsn_buf.o: dsn.h dsn_buf.o: dsn_buf.c dsn_buf.o: dsn_buf.h dsn_filter.o: ../../include/argv.h +dsn_filter.o: ../../include/check_arg.h dsn_filter.o: ../../include/dict.h dsn_filter.o: ../../include/msg.h dsn_filter.o: ../../include/myflock.h @@ -1174,6 +1174,7 @@ dsn_filter.o: dsn_filter.c dsn_filter.o: dsn_filter.h dsn_filter.o: dsn_util.h dsn_filter.o: maps.h +dsn_mask.o: ../../include/check_arg.h dsn_mask.o: ../../include/msg.h dsn_mask.o: ../../include/name_code.h dsn_mask.o: ../../include/name_mask.h @@ -1196,6 +1197,7 @@ dsn_print.o: dsn.h dsn_print.o: dsn_print.c dsn_print.o: dsn_print.h dsn_print.o: mail_proto.h +dsn_util.o: ../../include/check_arg.h dsn_util.o: ../../include/msg.h dsn_util.o: ../../include/mymalloc.h dsn_util.o: ../../include/stringops.h @@ -1205,6 +1207,7 @@ dsn_util.o: ../../include/vstring.h dsn_util.o: dsn_util.c dsn_util.o: dsn_util.h dynamicmaps.o: ../../include/argv.h +dynamicmaps.o: ../../include/check_arg.h dynamicmaps.o: ../../include/dict.h dynamicmaps.o: ../../include/htable.h dynamicmaps.o: ../../include/load_lib.h @@ -1222,12 +1225,14 @@ dynamicmaps.o: ../../include/vstring_vstream.h dynamicmaps.o: dynamicmaps.c dynamicmaps.o: dynamicmaps.h dynamicmaps.o: mkmap.h +ehlo_mask.o: ../../include/check_arg.h ehlo_mask.o: ../../include/name_mask.h ehlo_mask.o: ../../include/sys_defs.h ehlo_mask.o: ../../include/vbuf.h ehlo_mask.o: ../../include/vstring.h ehlo_mask.o: ehlo_mask.c ehlo_mask.o: ehlo_mask.h +ext_prop.o: ../../include/check_arg.h ext_prop.o: ../../include/name_mask.h ext_prop.o: ../../include/sys_defs.h ext_prop.o: ../../include/vbuf.h @@ -1235,6 +1240,7 @@ ext_prop.o: ../../include/vstring.h ext_prop.o: ext_prop.c ext_prop.o: ext_prop.h ext_prop.o: mail_params.h +file_id.o: ../../include/check_arg.h file_id.o: ../../include/msg.h file_id.o: ../../include/sys_defs.h file_id.o: ../../include/vbuf.h @@ -1265,12 +1271,14 @@ flush_clnt.o: mail_flush.h flush_clnt.o: mail_params.h flush_clnt.o: mail_proto.h flush_clnt.o: match_parent_style.h +fold_addr.o: ../../include/check_arg.h fold_addr.o: ../../include/stringops.h fold_addr.o: ../../include/sys_defs.h fold_addr.o: ../../include/vbuf.h fold_addr.o: ../../include/vstring.h fold_addr.o: fold_addr.c fold_addr.o: fold_addr.h +haproxy_srvr.o: ../../include/check_arg.h haproxy_srvr.o: ../../include/inet_proto.h haproxy_srvr.o: ../../include/msg.h haproxy_srvr.o: ../../include/myaddrinfo.h @@ -1283,6 +1291,7 @@ haproxy_srvr.o: ../../include/vstring.h haproxy_srvr.o: haproxy_srvr.c haproxy_srvr.o: haproxy_srvr.h header_body_checks.o: ../../include/argv.h +header_body_checks.o: ../../include/check_arg.h header_body_checks.o: ../../include/dict.h header_body_checks.o: ../../include/msg.h header_body_checks.o: ../../include/myflock.h @@ -1301,6 +1310,7 @@ header_body_checks.o: maps.h header_body_checks.o: mime_state.h header_body_checks.o: rec_type.h header_opts.o: ../../include/argv.h +header_opts.o: ../../include/check_arg.h header_opts.o: ../../include/htable.h header_opts.o: ../../include/msg.h header_opts.o: ../../include/mymalloc.h @@ -1311,6 +1321,7 @@ header_opts.o: ../../include/vstring.h header_opts.o: header_opts.c header_opts.o: header_opts.h header_opts.o: mail_params.h +header_token.o: ../../include/check_arg.h header_token.o: ../../include/msg.h header_token.o: ../../include/sys_defs.h header_token.o: ../../include/vbuf.h @@ -1318,6 +1329,7 @@ header_token.o: ../../include/vstring.h header_token.o: header_token.c header_token.o: header_token.h header_token.o: lex_822.h +input_transp.o: ../../include/check_arg.h input_transp.o: ../../include/msg.h input_transp.o: ../../include/name_mask.h input_transp.o: ../../include/sys_defs.h @@ -1364,6 +1376,7 @@ log_adhoc.o: log_adhoc.h log_adhoc.o: mail_params.h log_adhoc.o: msg_stats.h log_adhoc.o: recipient_list.h +mail_addr.o: ../../include/check_arg.h mail_addr.o: ../../include/stringops.h mail_addr.o: ../../include/sys_defs.h mail_addr.o: ../../include/vbuf.h @@ -1372,6 +1385,7 @@ mail_addr.o: mail_addr.c mail_addr.o: mail_addr.h mail_addr.o: mail_params.h mail_addr_crunch.o: ../../include/argv.h +mail_addr_crunch.o: ../../include/check_arg.h mail_addr_crunch.o: ../../include/mymalloc.h mail_addr_crunch.o: ../../include/sys_defs.h mail_addr_crunch.o: ../../include/vbuf.h @@ -1382,6 +1396,7 @@ mail_addr_crunch.o: mail_addr_crunch.h mail_addr_crunch.o: resolve_clnt.h mail_addr_crunch.o: tok822.h mail_addr_find.o: ../../include/argv.h +mail_addr_find.o: ../../include/check_arg.h mail_addr_find.o: ../../include/dict.h mail_addr_find.o: ../../include/msg.h mail_addr_find.o: ../../include/myflock.h @@ -1398,6 +1413,7 @@ mail_addr_find.o: maps.h mail_addr_find.o: resolve_local.h mail_addr_find.o: strip_addr.h mail_addr_map.o: ../../include/argv.h +mail_addr_map.o: ../../include/check_arg.h mail_addr_map.o: ../../include/dict.h mail_addr_map.o: ../../include/msg.h mail_addr_map.o: ../../include/myflock.h @@ -1436,6 +1452,7 @@ mail_command_server.o: ../../include/vstring.h mail_command_server.o: mail_command_server.c mail_command_server.o: mail_proto.h mail_conf.o: ../../include/argv.h +mail_conf.o: ../../include/check_arg.h mail_conf.o: ../../include/dict.h mail_conf.o: ../../include/msg.h mail_conf.o: ../../include/myflock.h @@ -1451,6 +1468,7 @@ mail_conf.o: mail_conf.c mail_conf.o: mail_conf.h mail_conf.o: mail_params.h mail_conf_bool.o: ../../include/argv.h +mail_conf_bool.o: ../../include/check_arg.h mail_conf_bool.o: ../../include/dict.h mail_conf_bool.o: ../../include/msg.h mail_conf_bool.o: ../../include/myflock.h @@ -1461,6 +1479,7 @@ mail_conf_bool.o: ../../include/vstring.h mail_conf_bool.o: mail_conf.h mail_conf_bool.o: mail_conf_bool.c mail_conf_int.o: ../../include/argv.h +mail_conf_int.o: ../../include/check_arg.h mail_conf_int.o: ../../include/dict.h mail_conf_int.o: ../../include/msg.h mail_conf_int.o: ../../include/myflock.h @@ -1473,6 +1492,7 @@ mail_conf_int.o: ../../include/vstring.h mail_conf_int.o: mail_conf.h mail_conf_int.o: mail_conf_int.c mail_conf_long.o: ../../include/argv.h +mail_conf_long.o: ../../include/check_arg.h mail_conf_long.o: ../../include/dict.h mail_conf_long.o: ../../include/msg.h mail_conf_long.o: ../../include/myflock.h @@ -1485,6 +1505,7 @@ mail_conf_long.o: ../../include/vstring.h mail_conf_long.o: mail_conf.h mail_conf_long.o: mail_conf_long.c mail_conf_nbool.o: ../../include/argv.h +mail_conf_nbool.o: ../../include/check_arg.h mail_conf_nbool.o: ../../include/dict.h mail_conf_nbool.o: ../../include/msg.h mail_conf_nbool.o: ../../include/myflock.h @@ -1495,6 +1516,7 @@ mail_conf_nbool.o: ../../include/vstring.h mail_conf_nbool.o: mail_conf.h mail_conf_nbool.o: mail_conf_nbool.c mail_conf_nint.o: ../../include/argv.h +mail_conf_nint.o: ../../include/check_arg.h mail_conf_nint.o: ../../include/dict.h mail_conf_nint.o: ../../include/msg.h mail_conf_nint.o: ../../include/myflock.h @@ -1511,6 +1533,7 @@ mail_conf_raw.o: ../../include/mymalloc.h mail_conf_raw.o: ../../include/sys_defs.h mail_conf_raw.o: mail_conf.h mail_conf_raw.o: mail_conf_raw.c +mail_conf_str.o: ../../include/check_arg.h mail_conf_str.o: ../../include/msg.h mail_conf_str.o: ../../include/mymalloc.h mail_conf_str.o: ../../include/stringops.h @@ -1520,6 +1543,7 @@ mail_conf_str.o: ../../include/vstring.h mail_conf_str.o: mail_conf.h mail_conf_str.o: mail_conf_str.c mail_conf_time.o: ../../include/argv.h +mail_conf_time.o: ../../include/check_arg.h mail_conf_time.o: ../../include/dict.h mail_conf_time.o: ../../include/msg.h mail_conf_time.o: ../../include/myflock.h @@ -1548,6 +1572,7 @@ mail_connect.o: ../../include/vstring.h mail_connect.o: mail_connect.c mail_connect.o: mail_proto.h mail_connect.o: timed_ipc.h +mail_copy.o: ../../include/check_arg.h mail_copy.o: ../../include/htable.h mail_copy.o: ../../include/iostuff.h mail_copy.o: ../../include/msg.h @@ -1573,6 +1598,7 @@ mail_copy.o: quote_flags.h mail_copy.o: rec_type.h mail_copy.o: record.h mail_copy.o: sys_exits.h +mail_date.o: ../../include/check_arg.h mail_date.o: ../../include/msg.h mail_date.o: ../../include/sys_defs.h mail_date.o: ../../include/vbuf.h @@ -1580,6 +1606,7 @@ mail_date.o: ../../include/vstring.h mail_date.o: mail_date.c mail_date.o: mail_date.h mail_dict.o: ../../include/argv.h +mail_dict.o: ../../include/check_arg.h mail_dict.o: ../../include/dict.h mail_dict.o: ../../include/msg.h mail_dict.o: ../../include/myflock.h @@ -1599,6 +1626,7 @@ mail_dict.o: dynamicmaps.h mail_dict.o: mail_dict.c mail_dict.o: mail_dict.h mail_dict.o: mail_params.h +mail_error.o: ../../include/check_arg.h mail_error.o: ../../include/name_mask.h mail_error.o: ../../include/sys_defs.h mail_error.o: ../../include/vbuf.h @@ -1619,6 +1647,7 @@ mail_flush.o: mail_flush.c mail_flush.o: mail_flush.h mail_flush.o: mail_params.h mail_flush.o: mail_proto.h +mail_open_ok.o: ../../include/check_arg.h mail_open_ok.o: ../../include/msg.h mail_open_ok.o: ../../include/sys_defs.h mail_open_ok.o: ../../include/vbuf.h @@ -1664,6 +1693,7 @@ mail_params.o: own_inet_addr.h mail_params.o: recipient_list.h mail_params.o: verp_sender.h mail_parm_split.o: ../../include/argv.h +mail_parm_split.o: ../../include/check_arg.h mail_parm_split.o: ../../include/msg.h mail_parm_split.o: ../../include/mymalloc.h mail_parm_split.o: ../../include/stringops.h @@ -1687,6 +1717,7 @@ mail_pathname.o: ../../include/vstring.h mail_pathname.o: mail_pathname.c mail_pathname.o: mail_proto.h mail_queue.o: ../../include/argv.h +mail_queue.o: ../../include/check_arg.h mail_queue.o: ../../include/dir_forest.h mail_queue.o: ../../include/make_dirs.h mail_queue.o: ../../include/msg.h @@ -1703,6 +1734,7 @@ mail_queue.o: mail_params.h mail_queue.o: mail_queue.c mail_queue.o: mail_queue.h mail_queue.o: safe_ultostr.h +mail_run.o: ../../include/check_arg.h mail_run.o: ../../include/msg.h mail_run.o: ../../include/mymalloc.h mail_run.o: ../../include/stringops.h @@ -1739,6 +1771,7 @@ mail_stream.o: mail_queue.h mail_stream.o: mail_stream.c mail_stream.o: mail_stream.h mail_stream.o: opened.h +mail_task.o: ../../include/check_arg.h mail_task.o: ../../include/safe.h mail_task.o: ../../include/sys_defs.h mail_task.o: ../../include/vbuf.h @@ -1763,6 +1796,7 @@ mail_trigger.o: ../../include/warn_stat.h mail_trigger.o: mail_params.h mail_trigger.o: mail_proto.h mail_trigger.o: mail_trigger.c +mail_version.o: ../../include/check_arg.h mail_version.o: ../../include/msg.h mail_version.o: ../../include/mymalloc.h mail_version.o: ../../include/split_at.h @@ -1773,6 +1807,7 @@ mail_version.o: ../../include/vstring.h mail_version.o: mail_version.c mail_version.o: mail_version.h maps.o: ../../include/argv.h +maps.o: ../../include/check_arg.h maps.o: ../../include/dict.h maps.o: ../../include/msg.h maps.o: ../../include/myflock.h @@ -1813,6 +1848,7 @@ match_parent_style.o: match_parent_style.c match_parent_style.o: match_parent_style.h match_parent_style.o: string_list.h match_service.o: ../../include/argv.h +match_service.o: ../../include/check_arg.h match_service.o: ../../include/msg.h match_service.o: ../../include/mymalloc.h match_service.o: ../../include/stringops.h @@ -1822,6 +1858,7 @@ match_service.o: ../../include/vstring.h match_service.o: match_service.c match_service.o: match_service.h mbox_conf.o: ../../include/argv.h +mbox_conf.o: ../../include/check_arg.h mbox_conf.o: ../../include/name_mask.h mbox_conf.o: ../../include/sys_defs.h mbox_conf.o: ../../include/vbuf.h @@ -1830,6 +1867,7 @@ mbox_conf.o: mail_params.h mbox_conf.o: mbox_conf.c mbox_conf.o: mbox_conf.h mbox_open.o: ../../include/argv.h +mbox_open.o: ../../include/check_arg.h mbox_open.o: ../../include/iostuff.h mbox_open.o: ../../include/msg.h mbox_open.o: ../../include/myflock.h @@ -1847,6 +1885,7 @@ mbox_open.o: dsn_buf.h mbox_open.o: mbox_conf.h mbox_open.o: mbox_open.c mbox_open.o: mbox_open.h +memcache_proto.o: ../../include/check_arg.h memcache_proto.o: ../../include/compat_va_copy.h memcache_proto.o: ../../include/msg.h memcache_proto.o: ../../include/sys_defs.h @@ -1856,6 +1895,7 @@ memcache_proto.o: ../../include/vstring.h memcache_proto.o: ../../include/vstring_vstream.h memcache_proto.o: memcache_proto.c memcache_proto.o: memcache_proto.h +mime_state.o: ../../include/check_arg.h mime_state.o: ../../include/msg.h mime_state.o: ../../include/mymalloc.h mime_state.o: ../../include/sys_defs.h @@ -1870,6 +1910,7 @@ mime_state.o: mime_state.c mime_state.o: mime_state.h mime_state.o: rec_type.h mkmap_cdb.o: ../../include/argv.h +mkmap_cdb.o: ../../include/check_arg.h mkmap_cdb.o: ../../include/dict.h mkmap_cdb.o: ../../include/dict_cdb.h mkmap_cdb.o: ../../include/myflock.h @@ -1881,6 +1922,7 @@ mkmap_cdb.o: ../../include/vstring.h mkmap_cdb.o: mkmap.h mkmap_cdb.o: mkmap_cdb.c mkmap_db.o: ../../include/argv.h +mkmap_db.o: ../../include/check_arg.h mkmap_db.o: ../../include/dict.h mkmap_db.o: ../../include/dict_db.h mkmap_db.o: ../../include/msg.h @@ -1896,6 +1938,7 @@ mkmap_db.o: mail_params.h mkmap_db.o: mkmap.h mkmap_db.o: mkmap_db.c mkmap_dbm.o: ../../include/argv.h +mkmap_dbm.o: ../../include/check_arg.h mkmap_dbm.o: ../../include/dict.h mkmap_dbm.o: ../../include/dict_dbm.h mkmap_dbm.o: ../../include/msg.h @@ -1909,6 +1952,7 @@ mkmap_dbm.o: ../../include/vstring.h mkmap_dbm.o: mkmap.h mkmap_dbm.o: mkmap_dbm.c mkmap_fail.o: ../../include/argv.h +mkmap_fail.o: ../../include/check_arg.h mkmap_fail.o: ../../include/dict.h mkmap_fail.o: ../../include/dict_fail.h mkmap_fail.o: ../../include/myflock.h @@ -1920,6 +1964,7 @@ mkmap_fail.o: ../../include/vstring.h mkmap_fail.o: mkmap.h mkmap_fail.o: mkmap_fail.c mkmap_lmdb.o: ../../include/argv.h +mkmap_lmdb.o: ../../include/check_arg.h mkmap_lmdb.o: ../../include/dict.h mkmap_lmdb.o: ../../include/dict_lmdb.h mkmap_lmdb.o: ../../include/msg.h @@ -1936,6 +1981,7 @@ mkmap_lmdb.o: mail_params.h mkmap_lmdb.o: mkmap.h mkmap_lmdb.o: mkmap_lmdb.c mkmap_open.o: ../../include/argv.h +mkmap_open.o: ../../include/check_arg.h mkmap_open.o: ../../include/dict.h mkmap_open.o: ../../include/dict_cdb.h mkmap_open.o: ../../include/dict_db.h @@ -1956,6 +2002,7 @@ mkmap_open.o: dict_proxy.h mkmap_open.o: mkmap.h mkmap_open.o: mkmap_open.c mkmap_proxy.o: ../../include/argv.h +mkmap_proxy.o: ../../include/check_arg.h mkmap_proxy.o: ../../include/dict.h mkmap_proxy.o: ../../include/myflock.h mkmap_proxy.o: ../../include/mymalloc.h @@ -1967,6 +2014,7 @@ mkmap_proxy.o: dict_proxy.h mkmap_proxy.o: mkmap.h mkmap_proxy.o: mkmap_proxy.c mkmap_sdbm.o: ../../include/argv.h +mkmap_sdbm.o: ../../include/check_arg.h mkmap_sdbm.o: ../../include/dict.h mkmap_sdbm.o: ../../include/dict_sdbm.h mkmap_sdbm.o: ../../include/msg.h @@ -2007,6 +2055,7 @@ msg_stats_scan.o: mail_proto.h msg_stats_scan.o: msg_stats.h msg_stats_scan.o: msg_stats_scan.c mynetworks.o: ../../include/argv.h +mynetworks.o: ../../include/check_arg.h mynetworks.o: ../../include/inet_addr_list.h mynetworks.o: ../../include/inet_proto.h mynetworks.o: ../../include/mask_addr.h @@ -2035,18 +2084,21 @@ namadr_list.o: ../../include/match_list.h namadr_list.o: ../../include/sys_defs.h namadr_list.o: namadr_list.c namadr_list.o: namadr_list.h +off_cvt.o: ../../include/check_arg.h off_cvt.o: ../../include/msg.h off_cvt.o: ../../include/sys_defs.h off_cvt.o: ../../include/vbuf.h off_cvt.o: ../../include/vstring.h off_cvt.o: off_cvt.c off_cvt.o: off_cvt.h +opened.o: ../../include/check_arg.h opened.o: ../../include/msg.h opened.o: ../../include/sys_defs.h opened.o: ../../include/vbuf.h opened.o: ../../include/vstring.h opened.o: opened.c opened.o: opened.h +own_inet_addr.o: ../../include/check_arg.h own_inet_addr.o: ../../include/inet_addr_host.h own_inet_addr.o: ../../include/inet_addr_list.h own_inet_addr.o: ../../include/inet_addr_local.h @@ -2063,6 +2115,7 @@ own_inet_addr.o: mail_params.h own_inet_addr.o: own_inet_addr.c own_inet_addr.o: own_inet_addr.h pipe_command.o: ../../include/argv.h +pipe_command.o: ../../include/check_arg.h pipe_command.o: ../../include/chroot_uid.h pipe_command.o: ../../include/clean_env.h pipe_command.o: ../../include/exec_command.h @@ -2107,12 +2160,14 @@ post_mail.o: post_mail.h post_mail.o: rec_type.h post_mail.o: record.h post_mail.o: smtputf8.h +quote_821_local.o: ../../include/check_arg.h quote_821_local.o: ../../include/sys_defs.h quote_821_local.o: ../../include/vbuf.h quote_821_local.o: ../../include/vstring.h quote_821_local.o: quote_821_local.c quote_821_local.o: quote_821_local.h quote_821_local.o: quote_flags.h +quote_822_local.o: ../../include/check_arg.h quote_822_local.o: ../../include/sys_defs.h quote_822_local.o: ../../include/vbuf.h quote_822_local.o: ../../include/vstring.h @@ -2147,6 +2202,7 @@ rcpt_print.o: mail_proto.h rcpt_print.o: rcpt_print.c rcpt_print.o: rcpt_print.h rcpt_print.o: recipient_list.h +rec2stream.o: ../../include/check_arg.h rec2stream.o: ../../include/sys_defs.h rec2stream.o: ../../include/vbuf.h rec2stream.o: ../../include/vstream.h @@ -2169,6 +2225,7 @@ rec_attr_map.o: mail_proto.h rec_attr_map.o: rec_attr_map.c rec_attr_map.o: rec_attr_map.h rec_attr_map.o: rec_type.h +rec_streamlf.o: ../../include/check_arg.h rec_streamlf.o: ../../include/sys_defs.h rec_streamlf.o: ../../include/vbuf.h rec_streamlf.o: ../../include/vstream.h @@ -2179,6 +2236,7 @@ rec_streamlf.o: rec_type.h rec_streamlf.o: record.h rec_type.o: rec_type.c rec_type.o: rec_type.h +recdump.o: ../../include/check_arg.h recdump.o: ../../include/msg_vstream.h recdump.o: ../../include/sys_defs.h recdump.o: ../../include/vbuf.h @@ -2193,6 +2251,7 @@ recipient_list.o: ../../include/mymalloc.h recipient_list.o: ../../include/sys_defs.h recipient_list.o: recipient_list.c recipient_list.o: recipient_list.h +record.o: ../../include/check_arg.h record.o: ../../include/msg.h record.o: ../../include/mymalloc.h record.o: ../../include/stringops.h @@ -2204,6 +2263,7 @@ record.o: off_cvt.h record.o: rec_type.h record.o: record.c record.o: record.h +remove.o: ../../include/check_arg.h remove.o: ../../include/sys_defs.h remove.o: ../../include/vbuf.h remove.o: ../../include/vstring.h @@ -2229,6 +2289,7 @@ resolve_clnt.o: mail_proto.h resolve_clnt.o: resolve_clnt.c resolve_clnt.o: resolve_clnt.h resolve_local.o: ../../include/argv.h +resolve_local.o: ../../include/check_arg.h resolve_local.o: ../../include/dict.h resolve_local.o: ../../include/inet_addr_list.h resolve_local.o: ../../include/match_list.h @@ -2267,6 +2328,7 @@ rewrite_clnt.o: quote_822_local.h rewrite_clnt.o: quote_flags.h rewrite_clnt.o: rewrite_clnt.c rewrite_clnt.o: rewrite_clnt.h +safe_ultostr.o: ../../include/check_arg.h safe_ultostr.o: ../../include/msg.h safe_ultostr.o: ../../include/mymalloc.h safe_ultostr.o: ../../include/sys_defs.h @@ -2275,6 +2337,7 @@ safe_ultostr.o: ../../include/vstring.h safe_ultostr.o: safe_ultostr.c safe_ultostr.o: safe_ultostr.h scache.o: ../../include/argv.h +scache.o: ../../include/check_arg.h scache.o: ../../include/events.h scache.o: ../../include/msg.h scache.o: ../../include/sys_defs.h @@ -2301,6 +2364,7 @@ scache_clnt.o: mail_params.h scache_clnt.o: mail_proto.h scache_clnt.o: scache.h scache_clnt.o: scache_clnt.c +scache_multi.o: ../../include/check_arg.h scache_multi.o: ../../include/events.h scache_multi.o: ../../include/htable.h scache_multi.o: ../../include/msg.h @@ -2311,6 +2375,7 @@ scache_multi.o: ../../include/vbuf.h scache_multi.o: ../../include/vstring.h scache_multi.o: scache.h scache_multi.o: scache_multi.c +scache_single.o: ../../include/check_arg.h scache_single.o: ../../include/events.h scache_single.o: ../../include/msg.h scache_single.o: ../../include/mymalloc.h @@ -2346,6 +2411,7 @@ sent.o: sent.h sent.o: trace.h sent.o: verify.h server_acl.o: ../../include/argv.h +server_acl.o: ../../include/check_arg.h server_acl.o: ../../include/dict.h server_acl.o: ../../include/match_list.h server_acl.o: ../../include/msg.h @@ -2362,6 +2428,7 @@ server_acl.o: match_parent_style.h server_acl.o: mynetworks.h server_acl.o: server_acl.c server_acl.o: server_acl.h +smtp_reply_footer.o: ../../include/check_arg.h smtp_reply_footer.o: ../../include/mac_expand.h smtp_reply_footer.o: ../../include/mac_parse.h smtp_reply_footer.o: ../../include/msg.h @@ -2371,6 +2438,7 @@ smtp_reply_footer.o: ../../include/vstring.h smtp_reply_footer.o: dsn_util.h smtp_reply_footer.o: smtp_reply_footer.c smtp_reply_footer.o: smtp_reply_footer.h +smtp_stream.o: ../../include/check_arg.h smtp_stream.o: ../../include/iostuff.h smtp_stream.o: ../../include/msg.h smtp_stream.o: ../../include/sys_defs.h @@ -2403,6 +2471,7 @@ split_addr.o: mail_addr.h split_addr.o: mail_params.h split_addr.o: split_addr.c split_addr.o: split_addr.h +stream2rec.o: ../../include/check_arg.h stream2rec.o: ../../include/sys_defs.h stream2rec.o: ../../include/vbuf.h stream2rec.o: ../../include/vstream.h @@ -2421,12 +2490,14 @@ strip_addr.o: ../../include/sys_defs.h strip_addr.o: split_addr.h strip_addr.o: strip_addr.c strip_addr.o: strip_addr.h +sys_exits.o: ../../include/check_arg.h sys_exits.o: ../../include/msg.h sys_exits.o: ../../include/sys_defs.h sys_exits.o: ../../include/vbuf.h sys_exits.o: ../../include/vstring.h sys_exits.o: sys_exits.c sys_exits.o: sys_exits.h +timed_ipc.o: ../../include/check_arg.h timed_ipc.o: ../../include/msg.h timed_ipc.o: ../../include/sys_defs.h timed_ipc.o: ../../include/vbuf.h @@ -2434,12 +2505,14 @@ timed_ipc.o: ../../include/vstream.h timed_ipc.o: mail_params.h timed_ipc.o: timed_ipc.c timed_ipc.o: timed_ipc.h +tok822_find.o: ../../include/check_arg.h tok822_find.o: ../../include/sys_defs.h tok822_find.o: ../../include/vbuf.h tok822_find.o: ../../include/vstring.h tok822_find.o: resolve_clnt.h tok822_find.o: tok822.h tok822_find.o: tok822_find.c +tok822_node.o: ../../include/check_arg.h tok822_node.o: ../../include/mymalloc.h tok822_node.o: ../../include/sys_defs.h tok822_node.o: ../../include/vbuf.h @@ -2447,6 +2520,7 @@ tok822_node.o: ../../include/vstring.h tok822_node.o: resolve_clnt.h tok822_node.o: tok822.h tok822_node.o: tok822_node.c +tok822_parse.o: ../../include/check_arg.h tok822_parse.o: ../../include/msg.h tok822_parse.o: ../../include/stringops.h tok822_parse.o: ../../include/sys_defs.h @@ -2458,6 +2532,7 @@ tok822_parse.o: quote_flags.h tok822_parse.o: resolve_clnt.h tok822_parse.o: tok822.h tok822_parse.o: tok822_parse.c +tok822_resolve.o: ../../include/check_arg.h tok822_resolve.o: ../../include/msg.h tok822_resolve.o: ../../include/sys_defs.h tok822_resolve.o: ../../include/vbuf.h @@ -2481,6 +2556,7 @@ tok822_rewrite.o: resolve_clnt.h tok822_rewrite.o: rewrite_clnt.h tok822_rewrite.o: tok822.h tok822_rewrite.o: tok822_rewrite.c +tok822_tree.o: ../../include/check_arg.h tok822_tree.o: ../../include/mymalloc.h tok822_tree.o: ../../include/sys_defs.h tok822_tree.o: ../../include/vbuf.h @@ -2513,6 +2589,7 @@ trace.o: recipient_list.h trace.o: trace.c trace.o: trace.h user_acl.o: ../../include/argv.h +user_acl.o: ../../include/check_arg.h user_acl.o: ../../include/dict.h user_acl.o: ../../include/dict_static.h user_acl.o: ../../include/match_list.h @@ -2525,6 +2602,7 @@ user_acl.o: mypwd.h user_acl.o: string_list.h user_acl.o: user_acl.c user_acl.o: user_acl.h +uxtext.o: ../../include/check_arg.h uxtext.o: ../../include/msg.h uxtext.o: ../../include/sys_defs.h uxtext.o: ../../include/vbuf.h @@ -2596,6 +2674,7 @@ verify_sender_addr.o: rewrite_clnt.h verify_sender_addr.o: safe_ultostr.h verify_sender_addr.o: verify_sender_addr.c verify_sender_addr.o: verify_sender_addr.h +verp_sender.o: ../../include/check_arg.h verp_sender.o: ../../include/sys_defs.h verp_sender.o: ../../include/vbuf.h verp_sender.o: ../../include/vstring.h @@ -2610,6 +2689,7 @@ wildcard_inet_addr.o: ../../include/myaddrinfo.h wildcard_inet_addr.o: ../../include/sys_defs.h wildcard_inet_addr.o: wildcard_inet_addr.c wildcard_inet_addr.o: wildcard_inet_addr.h +xtext.o: ../../include/check_arg.h xtext.o: ../../include/msg.h xtext.o: ../../include/sys_defs.h xtext.o: ../../include/vbuf.h diff --git a/postfix/src/global/attr_override.c b/postfix/src/global/attr_override.c index c5bd616d8..73455d406 100644 --- a/postfix/src/global/attr_override.c +++ b/postfix/src/global/attr_override.c @@ -6,7 +6,7 @@ /* SYNOPSIS /* #include /* -/* void attr_override(bp, delimiters, parens, ... ATTR_OVER_END); +/* void attr_override(bp, delimiters, parens, ... ATTR_OVER_REQ_END); /* char *bp; /* const char *delimiters; /* const char *parens; @@ -28,21 +28,21 @@ /* See mystrtok(3) for description. Typical values are /* CHARS_COMMA_SP and CHARS_BRACE, respectively. /* .PP -/* The parens argument is followed by a list of (key, value) -/* argument pairs. Each key may appear only once. The list -/* must be terminated with ATTR_OVER_END. The following -/* describes the keys and the expected values. -/* .IP "ATTR_OVER_STR_TABLE, const ATTR_OVER_STR * -/* The second argument specifies a null-terminated table with +/* The parens argument is followed by a list of macros +/* with arguments. Each macro may appear only once. The list +/* must be terminated with ATTR_OVER_REQ_END which has no argument. +/* The following describes the expected values. +/* .IP "ATTR_OVER_REQ_STR_TABLE(const ATTR_OVER_STR *) +/* The macro argument specifies a null-terminated table with /* attribute names, assignment targets, and range limits which /* should be the same as for the corresponding main.cf parameters. -/* .IP "ATTR_OVER_TIME_TABLE, const ATTR_OVER_TIME * -/* The second argument specifies a null-terminated table with +/* .IP "ATTR_OVER_REQ_TIME_TABLE(const ATTR_OVER_TIME *) +/* The macro argument specifies a null-terminated table with /* attribute names, their default time units (leading digits /* are skipped), assignment targets, and range limits which /* should be the same as for the corresponding main.cf parameters. -/* .IP "ATTR_OVER_INT_TABLE, const ATTR_OVER_INT * -/* The second argument specifies a null-terminated table with +/* .IP "ATTR_OVER_REQ_INT_TABLE(const ATTR_OVER_INT *) +/* The macro argument specifies a null-terminated table with /* attribute names, assignment targets, and range limits which /* should be the same as for the corresponding main.cf parameters. /* SEE ALSO diff --git a/postfix/src/global/attr_override.h b/postfix/src/global/attr_override.h index 6b7828dee..575e841b0 100644 --- a/postfix/src/global/attr_override.h +++ b/postfix/src/global/attr_override.h @@ -14,6 +14,8 @@ /* * External interface. */ +#include + extern void attr_override(char *, const char *, const char *,...); typedef struct { @@ -38,11 +40,22 @@ typedef struct { int max; } ATTR_OVER_INT; +/* Type-unchecked API, internal use only. */ #define ATTR_OVER_END 0 #define ATTR_OVER_STR_TABLE 1 #define ATTR_OVER_TIME_TABLE 2 #define ATTR_OVER_INT_TABLE 3 +/* Type-checked API, external use only. */ +#define ATTR_OVER_REQ_END 0 +#define ATTR_OVER_REQ_STR_TABLE(v) ATTR_OVER_STR_TABLE, CHECK_CPTR(ATTR_OVER, ATTR_OVER_STR, (v)) +#define ATTR_OVER_REQ_TIME_TABLE(v) ATTR_OVER_TIME_TABLE, CHECK_CPTR(ATTR_OVER, ATTR_OVER_TIME, (v)) +#define ATTR_OVER_REQ_INT_TABLE(v) ATTR_OVER_INT_TABLE, CHECK_CPTR(ATTR_OVER, ATTR_OVER_INT, (v)) + +CHECK_CPTR_HELPER_DCL(ATTR_OVER, ATTR_OVER_TIME); +CHECK_CPTR_HELPER_DCL(ATTR_OVER, ATTR_OVER_STR); +CHECK_CPTR_HELPER_DCL(ATTR_OVER, ATTR_OVER_INT); + /* LICENSE /* .ad /* .fi diff --git a/postfix/src/global/dsn_mask.c b/postfix/src/global/dsn_mask.c index 8485be17f..b45342e0c 100644 --- a/postfix/src/global/dsn_mask.c +++ b/postfix/src/global/dsn_mask.c @@ -96,7 +96,7 @@ int dsn_ret_code(const char *str) const char *dsn_ret_str(int code) { - const char *cp ; + const char *cp; if ((cp = str_name_code(dsn_ret_table, code)) == 0) msg_panic("dsn_ret_str: unknown code %d", code); diff --git a/postfix/src/global/mail_connect.c b/postfix/src/global/mail_connect.c index a8ef96d13..7188f15a9 100644 --- a/postfix/src/global/mail_connect.c +++ b/postfix/src/global/mail_connect.c @@ -94,8 +94,8 @@ VSTREAM *mail_connect(const char *class, const char *name, int block_mode) timed_ipc_setup(stream); sock_name = concatenate(path, " socket", (char *) 0); vstream_control(stream, - VSTREAM_CTL_PATH, sock_name, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(sock_name), + VSTREAM_SCTL_END); myfree(sock_name); } myfree(path); diff --git a/postfix/src/global/mail_queue.c b/postfix/src/global/mail_queue.c index 6cdfa2482..3516aa9b2 100644 --- a/postfix/src/global/mail_queue.c +++ b/postfix/src/global/mail_queue.c @@ -192,7 +192,7 @@ const char *mail_queue_dir(VSTRING *buf, const char *queue_name, queue_id = STR(usec_buf); } vstring_strcat(buf, - dir_forest(hash_buf, queue_id, var_hash_queue_depth)); + dir_forest(hash_buf, queue_id, var_hash_queue_depth)); break; } } @@ -415,7 +415,7 @@ VSTREAM *mail_queue_enter(const char *queue_name, mode_t mode, } stream = vstream_fdopen(fd, O_RDWR); - vstream_control(stream, VSTREAM_CTL_PATH, STR(path_buf), VSTREAM_CTL_END); + vstream_control(stream, VSTREAM_SCTL_PATH(STR(path_buf)), VSTREAM_SCTL_END); return (stream); } diff --git a/postfix/src/global/mail_stream.c b/postfix/src/global/mail_stream.c index f760636ee..d5d551762 100644 --- a/postfix/src/global/mail_stream.c +++ b/postfix/src/global/mail_stream.c @@ -76,22 +76,22 @@ /* mail_stream_ctl() selectively overrides information that /* was specified with mail_stream_file(); none of the attributes /* are applicable for other mail stream types. The arguments -/* are a list of (operation, value) pairs, terminated with -/* MAIL_STREAM_CTL_END. The following lists the operation -/* codes and the types of the corresponding value arguments. -/* .IP "MAIL_STREAM_CTL_QUEUE (char *)" +/* are a list macros with arguments, terminated with +/* MAIL_STREAM_SCTL_END which has none. The following lists +/* the macros and the types of the corresponding arguments. +/* .IP "MAIL_STREAM_SCTL_QUEUE(const char *)" /* The argument specifies an alternate destination queue. The /* queue file is moved to the specified queue before the call /* returns. Failure to rename the queue file results in a fatal /* error. -/* .IP "MAIL_STREAM_CTL_CLASS (char *)" +/* .IP "MAIL_STREAM_SCTL_CLASS(const char *)" /* The argument specifies an alternate trigger class. -/* .IP "MAIL_STREAM_CTL_SERVICE (char *)" +/* .IP "MAIL_STREAM_SCTL_SERVICE(const char *)" /* The argument specifies an alternate trigger service. -/* .IP "MAIL_STREAM_CTL_MODE (int)" +/* .IP "MAIL_STREAM_SCTL_MODE(int)" /* The argument specifies alternate permissions that override /* the permissions specified with mail_stream_file(). -/* .IP "MAIL_STREAM_CTL_DELAY (int)" +/* .IP "MAIL_STREAM_SCTL_DELAY(int)" /* Attempt to postpone initial delivery by advancing the queue /* file modification time stamp by this amount. This has /* effect only within the deferred mail queue. @@ -481,16 +481,16 @@ MAIL_STREAM *mail_stream_command(const char *command) */ export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ); while ((stream = vstream_popen(O_RDWR, - VSTREAM_POPEN_COMMAND, command, - VSTREAM_POPEN_EXPORT, export_env->argv, - VSTREAM_POPEN_END)) == 0) { + VSTREAM_SPOPEN_COMMAND(command), + VSTREAM_SPOPEN_EXPORT(export_env->argv), + VSTREAM_SPOPEN_END)) == 0) { msg_warn("fork: %m"); sleep(10); } argv_free(export_env); vstream_control(stream, - VSTREAM_CTL_PATH, command, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(command), + VSTREAM_SCTL_END); if (attr_scan(stream, ATTR_FLAG_MISSING, RECV_ATTR_STR(MAIL_ATTR_QUEUEID, id_buf), 0) != 1) { @@ -599,8 +599,8 @@ void mail_stream_ctl(MAIL_STREAM *info, int op,...) (void) mail_queue_path(new_path, new_queue, info->id); info->queue = mystrdup(new_queue); - vstream_control(info->stream, VSTREAM_CTL_PATH, STR(new_path), - VSTREAM_CTL_END); + vstream_control(info->stream, VSTREAM_SCTL_PATH(STR(new_path)), + VSTREAM_SCTL_END); if (sane_rename(saved_path, STR(new_path)) == 0 || (mail_queue_mkdirs(STR(new_path)) == 0 diff --git a/postfix/src/global/mail_stream.h b/postfix/src/global/mail_stream.h index a8e73032e..e8169e92e 100644 --- a/postfix/src/global/mail_stream.h +++ b/postfix/src/global/mail_stream.h @@ -21,6 +21,7 @@ */ #include #include +#include /* * External interface. @@ -45,6 +46,7 @@ struct MAIL_STREAM { struct timeval ctime; /* creation time */ }; +/* Legacy type-unchecked API, internal use. */ #define MAIL_STREAM_CTL_END 0 /* Terminator */ #define MAIL_STREAM_CTL_QUEUE 1 /* Change queue */ #define MAIL_STREAM_CTL_CLASS 2 /* Change notification class */ @@ -54,6 +56,19 @@ struct MAIL_STREAM { #define MAIL_STREAM_CTL_DELAY 5 /* Change final queue file mtime */ #endif +/* Type-checked API, external use. */ +#define MAIL_STREAM_SCTL_END MAIL_STREAM_CTL_END +#define MAIL_STREAM_SCTL_QUEUE(v) MAIL_STREAM_CTL_QUEUE, CHECK_CPTR(MAIL_STREAM, char, (v)) +#define MAIL_STREAM_SCTL_CLASS(v) MAIL_STREAM_CTL_CLASS, CHECK_CPTR(MAIL_STREAM, char, (v)) +#define MAIL_STREAM_SCTL_SERVICE(v) MAIL_STREAM_CTL_SERVICE, CHECK_CPTR(MAIL_STREAM, char, (v)) +#define MAIL_STREAM_SCTL_MODE(v) MAIL_STREAM_CTL_MODE, CHECK_VAL(MAIL_STREAM, int, (v)) +#ifdef DELAY_ACTION +#define MAIL_STREAM_SCTL_DELAY(v) MAIL_STREAM_CTL_DELAY, CHECK_VAL(MAIL_STREAM, int, (v)) +#endif + +CHECK_VAL_HELPER_DCL(MAIL_STREAM, int); +CHECK_CPTR_HELPER_DCL(MAIL_STREAM, char); + extern MAIL_STREAM *mail_stream_file(const char *, const char *, const char *, int); extern MAIL_STREAM *mail_stream_service(const char *, const char *); extern MAIL_STREAM *mail_stream_command(const char *); diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 6b2949407..0ac4f4784 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 "20141217" +#define MAIL_RELEASE_DATE "20141224" #define MAIL_VERSION_NUMBER "2.12" #ifdef SNAPSHOT diff --git a/postfix/src/global/pipe_command.c b/postfix/src/global/pipe_command.c index 29c1ffb0d..cf0c4500b 100644 --- a/postfix/src/global/pipe_command.c +++ b/postfix/src/global/pipe_command.c @@ -30,67 +30,67 @@ /* a limited portion of command output, among other free text. /* .IP key /* Specifies what value will follow. pipe_command() takes a list -/* of (key, value) arguments, terminated by PIPE_CMD_END. The -/* following is a listing of key codes together with the expected -/* value type. +/* of macros with arguments, terminated by PIPE_SCMD_END which +/* has no argument. The following is a listing of macros and +/* expected argument types. /* .RS -/* .IP "PIPE_CMD_COMMAND (char *)" +/* .IP "PIPE_SCMD_COMMAND(const char *)" /* Specifies the command to execute as a string. The string is /* passed to the shell when it contains shell meta characters /* or when it appears to be a shell built-in command, otherwise /* the command is executed without invoking a shell. -/* One of PIPE_CMD_COMMAND or PIPE_CMD_ARGV must be specified. -/* See also the PIPE_CMD_SHELL attribute below. -/* .IP "PIPE_CMD_ARGV (char **)" +/* One of PIPE_SCMD_COMMAND or PIPE_SCMD_ARGV must be specified. +/* See also the PIPE_SCMD_SHELL attribute below. +/* .IP "PIPE_SCMD_ARGV(char **)" /* The command is specified as an argument vector. This vector is /* passed without further inspection to the \fIexecvp\fR() routine. -/* One of PIPE_CMD_COMMAND or PIPE_CMD_ARGV must be specified. -/* .IP "PIPE_CMD_CHROOT (char *)" +/* One of PIPE_SCMD_COMMAND or PIPE_SCMD_ARGV must be specified. +/* .IP "PIPE_SCMD_CHROOT(const char *)" /* Root and working directory for command execution. This takes -/* effect before PIPE_CMD_CWD. A null pointer means don't +/* effect before PIPE_SCMD_CWD. A null pointer means don't /* change root and working directory anyway. Failure to change /* directory causes mail delivery to be deferred. -/* .IP "PIPE_CMD_CWD (char *)" +/* .IP "PIPE_SCMD_CWD(const char *)" /* Working directory for command execution, after changing process -/* privileges to PIPE_CMD_UID and PIPE_CMD_GID. A null pointer means +/* privileges to PIPE_SCMD_UID and PIPE_SCMD_GID. A null pointer means /* don't change directory anyway. Failure to change directory /* causes mail delivery to be deferred. -/* .IP "PIPE_CMD_ENV (char **)" +/* .IP "PIPE_SCMD_ENV(char **)" /* Additional environment information, in the form of a null-terminated /* list of name, value, name, value, ... elements. By default only the /* command search path is initialized to _PATH_DEFPATH. -/* .IP "PIPE_CMD_EXPORT (char **)" +/* .IP "PIPE_SCMD_EXPORT(char **)" /* Null-terminated array with names of environment parameters /* that can be exported. By default, everything is exported. -/* .IP "PIPE_CMD_COPY_FLAGS (int)" +/* .IP "PIPE_SCMD_COPY_FLAGS(int)" /* Flags that are passed on to the \fImail_copy\fR() routine. /* The default flags value is 0 (zero). -/* .IP "PIPE_CMD_SENDER (char *)" +/* .IP "PIPE_SCMD_SENDER(const char *)" /* The envelope sender address, which is passed on to the /* \fImail_copy\fR() routine. -/* .IP "PIPE_CMD_ORIG_RCPT (char *)" +/* .IP "PIPE_SCMD_ORIG_RCPT(const char *)" /* The original recipient envelope address, which is passed on /* to the \fImail_copy\fR() routine. -/* .IP "PIPE_CMD_DELIVERED (char *)" +/* .IP "PIPE_SCMD_DELIVERED(const char *)" /* The recipient envelope address, which is passed on to the /* \fImail_copy\fR() routine. -/* .IP "PIPE_CMD_EOL (char *)" +/* .IP "PIPE_SCMD_EOL(const char *)" /* End-of-line delimiter. The default is to use the newline character. -/* .IP "PIPE_CMD_UID (uid_t)" +/* .IP "PIPE_SCMD_UID(uid_t)" /* The user ID to execute the command as. The default is /* the user ID corresponding to the \fIdefault_privs\fR /* configuration parameter. The user ID must be non-zero. -/* .IP "PIPE_CMD_GID (gid_t)" +/* .IP "PIPE_SCMD_GID(gid_t)" /* The group ID to execute the command as. The default is /* the group ID corresponding to the \fIdefault_privs\fR /* configuration parameter. The group ID must be non-zero. -/* .IP "PIPE_CMD_TIME_LIMIT (int)" +/* .IP "PIPE_SCMD_TIME_LIMIT(int)" /* The amount of time the command is allowed to run before it -/* is terminated with SIGKILL. A non-negative PIPE_CMD_TIME_LIMIT +/* is terminated with SIGKILL. A non-negative PIPE_SCMD_TIME_LIMIT /* value must be specified. -/* .IP "PIPE_CMD_SHELL (char *)" +/* .IP "PIPE_SCMD_SHELL(const char *)" /* The shell to use when executing the command specified with -/* PIPE_CMD_COMMAND. This shell is invoked regardless of the +/* PIPE_SCMD_COMMAND. This shell is invoked regardless of the /* command content. /* .RE /* DIAGNOSTICS @@ -307,7 +307,7 @@ static ssize_t pipe_command_write(int fd, void *buf, size_t len, /* pipe_command_read - read from command with time limit */ -static ssize_t pipe_command_read(int fd, void *buf, ssize_t len, +static ssize_t pipe_command_read(int fd, void *buf, size_t len, int unused_timeout, void *unused_context) { @@ -572,11 +572,11 @@ int pipe_command(VSTREAM *src, DSN_BUF *why,...) * timeouts on all I/O from and to it. */ vstream_control(cmd_in_stream, - VSTREAM_CTL_WRITE_FN, pipe_command_write, - VSTREAM_CTL_END); + VSTREAM_SCTL_WRITE_FN(pipe_command_write), + VSTREAM_SCTL_END); vstream_control(cmd_out_stream, - VSTREAM_CTL_READ_FN, pipe_command_read, - VSTREAM_CTL_END); + VSTREAM_SCTL_READ_FN(pipe_command_read), + VSTREAM_SCTL_END); pipe_command_timeout = 0; /* diff --git a/postfix/src/global/pipe_command.h b/postfix/src/global/pipe_command.h index 339ac5ec0..02cac18e3 100644 --- a/postfix/src/global/pipe_command.h +++ b/postfix/src/global/pipe_command.h @@ -16,6 +16,7 @@ */ #include #include +#include /* * Global library. @@ -24,24 +25,50 @@ #include /* - * Request arguments. + * Legacy API: type-unchecked arguments, internal use. */ #define PIPE_CMD_END 0 /* terminator */ #define PIPE_CMD_COMMAND 1 /* command is string */ -#define PIPE_CMD_ARGV 2 /* command is array */ +#define PIPE_CMD_ARGV 2 /* command is array */ #define PIPE_CMD_COPY_FLAGS 3 /* mail_copy() flags */ -#define PIPE_CMD_SENDER 4 /* mail_copy() sender */ +#define PIPE_CMD_SENDER 4 /* mail_copy() sender */ #define PIPE_CMD_DELIVERED 5 /* mail_copy() recipient */ #define PIPE_CMD_UID 6 /* privileges */ #define PIPE_CMD_GID 7 /* privileges */ #define PIPE_CMD_TIME_LIMIT 8 /* time limit */ #define PIPE_CMD_ENV 9 /* extra environment */ -#define PIPE_CMD_SHELL 10 /* alternative shell */ +#define PIPE_CMD_SHELL 10 /* alternative shell */ #define PIPE_CMD_EOL 11 /* record delimiter */ -#define PIPE_CMD_EXPORT 12 /* exportable environment */ +#define PIPE_CMD_EXPORT 12 /* exportable environment */ #define PIPE_CMD_ORIG_RCPT 13 /* mail_copy() original recipient */ #define PIPE_CMD_CWD 14 /* working directory */ -#define PIPE_CMD_CHROOT 15 /* chroot() before exec() */ +#define PIPE_CMD_CHROOT 15 /* chroot() before exec() */ + + /* + * Safer API: type-checked arguments, external use. + */ +#define PIPE_SCMD_END PIPE_CMD_END +#define PIPE_SCMD_COMMAND(v) PIPE_CMD_COMMAND, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_ARGV(v) PIPE_CMD_ARGV, CHECK_PPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_COPY_FLAGS(v) PIPE_CMD_COPY_FLAGS, CHECK_VAL(PIPE_SCMD, int, (v)) +#define PIPE_SCMD_SENDER(v) PIPE_CMD_SENDER, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_DELIVERED(v) PIPE_CMD_DELIVERED, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_UID(v) PIPE_CMD_UID, CHECK_VAL(PIPE_SCMD, uid_t, (v)) +#define PIPE_SCMD_GID(v) PIPE_CMD_GID, CHECK_VAL(PIPE_SCMD, gid_t, (v)) +#define PIPE_SCMD_TIME_LIMIT(v) PIPE_CMD_TIME_LIMIT, CHECK_VAL(PIPE_SCMD, int, (v)) +#define PIPE_SCMD_ENV(v) PIPE_CMD_ENV, CHECK_PPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_SHELL(v) PIPE_CMD_SHELL, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_EOL(v) PIPE_CMD_EOL, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_EXPORT(v) PIPE_CMD_EXPORT, CHECK_PPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_ORIG_RCPT(v) PIPE_CMD_ORIG_RCPT, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_CWD(v) PIPE_CMD_CWD, CHECK_CPTR(PIPE_SCMD, char, (v)) +#define PIPE_SCMD_CHROOT(v) PIPE_CMD_CHROOT, CHECK_CPTR(PIPE_SCMD, char, (v)) + +CHECK_VAL_HELPER_DCL(PIPE_SCMD, uid_t); +CHECK_VAL_HELPER_DCL(PIPE_SCMD, int); +CHECK_VAL_HELPER_DCL(PIPE_SCMD, gid_t); +CHECK_PPTR_HELPER_DCL(PIPE_SCMD, char); +CHECK_CPTR_HELPER_DCL(PIPE_SCMD, char); /* * Command completion status. diff --git a/postfix/src/global/smtp_stream.c b/postfix/src/global/smtp_stream.c index 4893f4082..967154b2b 100644 --- a/postfix/src/global/smtp_stream.c +++ b/postfix/src/global/smtp_stream.c @@ -182,7 +182,7 @@ static void smtp_timeout_reset(VSTREAM *stream) * sending body content one line at a time. */ if (vstream_fstat(stream, VSTREAM_FLAG_DEADLINE)) - vstream_control(stream, VSTREAM_CTL_START_DEADLINE, VSTREAM_CTL_END); + vstream_control(stream, VSTREAM_SCTL_START_DEADLINE, VSTREAM_SCTL_END); } /* smtp_longjmp - raise an exception */ @@ -215,12 +215,12 @@ void smtp_stream_setup(VSTREAM *stream, int maxtime, int enable_deadline) myname, maxtime, enable_deadline); vstream_control(stream, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_TIMEOUT, maxtime, - enable_deadline ? VSTREAM_CTL_START_DEADLINE - : VSTREAM_CTL_STOP_DEADLINE, - VSTREAM_CTL_EXCEPT, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_TIMEOUT(maxtime), + enable_deadline ? VSTREAM_SCTL_START_DEADLINE + : VSTREAM_SCTL_STOP_DEADLINE, + VSTREAM_SCTL_EXCEPT, + VSTREAM_SCTL_END); } /* smtp_flush - flush stream */ diff --git a/postfix/src/global/strip_addr.c b/postfix/src/global/strip_addr.c index 6792d35f3..95365c202 100644 --- a/postfix/src/global/strip_addr.c +++ b/postfix/src/global/strip_addr.c @@ -105,7 +105,7 @@ int main(int unused_argc, char **unused_argv) { char *extension; char *stripped; - char* delim = "+-"; + char *delim = "+-"; #define NO_DELIM "" diff --git a/postfix/src/global/sys_exits.c b/postfix/src/global/sys_exits.c index 05d1afd49..1e628d785 100644 --- a/postfix/src/global/sys_exits.c +++ b/postfix/src/global/sys_exits.c @@ -106,7 +106,7 @@ static SYS_EXITS_DETAIL *sys_exits_fake(int code) vstring_sprintf(sys_exits_def_text, "unknown mail system error %d", code); sys_exits_default->text = vstring_str(sys_exits_def_text); - return(sys_exits_default); + return (sys_exits_default); } /* sys_exits_strerror - map exit status to error string */ diff --git a/postfix/src/global/timed_ipc.c b/postfix/src/global/timed_ipc.c index a4640e083..94ac7e072 100644 --- a/postfix/src/global/timed_ipc.c +++ b/postfix/src/global/timed_ipc.c @@ -50,6 +50,6 @@ void timed_ipc_setup(VSTREAM *stream) msg_panic("timed_ipc_setup: bad ipc_timeout %d", var_ipc_timeout); vstream_control(stream, - VSTREAM_CTL_TIMEOUT, var_ipc_timeout, - VSTREAM_CTL_END); + VSTREAM_SCTL_TIMEOUT(var_ipc_timeout), + VSTREAM_SCTL_END); } diff --git a/postfix/src/local/command.c b/postfix/src/local/command.c index 04fcc0d43..f18aa2e8b 100644 --- a/postfix/src/local/command.c +++ b/postfix/src/local/command.c @@ -206,20 +206,20 @@ int deliver_command(LOCAL_STATE state, USER_ATTR usr_attr, const char *comma VAR_EXEC_DIRECTORY, var_exec_directory); } else { cmd_status = pipe_command(state.msg_attr.fp, why, - PIPE_CMD_UID, usr_attr.uid, - PIPE_CMD_GID, usr_attr.gid, - PIPE_CMD_COMMAND, command, - PIPE_CMD_COPY_FLAGS, copy_flags, - PIPE_CMD_SENDER, state.msg_attr.sender, - PIPE_CMD_ORIG_RCPT, state.msg_attr.rcpt.orig_addr, - PIPE_CMD_DELIVERED, state.msg_attr.delivered, - PIPE_CMD_TIME_LIMIT, var_command_maxtime, - PIPE_CMD_ENV, env->argv, - PIPE_CMD_EXPORT, export_env->argv, - PIPE_CMD_SHELL, var_local_cmd_shell, - PIPE_CMD_CWD, *STR(exec_dir) ? - STR(exec_dir) : (char *) 0, - PIPE_CMD_END); + PIPE_SCMD_UID(usr_attr.uid), + PIPE_SCMD_GID(usr_attr.gid), + PIPE_SCMD_COMMAND(command), + PIPE_SCMD_COPY_FLAGS(copy_flags), + PIPE_SCMD_SENDER(state.msg_attr.sender), + PIPE_SCMD_ORIG_RCPT(state.msg_attr.rcpt.orig_addr), + PIPE_SCMD_DELIVERED(state.msg_attr.delivered), + PIPE_SCMD_TIME_LIMIT(var_command_maxtime), + PIPE_SCMD_ENV(env->argv), + PIPE_SCMD_EXPORT(export_env->argv), + PIPE_SCMD_SHELL(var_local_cmd_shell), + PIPE_SCMD_CWD(*STR(exec_dir) ? + STR(exec_dir) : (char *) 0), + PIPE_SCMD_END); } vstring_free(exec_dir); argv_free(export_env); diff --git a/postfix/src/local/local.c b/postfix/src/local/local.c index 6b82dd321..b548e29b8 100644 --- a/postfix/src/local/local.c +++ b/postfix/src/local/local.c @@ -935,17 +935,17 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, local_service, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_LONG_TABLE, long_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_RAW_TABLE, raw_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, pre_init, - MAIL_SERVER_POST_INIT, post_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_PRIVILEGED, - MAIL_SERVER_BOUNCE_INIT, VAR_LOCAL_DSN_FILTER, - &var_local_dsn_filter, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_LONG_TABLE(long_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_RAW_TABLE(raw_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(pre_init), + MAIL_SERVER_REQ_POST_INIT(post_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_PRIVILEGED, + MAIL_SERVER_REQ_BOUNCE_INIT(VAR_LOCAL_DSN_FILTER, + &var_local_dsn_filter), 0); } diff --git a/postfix/src/master/Makefile.in b/postfix/src/master/Makefile.in index 450617a83..0a608b9bd 100644 --- a/postfix/src/master/Makefile.in +++ b/postfix/src/master/Makefile.in @@ -137,6 +137,7 @@ mail_flow.o: mail_flow.c mail_flow.o: mail_flow.h mail_flow.o: master_proto.h master.o: ../../include/argv.h +master.o: ../../include/check_arg.h master.o: ../../include/clean_env.h master.o: ../../include/debug_process.h master.o: ../../include/events.h @@ -209,6 +210,7 @@ master_flow.o: ../../include/sys_defs.h master_flow.o: master.h master_flow.o: master_flow.c master_flow.o: master_proto.h +master_listen.o: ../../include/check_arg.h master_listen.o: ../../include/htable.h master_listen.o: ../../include/inet_addr_list.h master_listen.o: ../../include/iostuff.h @@ -250,6 +252,7 @@ master_sig.o: master.h master_sig.o: master_sig.c master_spawn.o: ../../include/argv.h master_spawn.o: ../../include/binhash.h +master_spawn.o: ../../include/check_arg.h master_spawn.o: ../../include/events.h master_spawn.o: ../../include/mail_conf.h master_spawn.o: ../../include/msg.h @@ -268,6 +271,7 @@ master_status.o: ../../include/sys_defs.h master_status.o: master.h master_status.o: master_proto.h master_status.o: master_status.c +master_vars.o: ../../include/check_arg.h master_vars.o: ../../include/mail_conf.h master_vars.o: ../../include/mail_params.h master_vars.o: ../../include/msg.h @@ -283,6 +287,7 @@ master_wakeup.o: ../../include/check_arg.h master_wakeup.o: ../../include/events.h master_wakeup.o: ../../include/htable.h master_wakeup.o: ../../include/iostuff.h +master_wakeup.o: ../../include/mail_conf.h master_wakeup.o: ../../include/mail_params.h master_wakeup.o: ../../include/mail_proto.h master_wakeup.o: ../../include/msg.h diff --git a/postfix/src/master/event_server.c b/postfix/src/master/event_server.c index 356c36081..8c3d69906 100644 --- a/postfix/src/master/event_server.c +++ b/postfix/src/master/event_server.c @@ -46,63 +46,63 @@ /* file. The argv argument specifies command-line arguments /* left over after options processing. /* .PP -/* Optional arguments are specified as a null-terminated (key, value) -/* list. Keys and expected values are: -/* .IP "MAIL_SERVER_INT_TABLE (CONFIG_INT_TABLE *)" +/* Optional arguments are specified as a null-terminated list +/* with macros that have zero or more arguments: +/* .IP "MAIL_SERVER_REQ_REQ_INT_TABLE(CONFIG_INT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_LONG_TABLE (CONFIG_LONG_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_LONG_TABLE(CONFIG_LONG_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_STR_TABLE (CONFIG_STR_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_STR_TABLE(CONFIG_STR_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_BOOL_TABLE (CONFIG_BOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_BOOL_TABLE(CONFIG_BOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_TIME_TABLE (CONFIG_TIME_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_TIME_TABLE(CONFIG_TIME_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_RAW_TABLE (CONFIG_RAW_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_RAW_TABLE(CONFIG_RAW_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. Raw parameters are not subjected to $name /* evaluation. -/* .IP "MAIL_SERVER_NINT_TABLE (CONFIG_NINT_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_NINT_TABLE(CONFIG_NINT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_NBOOL_TABLE (CONFIG_NBOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_REQ_NBOOL_TABLE(CONFIG_NBOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_REQ_PRE_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_REQ_POST_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_REQ_LOOP(int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. @@ -110,35 +110,35 @@ /* the next event. Specify -1 to wait for "as long as it takes". /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_EXIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_EXIT(void *(char *service_name, char **argv))" /* A pointer to function that is executed immediately before normal /* process termination. -/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_ACCEPT(void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new connection. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_PRE_DISCONN (VSTREAM *, char *service_name, char **argv)" +/* .IP "MAIL_SERVER_REQ_PRE_DISCONN(VSTREAM *, char *service_name, char **argv)" /* A pointer to a function that is called /* by the event_server_disconnect() function (see below). /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)" +/* .IP "MAIL_SERVER_REQ_IN_FLOW_DELAY /* Pause $in_flow_delay seconds when no "mail flow control token" /* is available. A token is consumed for each connection request. -/* .IP MAIL_SERVER_SOLITARY +/* .IP MAIL_SERVER_REQ_SOLITARY /* This service must be configured with process limit of 1. -/* .IP MAIL_SERVER_UNLIMITED +/* .IP MAIL_SERVER_REQ_UNLIMITED /* This service must be configured with process limit of 0. -/* .IP MAIL_SERVER_PRIVILEGED +/* .IP MAIL_SERVER_REQ_PRIVILEGED /* This service must be configured as privileged. -/* .IP "MAIL_SERVER_SLOW_EXIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_SLOW_EXIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called after "postfix reload" /* or "master exit". The application can call event_server_drain() /* (see below) to finish ongoing activities in the background. -/* .IP "MAIL_SERVER_WATCHDOG (int *)" +/* .IP "MAIL_SERVER_REQ_WATCHDOG(int *)" /* Override the default 1000s watchdog timeout. The value is /* used after command-line and main.cf file processing. -/* .IP "MAIL_SERVER_BOUNCE_INIT (const char *, const char **)" +/* .IP "MAIL_SERVER_REQ_BOUNCE_INIT(const char *, const char **)" /* Initialize the DSN filter for the bounce/defer service /* clients with the specified map source and map names. /* .PP @@ -401,9 +401,9 @@ static void event_server_wakeup(int fd, HTABLE *attr) stream = vstream_fdopen(fd, O_RDWR); tmp = concatenate(event_server_name, " socket", (char *) 0); vstream_control(stream, - VSTREAM_CTL_PATH, tmp, - VSTREAM_CTL_CONTEXT, (void *) attr, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(tmp), + VSTREAM_SCTL_CONTEXT((void *) attr), + VSTREAM_SCTL_END); myfree(tmp); timed_ipc_setup(stream); event_server_saved_flags = vstream_flags(stream); @@ -885,9 +885,9 @@ NORETURN event_server_main(int argc, char **argv, MULTI_SERVER_FN service,...) */ if (stream != 0) { vstream_control(stream, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_WRITE_FD, STDOUT_FILENO, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_WRITE_FD(STDOUT_FILENO), + VSTREAM_SCTL_END); service(stream, event_server_name, event_server_argv); vstream_fflush(stream); event_server_exit(); diff --git a/postfix/src/master/mail_server.h b/postfix/src/master/mail_server.h index cdd946943..3fb8ebd73 100644 --- a/postfix/src/master/mail_server.h +++ b/postfix/src/master/mail_server.h @@ -13,6 +13,11 @@ */ #include + /* + * Global library. + */ +#include + /* * External interface. Tables are defined in mail_conf.h. */ @@ -47,6 +52,47 @@ typedef void (*MAIL_SERVER_ACCEPT_FN) (char *, char **); typedef void (*MAIL_SERVER_DISCONN_FN) (VSTREAM *, char *, char **); typedef void (*MAIL_SERVER_SLOW_EXIT_FN) (char *, char **); +/* Type-checked API for external use. */ +#define MAIL_SERVER_REQ_INT_TABLE(v) MAIL_SERVER_INT_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_INT_TABLE, (v)) +#define MAIL_SERVER_REQ_STR_TABLE(v) MAIL_SERVER_STR_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_STR_TABLE, (v)) +#define MAIL_SERVER_REQ_BOOL_TABLE(v) MAIL_SERVER_BOOL_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_BOOL_TABLE, (v)) +#define MAIL_SERVER_REQ_TIME_TABLE(v) MAIL_SERVER_TIME_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_TIME_TABLE, (v)) +#define MAIL_SERVER_REQ_RAW_TABLE(v) MAIL_SERVER_RAW_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_RAW_TABLE, (v)) +#define MAIL_SERVER_REQ_NINT_TABLE(v) MAIL_SERVER_NINT_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_NINT_TABLE, (v)) +#define MAIL_SERVER_REQ_NBOOL_TABLE(v) MAIL_SERVER_NBOOL_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_NBOOL_TABLE, (v)) +#define MAIL_SERVER_REQ_LONG_TABLE(v) MAIL_SERVER_LONG_TABLE, CHECK_CPTR(MAIL_SERVER, CONFIG_LONG_TABLE, (v)) +#define MAIL_SERVER_REQ_PRE_INIT(v) MAIL_SERVER_PRE_INIT, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_INIT_FN, (v)) +#define MAIL_SERVER_REQ_POST_INIT(v) MAIL_SERVER_POST_INIT, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_INIT_FN, (v)) +#define MAIL_SERVER_REQ_LOOP(v) MAIL_SERVER_LOOP, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_LOOP_FN, (v)) +#define MAIL_SERVER_REQ_EXIT(v) MAIL_SERVER_EXIT, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_EXIT_FN, (v)) +#define MAIL_SERVER_REQ_PRE_ACCEPT(v) MAIL_SERVER_PRE_ACCEPT, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_ACCEPT_FN, (v)) +#define MAIL_SERVER_REQ_SOLITARY MAIL_SERVER_SOLITARY +#define MAIL_SERVER_REQ_UNLIMITED MAIL_SERVER_UNLIMITED +#define MAIL_SERVER_REQ_PRE_DISCONN(v) MAIL_SERVER_PRE_DISCONN, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_DISCONN_FN, (v)) +#define MAIL_SERVER_REQ_PRIVILEGED MAIL_SERVER_PRIVILEGED +#define MAIL_SERVER_REQ_WATCHDOG(v) MAIL_SERVER_WATCHDOG, CHECK_PTR(MAIL_SERVER, int, (v)) +#define MAIL_SERVER_REQ_IN_FLOW_DELAY MAIL_SERVER_IN_FLOW_DELAY +#define MAIL_SERVER_REQ_SLOW_EXIT(v) MAIL_SERVER_SLOW_EXIT, CHECK_VAL(MAIL_SERVER, MAIL_SERVER_SLOW_EXIT_FN, (v)) +#define MAIL_SERVER_REQ_BOUNCE_INIT(v, w) MAIL_SERVER_BOUNCE_INIT, CHECK_PTR(MAIL_SERVER, char, (v)), CHECK_PPTR(MAIL_SERVER, char, (w)) + +CHECK_VAL_HELPER_DCL(MAIL_SERVER, MAIL_SERVER_SLOW_EXIT_FN); +CHECK_VAL_HELPER_DCL(MAIL_SERVER, MAIL_SERVER_LOOP_FN); +CHECK_VAL_HELPER_DCL(MAIL_SERVER, MAIL_SERVER_INIT_FN); +CHECK_VAL_HELPER_DCL(MAIL_SERVER, MAIL_SERVER_EXIT_FN); +CHECK_VAL_HELPER_DCL(MAIL_SERVER, MAIL_SERVER_DISCONN_FN); +CHECK_VAL_HELPER_DCL(MAIL_SERVER, MAIL_SERVER_ACCEPT_FN); +CHECK_PTR_HELPER_DCL(MAIL_SERVER, int); +CHECK_PTR_HELPER_DCL(MAIL_SERVER, char); +CHECK_PPTR_HELPER_DCL(MAIL_SERVER, char); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_TIME_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_STR_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_RAW_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_NINT_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_NBOOL_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_LONG_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_INT_TABLE); +CHECK_CPTR_HELPER_DCL(MAIL_SERVER, CONFIG_BOOL_TABLE); + /* * single_server.c */ diff --git a/postfix/src/master/multi_server.c b/postfix/src/master/multi_server.c index 995b98550..d2e86644a 100644 --- a/postfix/src/master/multi_server.c +++ b/postfix/src/master/multi_server.c @@ -43,63 +43,63 @@ /* The argv argument specifies command-line arguments left over /* after options processing. /* .PP -/* Optional arguments are specified as a null-terminated (key, value) -/* list. Keys and expected values are: -/* .IP "MAIL_SERVER_INT_TABLE (CONFIG_INT_TABLE *)" +/* Optional arguments are specified as a null-terminated list +/* with macros that have zero or more arguments: +/* .IP "MAIL_SERVER_REQ_INT_TABLE(CONFIG_INT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_LONG_TABLE (CONFIG_LONG_TABLE *)" +/* .IP "MAIL_SERVER_REQ_LONG_TABLE(CONFIG_LONG_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_STR_TABLE (CONFIG_STR_TABLE *)" +/* .IP "MAIL_SERVER_REQ_STR_TABLE(CONFIG_STR_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_BOOL_TABLE (CONFIG_BOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_BOOL_TABLE(CONFIG_BOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_TIME_TABLE (CONFIG_TIME_TABLE *)" +/* .IP "MAIL_SERVER_REQ_TIME_TABLE(CONFIG_TIME_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_RAW_TABLE (CONFIG_RAW_TABLE *)" +/* .IP "MAIL_SERVER_REQ_RAW_TABLE(CONFIG_RAW_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. Raw parameters are not subjected to $name /* evaluation. -/* .IP "MAIL_SERVER_NINT_TABLE (CONFIG_NINT_TABLE *)" +/* .IP "MAIL_SERVER_REQ_NINT_TABLE(CONFIG_NINT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_NBOOL_TABLE (CONFIG_NBOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_NBOOL_TABLE(CONFIG_NBOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_POST_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_LOOP(int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. @@ -107,28 +107,28 @@ /* the next event. Specify -1 to wait for "as long as it takes". /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_EXIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_EXIT(void *(char *service_name, char **argv))" /* A pointer to function that is executed immediately before normal /* process termination. -/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_ACCEPT(void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new connection. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_PRE_DISCONN (VSTREAM *, char *service_name, char **argv)" +/* .IP "MAIL_SERVER_REQ_PRE_DISCONN(VSTREAM *, char *service_name, char **argv)" /* A pointer to a function that is called /* by the multi_server_disconnect() function (see below). /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)" +/* .IP "MAIL_SERVER_REQ_IN_FLOW_DELAY /* Pause $in_flow_delay seconds when no "mail flow control token" /* is available. A token is consumed for each connection request. -/* .IP MAIL_SERVER_SOLITARY +/* .IP MAIL_SERVER_REQ_SOLITARY /* This service must be configured with process limit of 1. -/* .IP MAIL_SERVER_UNLIMITED +/* .IP MAIL_SERVER_REQ_UNLIMITED /* This service must be configured with process limit of 0. -/* .IP MAIL_SERVER_PRIVILEGED +/* .IP MAIL_SERVER_REQ_PRIVILEGED /* This service must be configured as privileged. -/* .IP "MAIL_SERVER_BOUNCE_INIT (const char *, const char **)" +/* .IP "MAIL_SERVER_REQ_BOUNCE_INIT(const char *, const char **)" /* Initialize the DSN filter for the bounce/defer service /* clients with the specified map source and map names. /* .PP @@ -397,9 +397,9 @@ static void multi_server_wakeup(int fd, HTABLE *attr) stream = vstream_fdopen(fd, O_RDWR); tmp = concatenate(multi_server_name, " socket", (char *) 0); vstream_control(stream, - VSTREAM_CTL_PATH, tmp, - VSTREAM_CTL_CONTEXT, (void *) attr, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(tmp), + VSTREAM_SCTL_CONTEXT((void *) attr), + VSTREAM_SCTL_END); myfree(tmp); timed_ipc_setup(stream); multi_server_saved_flags = vstream_flags(stream); @@ -875,9 +875,9 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...) */ if (stream != 0) { vstream_control(stream, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_WRITE_FD, STDOUT_FILENO, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_WRITE_FD(STDOUT_FILENO), + VSTREAM_SCTL_END); service(stream, multi_server_name, multi_server_argv); vstream_fflush(stream); multi_server_exit(); diff --git a/postfix/src/master/single_server.c b/postfix/src/master/single_server.c index 41b47311e..9fbde0234 100644 --- a/postfix/src/master/single_server.c +++ b/postfix/src/master/single_server.c @@ -36,63 +36,63 @@ /* The argv argument specifies command-line arguments left over /* after options processing. /* .PP -/* Optional arguments are specified as a null-terminated (key, value) -/* list. Keys and expected values are: -/* .IP "MAIL_SERVER_INT_TABLE (CONFIG_INT_TABLE *)" +/* Optional arguments are specified as a null-terminated list +/* with macros that have zero or more arguments: +/* .IP "MAIL_SERVER_REQ_INT_TABLE(CONFIG_INT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_LONG_TABLE (CONFIG_LONG_TABLE *)" +/* .IP "MAIL_SERVER_REQ_LONG_TABLE(CONFIG_LONG_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_STR_TABLE (CONFIG_STR_TABLE *)" +/* .IP "MAIL_SERVER_REQ_STR_TABLE(CONFIG_STR_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_BOOL_TABLE (CONFIG_BOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_BOOL_TABLE(CONFIG_BOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_TIME_TABLE (CONFIG_TIME_TABLE *)" +/* .IP "MAIL_SERVER_REQ_TIME_TABLE(CONFIG_TIME_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_RAW_TABLE (CONFIG_RAW_TABLE *)" +/* .IP "MAIL_SERVER_REQ_RAW_TABLE(CONFIG_RAW_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. Raw parameters are not subjected to $name /* evaluation. -/* .IP "MAIL_SERVER_NINT_TABLE (CONFIG_NINT_TABLE *)" +/* .IP "MAIL_SERVER_REQ_NINT_TABLE(CONFIG_NINT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_NBOOL_TABLE (CONFIG_NBOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_NBOOL_TABLE(CONFIG_NBOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_POST_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_LOOP(int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. @@ -100,25 +100,25 @@ /* the next event. Specify -1 to wait for "as long as it takes". /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_EXIT (void *(void))" +/* .IP "MAIL_SERVER_REQ_EXIT(void *(void))" /* A pointer to function that is executed immediately before normal /* process termination. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_ACCEPT(void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new connection. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)" +/* .IP "MAIL_SERVER_REQ_IN_FLOW_DELAY(none)" /* Pause $in_flow_delay seconds when no "mail flow control token" /* is available. A token is consumed for each connection request. -/* .IP MAIL_SERVER_SOLITARY +/* .IP MAIL_SERVER_REQ_SOLITARY /* This service must be configured with process limit of 1. -/* .IP MAIL_SERVER_UNLIMITED +/* .IP MAIL_SERVER_REQ_UNLIMITED /* This service must be configured with process limit of 0. -/* .IP MAIL_SERVER_PRIVILEGED +/* .IP MAIL_SERVER_REQ_PRIVILEGED /* This service must be configured as privileged. -/* .IP "MAIL_SERVER_BOUNCE_INIT (const char *, const char **)" +/* .IP "MAIL_SERVER_REQ_BOUNCE_INIT(const char *, const char **)" /* Initialize the DSN filter for the bounce/defer service /* clients with the specified map source and map names. /* .PP @@ -270,9 +270,9 @@ static void single_server_wakeup(int fd, HTABLE *attr) stream = vstream_fdopen(fd, O_RDWR); tmp = concatenate(single_server_name, " socket", (char *) 0); vstream_control(stream, - VSTREAM_CTL_PATH, tmp, - VSTREAM_CTL_CONTEXT, (void *) attr, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(tmp), + VSTREAM_SCTL_CONTEXT((void *) attr), + VSTREAM_SCTL_END); myfree(tmp); timed_ipc_setup(stream); if (master_notify(var_pid, single_server_generation, MASTER_STAT_TAKEN) < 0) @@ -743,9 +743,9 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...) */ if (stream != 0) { vstream_control(stream, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_WRITE_FD, STDOUT_FILENO, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_WRITE_FD(STDOUT_FILENO), + VSTREAM_SCTL_END); service(stream, single_server_name, single_server_argv); vstream_fflush(stream); single_server_exit(); diff --git a/postfix/src/master/trigger_server.c b/postfix/src/master/trigger_server.c index ef545eec2..a7f26c6ca 100644 --- a/postfix/src/master/trigger_server.c +++ b/postfix/src/master/trigger_server.c @@ -41,63 +41,63 @@ /* after options processing. /* The \fBserver\fR argument provides the following information: /* .PP -/* Optional arguments are specified as a null-terminated (key, value) -/* list. Keys and expected values are: -/* .IP "MAIL_SERVER_INT_TABLE (CONFIG_INT_TABLE *)" +/* Optional arguments are specified as a null-terminated list +/* with macros that have zero or more arguments: +/* .IP "MAIL_SERVER_REQ_INT_TABLE(CONFIG_INT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_LONG_TABLE (CONFIG_LONG_TABLE *)" +/* .IP "MAIL_SERVER_REQ_LONG_TABLE(CONFIG_LONG_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_STR_TABLE (CONFIG_STR_TABLE *)" +/* .IP "MAIL_SERVER_REQ_STR_TABLE(CONFIG_STR_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_BOOL_TABLE (CONFIG_BOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_BOOL_TABLE(CONFIG_BOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_TIME_TABLE (CONFIG_TIME_TABLE *)" +/* .IP "MAIL_SERVER_REQ_TIME_TABLE(CONFIG_TIME_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_RAW_TABLE (CONFIG_RAW_TABLE *)" +/* .IP "MAIL_SERVER_REQ_RAW_TABLE(CONFIG_RAW_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. Raw parameters are not subjected to $name /* evaluation. -/* .IP "MAIL_SERVER_NINT_TABLE (CONFIG_NINT_TABLE *)" +/* .IP "MAIL_SERVER_REQ_NINT_TABLE(CONFIG_NINT_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_NBOOL_TABLE (CONFIG_NBOOL_TABLE *)" +/* .IP "MAIL_SERVER_REQ_NBOOL_TABLE(CONFIG_NBOOL_TABLE *)" /* A table with configurable parameters, to be loaded from the /* global Postfix configuration file. Tables are loaded in the /* order as specified, and multiple instances of the same type /* are allowed. -/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_POST_INIT(void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_LOOP(int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. @@ -105,28 +105,28 @@ /* the next event. Specify -1 to wait for "as long as it takes". /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_EXIT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_EXIT(void *(char *service_name, char **argv))" /* A pointer to function that is executed immediately before normal /* process termination. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" +/* .IP "MAIL_SERVER_REQ_PRE_ACCEPT(void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new request. /* .sp /* Only the last instance of this parameter type is remembered. -/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)" +/* .IP "MAIL_SERVER_REQ_IN_FLOW_DELAY(none)" /* Pause $in_flow_delay seconds when no "mail flow control token" /* is available. A token is consumed for each connection request. -/* .IP MAIL_SERVER_SOLITARY +/* .IP MAIL_SERVER_REQ_SOLITARY /* This service must be configured with process limit of 1. -/* .IP MAIL_SERVER_UNLIMITED +/* .IP MAIL_SERVER_REQ_UNLIMITED /* This service must be configured with process limit of 0. -/* .IP MAIL_SERVER_PRIVILEGED +/* .IP MAIL_SERVER_REQ_PRIVILEGED /* This service must be configured as privileged. -/* .IP "MAIL_SERVER_WATCHDOG (int *)" +/* .IP "MAIL_SERVER_REQ_WATCHDOG(int *)" /* Override the default 1000s watchdog timeout. The value is /* used after command-line and main.cf file processing. -/* .IP "MAIL_SERVER_BOUNCE_INIT (const char *, const char **)" +/* .IP "MAIL_SERVER_REQ_BOUNCE_INIT(const char *, const char **)" /* Initialize the DSN filter for the bounce/defer service /* clients with the specified map source and map names. /* .PP diff --git a/postfix/src/milter/milter.c b/postfix/src/milter/milter.c index 5b067a532..734bf4cb7 100644 --- a/postfix/src/milter/milter.c +++ b/postfix/src/milter/milter.c @@ -622,9 +622,9 @@ MILTERS *milter_new(const char *names, if ((name = mystrtok(&op, sep)) == 0) msg_fatal("empty milter definition: \"%s\"", names); attr_override(op, sep, parens, - ATTR_OVER_STR_TABLE, str_table, - ATTR_OVER_TIME_TABLE, time_table, - 0); + ATTR_OVER_REQ_STR_TABLE(str_table), + ATTR_OVER_REQ_TIME_TABLE(time_table), + ATTR_OVER_REQ_END); } milter = milter8_create(name, my_conn_timeout, my_cmd_timeout, my_msg_timeout, my_protocol, diff --git a/postfix/src/milter/milter8.c b/postfix/src/milter/milter8.c index c813d3c8b..f6c11d2eb 100644 --- a/postfix/src/milter/milter8.c +++ b/postfix/src/milter/milter8.c @@ -1723,9 +1723,9 @@ static void milter8_connect(MILTER8 *milter) myfree(transport); milter->fp = vstream_fdopen(fd, O_RDWR); vstream_control(milter->fp, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_TIMEOUT, milter->cmd_timeout, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_TIMEOUT(milter->cmd_timeout), + VSTREAM_SCTL_END); /* Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. */ if (connect_fn == inet_connect) vstream_tweak_tcp(milter->fp); @@ -2567,9 +2567,9 @@ static const char *milter8_message(MILTER *m, VSTREAM *qfile, milter->state = MILTER8_STAT_MESSAGE; VSTRING_RESET(milter->body); vstream_control(milter->fp, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_TIMEOUT, milter->msg_timeout, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_TIMEOUT(milter->msg_timeout), + VSTREAM_SCTL_END); /* * XXX When the message (not MIME body part) does not end in CRLF @@ -2602,9 +2602,9 @@ static const char *milter8_message(MILTER *m, VSTREAM *qfile, vstring_free(buf); if (milter->fp) vstream_control(milter->fp, - VSTREAM_CTL_DOUBLE, - VSTREAM_CTL_TIMEOUT, milter->cmd_timeout, - VSTREAM_CTL_END); + VSTREAM_SCTL_DOUBLE, + VSTREAM_SCTL_TIMEOUT(milter->cmd_timeout), + VSTREAM_SCTL_END); if (milter->state == MILTER8_STAT_MESSAGE || milter->state == MILTER8_STAT_ACCEPT_MSG) milter->state = MILTER8_STAT_ENVELOPE; @@ -2782,7 +2782,7 @@ MILTER *milter8_receive(VSTREAM *stream, MILTERS *parent) msg_timeout, NO_PROTOCOL, STR(act_buf), parent); milter->fp = vstream_fdopen(fd, O_RDWR); milter->m.macros = macros; - vstream_control(milter->fp, VSTREAM_CTL_DOUBLE, VSTREAM_CTL_END); + vstream_control(milter->fp, VSTREAM_SCTL_DOUBLE, VSTREAM_SCTL_END); /* Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. */ vstream_tweak_sock(milter->fp); milter->version = version; diff --git a/postfix/src/oqmgr/Makefile.in b/postfix/src/oqmgr/Makefile.in index 07148f55e..8a2ac56b0 100644 --- a/postfix/src/oqmgr/Makefile.in +++ b/postfix/src/oqmgr/Makefile.in @@ -196,6 +196,7 @@ qmgr_deliver.o: ../../include/vstring.h qmgr_deliver.o: ../../include/vstring_vstream.h qmgr_deliver.o: qmgr.h qmgr_deliver.o: qmgr_deliver.c +qmgr_enable.o: ../../include/check_arg.h qmgr_enable.o: ../../include/dsn.h qmgr_enable.o: ../../include/msg.h qmgr_enable.o: ../../include/recipient_list.h @@ -224,6 +225,7 @@ qmgr_entry.o: ../../include/vstream.h qmgr_entry.o: ../../include/vstring.h qmgr_entry.o: qmgr.h qmgr_entry.o: qmgr_entry.c +qmgr_error.o: ../../include/check_arg.h qmgr_error.o: ../../include/dsn.h qmgr_error.o: ../../include/mymalloc.h qmgr_error.o: ../../include/recipient_list.h @@ -235,6 +237,7 @@ qmgr_error.o: ../../include/vstream.h qmgr_error.o: ../../include/vstring.h qmgr_error.o: qmgr.h qmgr_error.o: qmgr_error.c +qmgr_feedback.o: ../../include/check_arg.h qmgr_feedback.o: ../../include/dsn.h qmgr_feedback.o: ../../include/mail_conf.h qmgr_feedback.o: ../../include/mail_params.h @@ -292,6 +295,7 @@ qmgr_message.o: ../../include/vstream.h qmgr_message.o: ../../include/vstring.h qmgr_message.o: qmgr.h qmgr_message.o: qmgr_message.c +qmgr_move.o: ../../include/check_arg.h qmgr_move.o: ../../include/dsn.h qmgr_move.o: ../../include/mail_queue.h qmgr_move.o: ../../include/mail_scan_dir.h @@ -323,6 +327,7 @@ qmgr_queue.o: ../../include/vstream.h qmgr_queue.o: ../../include/vstring.h qmgr_queue.o: qmgr.h qmgr_queue.o: qmgr_queue.c +qmgr_scan.o: ../../include/check_arg.h qmgr_scan.o: ../../include/dsn.h qmgr_scan.o: ../../include/mail_scan_dir.h qmgr_scan.o: ../../include/msg.h diff --git a/postfix/src/oqmgr/qmgr.c b/postfix/src/oqmgr/qmgr.c index daef4cea7..8befbfffc 100644 --- a/postfix/src/oqmgr/qmgr.c +++ b/postfix/src/oqmgr/qmgr.c @@ -669,15 +669,15 @@ int main(int argc, char **argv) * not talk back to the client. */ trigger_server_main(argc, argv, qmgr_trigger_event, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, qmgr_pre_init, - MAIL_SERVER_POST_INIT, qmgr_post_init, - MAIL_SERVER_LOOP, qmgr_loop, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_SOLITARY, - MAIL_SERVER_WATCHDOG, &var_qmgr_daemon_timeout, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(qmgr_pre_init), + MAIL_SERVER_REQ_POST_INIT(qmgr_post_init), + MAIL_SERVER_REQ_LOOP(qmgr_loop), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_SOLITARY, + MAIL_SERVER_REQ_WATCHDOG(&var_qmgr_daemon_timeout), 0); } diff --git a/postfix/src/oqmgr/qmgr_transport.c b/postfix/src/oqmgr/qmgr_transport.c index aaacb03e0..ac80da344 100644 --- a/postfix/src/oqmgr/qmgr_transport.c +++ b/postfix/src/oqmgr/qmgr_transport.c @@ -344,13 +344,13 @@ void qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOT event_request_timer(qmgr_transport_event, (void *) alloc, 0); return; } -#if (EVENTS_STYLE != EVENTS_STYLE_SELECT) && defined(VSTREAM_CTL_DUPFD) +#if (EVENTS_STYLE != EVENTS_STYLE_SELECT) && defined(VSTREAM_SCTL_DUPFD) #ifndef THRESHOLD_FD_WORKAROUND #define THRESHOLD_FD_WORKAROUND 128 #endif vstream_control(alloc->stream, - VSTREAM_CTL_DUPFD, THRESHOLD_FD_WORKAROUND, - VSTREAM_CTL_END); + VSTREAM_SCTL_DUPFD(THRESHOLD_FD_WORKAROUND), + VSTREAM_SCTL_END); #endif event_enable_read(vstream_fileno(alloc->stream), qmgr_transport_event, (void *) alloc); diff --git a/postfix/src/pickup/pickup.c b/postfix/src/pickup/pickup.c index 1b11fda28..32db5314e 100644 --- a/postfix/src/pickup/pickup.c +++ b/postfix/src/pickup/pickup.c @@ -605,9 +605,9 @@ int main(int argc, char **argv) * submissions. */ trigger_server_main(argc, argv, pickup_service, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_SOLITARY, - MAIL_SERVER_WATCHDOG, &var_daemon_timeout, + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_SOLITARY, + MAIL_SERVER_REQ_WATCHDOG(&var_daemon_timeout), 0); } diff --git a/postfix/src/pipe/pipe.c b/postfix/src/pipe/pipe.c index a92af58fe..b1481ccf1 100644 --- a/postfix/src/pipe/pipe.c +++ b/postfix/src/pipe/pipe.c @@ -1270,19 +1270,19 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv) export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ); command_status = pipe_command(request->fp, why, - PIPE_CMD_UID, attr.uid, - PIPE_CMD_GID, attr.gid, - PIPE_CMD_SENDER, sender, - PIPE_CMD_COPY_FLAGS, attr.flags, - PIPE_CMD_ARGV, expanded_argv->argv, - PIPE_CMD_TIME_LIMIT, conf.time_limit, - PIPE_CMD_EOL, STR(attr.eol), - PIPE_CMD_EXPORT, export_env->argv, - PIPE_CMD_CWD, attr.exec_dir, - PIPE_CMD_CHROOT, attr.chroot_dir, - PIPE_CMD_ORIG_RCPT, rcpt_list->info[0].orig_addr, - PIPE_CMD_DELIVERED, rcpt_list->info[0].address, - PIPE_CMD_END); + PIPE_SCMD_UID(attr.uid), + PIPE_SCMD_GID(attr.gid), + PIPE_SCMD_SENDER(sender), + PIPE_SCMD_COPY_FLAGS(attr.flags), + PIPE_SCMD_ARGV(expanded_argv->argv), + PIPE_SCMD_TIME_LIMIT(conf.time_limit), + PIPE_SCMD_EOL(STR(attr.eol)), + PIPE_SCMD_EXPORT(export_env->argv), + PIPE_SCMD_CWD(attr.exec_dir), + PIPE_SCMD_CHROOT(attr.chroot_dir), + PIPE_SCMD_ORIG_RCPT(rcpt_list->info[0].orig_addr), + PIPE_SCMD_DELIVERED(rcpt_list->info[0].address), + PIPE_SCMD_END); argv_free(export_env); deliver_status = eval_command_status(command_status, service, request, @@ -1364,13 +1364,13 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, pipe_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_PRE_INIT, pre_init, - MAIL_SERVER_POST_INIT, drop_privileges, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_PRIVILEGED, - MAIL_SERVER_BOUNCE_INIT, VAR_PIPE_DSN_FILTER, - &var_pipe_dsn_filter, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_PRE_INIT(pre_init), + MAIL_SERVER_REQ_POST_INIT(drop_privileges), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_PRIVILEGED, + MAIL_SERVER_REQ_BOUNCE_INIT(VAR_PIPE_DSN_FILTER, + &var_pipe_dsn_filter), 0); } diff --git a/postfix/src/postalias/Makefile.in b/postfix/src/postalias/Makefile.in index 2f731eb80..7982af603 100644 --- a/postfix/src/postalias/Makefile.in +++ b/postfix/src/postalias/Makefile.in @@ -54,7 +54,7 @@ test2: $(PROG) map.in map-abc2.ref map-ghi2.ref map-uABC2.ref rm -f map.in.db fail_test: $(PROG) aliases fail_test.in fail_test.ref - -sh fail_test.in > fail_test.tmp 2>&1 || exit 0 + -(sh fail_test.in 2>&1 || exit 0) | sed 's/No error:/Unknown error:/' > fail_test.tmp diff fail_test.ref fail_test.tmp rm -f fail_test.tmp @@ -88,6 +88,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postalias.o: ../../include/argv.h +postalias.o: ../../include/check_arg.h postalias.o: ../../include/dict.h postalias.o: ../../include/dict_proxy.h postalias.o: ../../include/mail_conf.h diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index 7105d30f9..4684892ec 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -282,7 +282,7 @@ static void postalias(char *map_type, char *path_name, int postalias_flags, if ((open_flags & O_TRUNC) == 0) { /* Incremental mode. */ source_fp = VSTREAM_IN; - vstream_control(source_fp, VSTREAM_CTL_PATH, "stdin", VSTREAM_CTL_END); + vstream_control(source_fp, VSTREAM_SCTL_PATH("stdin"), VSTREAM_SCTL_END); } else { /* Create database. */ if (strcmp(map_type, DICT_TYPE_PROXY) == 0) diff --git a/postfix/src/postcat/postcat.c b/postfix/src/postcat/postcat.c index 3d9b5158b..5795c34f5 100644 --- a/postfix/src/postcat/postcat.c +++ b/postfix/src/postcat/postcat.c @@ -236,7 +236,7 @@ static void postcat(VSTREAM *fp, VSTRING *buffer, int flags) /* Optimization: skip to extracted segment marker. */ if (do_print == 0 && (flags & PC_FLAG_PRINT_ENV) && data_offset >= 0 && data_size >= 0 - && vstream_fseek(fp, data_offset + data_size, SEEK_SET) < 0) + && vstream_fseek(fp, data_offset + data_size, SEEK_SET) < 0) msg_fatal("seek error: %m"); } /* Optional output happens further down below. */ @@ -492,8 +492,8 @@ int main(int argc, char **argv) */ if (argc == optind) { vstream_control(VSTREAM_IN, - VSTREAM_CTL_PATH, "stdin", - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH("stdin"), + VSTREAM_SCTL_END); postcat(VSTREAM_IN, buffer, flags); } diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index 78f22f353..186ca86b3 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -834,6 +834,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postconf.o: ../../include/argv.h +postconf.o: ../../include/check_arg.h postconf.o: ../../include/dict.h postconf.o: ../../include/htable.h postconf.o: ../../include/mail_conf.h @@ -903,6 +904,7 @@ postconf_builtin.o: str_vars.h postconf_builtin.o: time_table.h 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_ldap.h postconf_dbms.o: ../../include/dict_memcache.h @@ -928,6 +930,7 @@ postconf_dbms.o: ../../include/vstring.h postconf_dbms.o: postconf.h postconf_dbms.o: postconf_dbms.c postconf_edit.o: ../../include/argv.h +postconf_edit.o: ../../include/check_arg.h postconf_edit.o: ../../include/dict.h postconf_edit.o: ../../include/edit_file.h postconf_edit.o: ../../include/htable.h @@ -947,6 +950,7 @@ postconf_edit.o: ../../include/vstring_vstream.h postconf_edit.o: postconf.h postconf_edit.o: postconf_edit.c postconf_lookup.o: ../../include/argv.h +postconf_lookup.o: ../../include/check_arg.h postconf_lookup.o: ../../include/dict.h postconf_lookup.o: ../../include/htable.h postconf_lookup.o: ../../include/mac_expand.h @@ -964,6 +968,7 @@ postconf_lookup.o: ../../include/vstring.h postconf_lookup.o: postconf.h postconf_lookup.o: postconf_lookup.c postconf_main.o: ../../include/argv.h +postconf_main.o: ../../include/check_arg.h postconf_main.o: ../../include/dict.h postconf_main.o: ../../include/htable.h postconf_main.o: ../../include/mac_expand.h @@ -983,6 +988,7 @@ postconf_main.o: ../../include/vstring.h postconf_main.o: postconf.h postconf_main.o: postconf_main.c postconf_master.o: ../../include/argv.h +postconf_master.o: ../../include/check_arg.h postconf_master.o: ../../include/dict.h postconf_master.o: ../../include/htable.h postconf_master.o: ../../include/mail_params.h @@ -1001,6 +1007,7 @@ postconf_master.o: ../../include/vstring.h postconf_master.o: postconf.h postconf_master.o: postconf_master.c postconf_match.o: ../../include/argv.h +postconf_match.o: ../../include/check_arg.h postconf_match.o: ../../include/dict.h postconf_match.o: ../../include/htable.h postconf_match.o: ../../include/msg.h @@ -1015,6 +1022,7 @@ postconf_match.o: ../../include/vstring.h postconf_match.o: postconf.h postconf_match.o: postconf_match.c postconf_misc.o: ../../include/argv.h +postconf_misc.o: ../../include/check_arg.h postconf_misc.o: ../../include/dict.h postconf_misc.o: ../../include/htable.h postconf_misc.o: ../../include/mail_conf.h @@ -1030,6 +1038,7 @@ postconf_misc.o: ../../include/vstring.h postconf_misc.o: postconf.h postconf_misc.o: postconf_misc.c postconf_node.o: ../../include/argv.h +postconf_node.o: ../../include/check_arg.h postconf_node.o: ../../include/dict.h postconf_node.o: ../../include/htable.h postconf_node.o: ../../include/msg.h @@ -1043,6 +1052,7 @@ postconf_node.o: ../../include/vstring.h postconf_node.o: postconf.h postconf_node.o: postconf_node.c postconf_other.o: ../../include/argv.h +postconf_other.o: ../../include/check_arg.h postconf_other.o: ../../include/dict.h postconf_other.o: ../../include/htable.h postconf_other.o: ../../include/mbox_conf.h @@ -1056,6 +1066,7 @@ postconf_other.o: ../../include/xsasl.h postconf_other.o: postconf.h postconf_other.o: postconf_other.c postconf_print.o: ../../include/argv.h +postconf_print.o: ../../include/check_arg.h postconf_print.o: ../../include/dict.h postconf_print.o: ../../include/htable.h postconf_print.o: ../../include/msg.h @@ -1068,6 +1079,7 @@ postconf_print.o: ../../include/vstring.h postconf_print.o: postconf.h postconf_print.o: postconf_print.c postconf_service.o: ../../include/argv.h +postconf_service.o: ../../include/check_arg.h postconf_service.o: ../../include/dict.h postconf_service.o: ../../include/htable.h postconf_service.o: ../../include/mail_params.h @@ -1083,6 +1095,7 @@ postconf_service.o: ../../include/vstring.h postconf_service.o: postconf.h postconf_service.o: postconf_service.c postconf_unused.o: ../../include/argv.h +postconf_unused.o: ../../include/check_arg.h postconf_unused.o: ../../include/dict.h postconf_unused.o: ../../include/htable.h postconf_unused.o: ../../include/mail_conf.h @@ -1097,6 +1110,7 @@ postconf_unused.o: ../../include/vstring.h postconf_unused.o: postconf.h postconf_unused.o: postconf_unused.c postconf_user.o: ../../include/argv.h +postconf_user.o: ../../include/check_arg.h postconf_user.o: ../../include/dict.h postconf_user.o: ../../include/htable.h postconf_user.o: ../../include/mac_expand.h diff --git a/postfix/src/postdrop/postdrop.c b/postfix/src/postdrop/postdrop.c index 14e320663..0d5c96781 100644 --- a/postfix/src/postdrop/postdrop.c +++ b/postfix/src/postdrop/postdrop.c @@ -393,7 +393,7 @@ int main(int argc, char **argv) * Allow attribute records if the attribute specifies the MIME body type * (sendmail -B). */ - vstream_control(VSTREAM_IN, VSTREAM_CTL_PATH, "stdin", VSTREAM_CTL_END); + vstream_control(VSTREAM_IN, VSTREAM_SCTL_PATH("stdin"), VSTREAM_SCTL_END); buf = vstring_alloc(100); expected = segment_info; /* Override time information from the untrusted caller. */ diff --git a/postfix/src/postfix/Makefile.in b/postfix/src/postfix/Makefile.in index 2b4281d35..9be4ec190 100644 --- a/postfix/src/postfix/Makefile.in +++ b/postfix/src/postfix/Makefile.in @@ -63,6 +63,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postfix.o: ../../include/argv.h +postfix.o: ../../include/check_arg.h postfix.o: ../../include/clean_env.h postfix.o: ../../include/mail_conf.h postfix.o: ../../include/mail_params.h diff --git a/postfix/src/postlock/Makefile.in b/postfix/src/postlock/Makefile.in index 1715d719c..d14c31a32 100644 --- a/postfix/src/postlock/Makefile.in +++ b/postfix/src/postlock/Makefile.in @@ -59,6 +59,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postlock.o: ../../include/argv.h +postlock.o: ../../include/check_arg.h postlock.o: ../../include/deliver_flock.h postlock.o: ../../include/dot_lockfile.h postlock.o: ../../include/dsn.h diff --git a/postfix/src/postlog/Makefile.in b/postfix/src/postlog/Makefile.in index 0cc872842..76fda9b6e 100644 --- a/postfix/src/postlog/Makefile.in +++ b/postfix/src/postlog/Makefile.in @@ -62,6 +62,7 @@ depend: $(MAKES) @$(EXPORT) make -f Makefile.in Makefile 1>&2 # do not edit below this line - it is generated by 'make depend' +postlog.o: ../../include/check_arg.h postlog.o: ../../include/mail_conf.h postlog.o: ../../include/mail_params.h postlog.o: ../../include/mail_task.h diff --git a/postfix/src/postmap/Makefile.in b/postfix/src/postmap/Makefile.in index 5f7dc6ad7..f5bed5504 100644 --- a/postfix/src/postmap/Makefile.in +++ b/postfix/src/postmap/Makefile.in @@ -57,7 +57,8 @@ test2: $(PROG) map.in map-abc2.ref map-ghi2.ref map-uABC2.ref rm -f map.in.db fail_test: $(PROG) aliases fail_test.in fail_test.ref - -sh fail_test.in > fail_test.tmp 2>&1 || exit 0 + -(sh fail_test.in || exit 0) 2>&1 | \ + sed 's/No error:/Unknown error:/' > fail_test.tmp diff fail_test.ref fail_test.tmp rm -f fail_test.tmp @@ -88,6 +89,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postmap.o: ../../include/argv.h +postmap.o: ../../include/check_arg.h postmap.o: ../../include/dict.h postmap.o: ../../include/dict_proxy.h postmap.o: ../../include/header_opts.h diff --git a/postfix/src/postmap/postmap.c b/postfix/src/postmap/postmap.c index aae3b81f5..cf8d6ff61 100644 --- a/postfix/src/postmap/postmap.c +++ b/postfix/src/postmap/postmap.c @@ -345,7 +345,7 @@ static void postmap(char *map_type, char *path_name, int postmap_flags, if ((open_flags & O_TRUNC) == 0) { /* Incremental mode. */ source_fp = VSTREAM_IN; - vstream_control(source_fp, VSTREAM_CTL_PATH, "stdin", VSTREAM_CTL_END); + vstream_control(source_fp, VSTREAM_SCTL_PATH("stdin"), VSTREAM_SCTL_END); } else { /* Create database. */ if (strcmp(map_type, DICT_TYPE_PROXY) == 0) diff --git a/postfix/src/postmulti/Makefile.in b/postfix/src/postmulti/Makefile.in index 059fcfea5..b2ba77ede 100644 --- a/postfix/src/postmulti/Makefile.in +++ b/postfix/src/postmulti/Makefile.in @@ -63,6 +63,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postmulti.o: ../../include/argv.h +postmulti.o: ../../include/check_arg.h postmulti.o: ../../include/clean_env.h postmulti.o: ../../include/htable.h postmulti.o: ../../include/mail_conf.h diff --git a/postfix/src/postmulti/postmulti.c b/postfix/src/postmulti/postmulti.c index 0ad8d5686..99320e985 100644 --- a/postfix/src/postmulti/postmulti.c +++ b/postfix/src/postmulti/postmulti.c @@ -801,8 +801,8 @@ static INSTANCE *load_instance(INSTANCE *ip) VAR_MULTI_NAME, VAR_MULTI_GROUP, VAR_MULTI_ENABLE, (char *) 0); myfree(name); - pipe = vstream_popen(O_RDONLY, VSTREAM_POPEN_ARGV, cmd->argv, - VSTREAM_POPEN_END); + pipe = vstream_popen(O_RDONLY, VSTREAM_SPOPEN_ARGV(cmd->argv), + VSTREAM_SPOPEN_END); argv_free(cmd); if (pipe == 0) msg_fatal("Cannot parse %s/main.cf file: %m", ip->config_dir); diff --git a/postfix/src/postscreen/Makefile.in b/postfix/src/postscreen/Makefile.in index 5ccbb1244..f241afc6c 100644 --- a/postfix/src/postscreen/Makefile.in +++ b/postfix/src/postscreen/Makefile.in @@ -105,6 +105,7 @@ postscreen.o: postscreen.c postscreen.o: postscreen.h postscreen_dict.o: ../../include/addr_match_list.h postscreen_dict.o: ../../include/argv.h +postscreen_dict.o: ../../include/check_arg.h postscreen_dict.o: ../../include/dict.h postscreen_dict.o: ../../include/dict_cache.h postscreen_dict.o: ../../include/events.h @@ -155,6 +156,7 @@ postscreen_dnsbl.o: postscreen.h postscreen_dnsbl.o: postscreen_dnsbl.c postscreen_early.o: ../../include/addr_match_list.h postscreen_early.o: ../../include/argv.h +postscreen_early.o: ../../include/check_arg.h postscreen_early.o: ../../include/dict.h postscreen_early.o: ../../include/dict_cache.h postscreen_early.o: ../../include/events.h @@ -177,6 +179,7 @@ postscreen_early.o: postscreen.h postscreen_early.o: postscreen_early.c postscreen_endpt.o: ../../include/addr_match_list.h postscreen_endpt.o: ../../include/argv.h +postscreen_endpt.o: ../../include/check_arg.h postscreen_endpt.o: ../../include/dict.h postscreen_endpt.o: ../../include/dict_cache.h postscreen_endpt.o: ../../include/events.h @@ -227,6 +230,7 @@ postscreen_expand.o: postscreen.h postscreen_expand.o: postscreen_expand.c postscreen_haproxy.o: ../../include/addr_match_list.h postscreen_haproxy.o: ../../include/argv.h +postscreen_haproxy.o: ../../include/check_arg.h postscreen_haproxy.o: ../../include/dict.h postscreen_haproxy.o: ../../include/dict_cache.h postscreen_haproxy.o: ../../include/events.h @@ -251,6 +255,7 @@ postscreen_haproxy.o: postscreen_haproxy.c postscreen_haproxy.o: postscreen_haproxy.h postscreen_misc.o: ../../include/addr_match_list.h postscreen_misc.o: ../../include/argv.h +postscreen_misc.o: ../../include/check_arg.h postscreen_misc.o: ../../include/dict.h postscreen_misc.o: ../../include/dict_cache.h postscreen_misc.o: ../../include/events.h @@ -379,6 +384,7 @@ postscreen_state.o: ../../include/dict_cache.h postscreen_state.o: ../../include/events.h postscreen_state.o: ../../include/htable.h postscreen_state.o: ../../include/iostuff.h +postscreen_state.o: ../../include/mail_conf.h postscreen_state.o: ../../include/mail_proto.h postscreen_state.o: ../../include/mail_server.h postscreen_state.o: ../../include/maps.h @@ -399,6 +405,7 @@ postscreen_state.o: postscreen.h postscreen_state.o: postscreen_state.c postscreen_tests.o: ../../include/addr_match_list.h postscreen_tests.o: ../../include/argv.h +postscreen_tests.o: ../../include/check_arg.h postscreen_tests.o: ../../include/dict.h postscreen_tests.o: ../../include/dict_cache.h postscreen_tests.o: ../../include/events.h diff --git a/postfix/src/postscreen/postscreen.c b/postfix/src/postscreen/postscreen.c index 8e621885c..725945cca 100644 --- a/postfix/src/postscreen/postscreen.c +++ b/postfix/src/postscreen/postscreen.c @@ -549,7 +549,7 @@ static void psc_endpt_lookup_done(int, VSTREAM *, /* psc_dump - dump some statistics before exit */ -static void psc_dump(void) +static void psc_dump(char *unused_service, char **unused_argv) { /* @@ -821,7 +821,7 @@ static void psc_endpt_lookup_done(int endpt_status, static int psc_cache_validator(const char *client_addr, const char *stamp_str, - char *unused_context) + void *unused_context) { PSC_STATE dummy; @@ -1010,11 +1010,11 @@ static void post_jail_init(char *unused_name, char **unused_argv) cache_flags |= DICT_CACHE_FLAG_VERBOSE; if (psc_cache_map != 0 && var_psc_cache_scan > 0) dict_cache_control(psc_cache_map, - DICT_CACHE_CTL_FLAGS, cache_flags, - DICT_CACHE_CTL_INTERVAL, var_psc_cache_scan, - DICT_CACHE_CTL_VALIDATOR, psc_cache_validator, - DICT_CACHE_CTL_CONTEXT, (void *) 0, - DICT_CACHE_CTL_END); + DICT_CACHE_SCTL_FLAGS(cache_flags), + DICT_CACHE_SCTL_INTERVAL(var_psc_cache_scan), + DICT_CACHE_SCTL_VALIDATOR(psc_cache_validator), + DICT_CACHE_SCTL_CONTEXT((void *) 0), + DICT_CACHE_SCTL_END); /* * Pre-compute the minimal and maximal TTL. @@ -1164,19 +1164,19 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; event_server_main(argc, argv, psc_service, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_NINT_TABLE, nint_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_RAW_TABLE, raw_table, - MAIL_SERVER_NBOOL_TABLE, nbool_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_SOLITARY, - MAIL_SERVER_SLOW_EXIT, psc_drain, - MAIL_SERVER_EXIT, psc_dump, - MAIL_SERVER_WATCHDOG, &var_psc_watchdog, + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_NINT_TABLE(nint_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_RAW_TABLE(raw_table), + MAIL_SERVER_REQ_NBOOL_TABLE(nbool_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_SOLITARY, + MAIL_SERVER_REQ_SLOW_EXIT(psc_drain), + MAIL_SERVER_REQ_EXIT(psc_dump), + MAIL_SERVER_REQ_WATCHDOG(&var_psc_watchdog), 0); } diff --git a/postfix/src/postscreen/postscreen_dnsbl.c b/postfix/src/postscreen/postscreen_dnsbl.c index 8d5167338..38d352610 100644 --- a/postfix/src/postscreen/postscreen_dnsbl.c +++ b/postfix/src/postscreen/postscreen_dnsbl.c @@ -506,8 +506,8 @@ int psc_dnsbl_request(const char *client_addr, } stream = vstream_fdopen(fd, O_RDWR); vstream_control(stream, - VSTREAM_CTL_CONTEXT, ht[0]->key, - VSTREAM_CTL_END); + VSTREAM_SCTL_CONTEXT(ht[0]->key), + VSTREAM_SCTL_END); attr_print(stream, ATTR_FLAG_NONE, SEND_ATTR_STR(MAIL_ATTR_RBL_DOMAIN, ht[0]->key), SEND_ATTR_STR(MAIL_ATTR_ACT_CLIENT_ADDR, client_addr), diff --git a/postfix/src/postscreen/postscreen_endpt.c b/postfix/src/postscreen/postscreen_endpt.c index c76c58e2d..57655ac6a 100644 --- a/postfix/src/postscreen/postscreen_endpt.c +++ b/postfix/src/postscreen/postscreen_endpt.c @@ -86,7 +86,7 @@ static INET_PROTO_INFO *proto_info; /* psc_sockaddr_to_hostaddr - transform endpoint address and port to string */ -static int psc_sockaddr_to_hostaddr(struct sockaddr * addr_storage, +static int psc_sockaddr_to_hostaddr(struct sockaddr *addr_storage, SOCKADDR_SIZE addr_storage_len, MAI_HOSTADDR_STR *addr_buf, MAI_SERVPORT_STR *port_buf, @@ -106,7 +106,7 @@ static int psc_sockaddr_to_hostaddr(struct sockaddr * addr_storage, /* psc_endpt_local_lookup - look up local system connection information */ static void psc_endpt_local_lookup(VSTREAM *smtp_client_stream, - PSC_ENDPT_LOOKUP_FN lookup_done) + PSC_ENDPT_LOOKUP_FN lookup_done) { struct sockaddr_storage addr_storage; SOCKADDR_SIZE addr_storage_len = sizeof(addr_storage); @@ -121,7 +121,7 @@ static void psc_endpt_local_lookup(VSTREAM *smtp_client_stream, * Look up the remote SMTP client address and port. */ if (getpeername(vstream_fileno(smtp_client_stream), (struct sockaddr *) - & addr_storage, &addr_storage_len) < 0) { + &addr_storage, &addr_storage_len) < 0) { msg_warn("getpeername: %m -- dropping this connection"); status = -1; } @@ -131,7 +131,7 @@ static void psc_endpt_local_lookup(VSTREAM *smtp_client_stream, * logging and access control. */ else if ((aierr = psc_sockaddr_to_hostaddr( - (struct sockaddr *) & addr_storage, + (struct sockaddr *) &addr_storage, addr_storage_len, &smtp_client_addr, &smtp_client_port, SOCK_STREAM)) != 0) { msg_warn("cannot convert client address/port to string: %s" @@ -144,7 +144,7 @@ static void psc_endpt_local_lookup(VSTREAM *smtp_client_stream, * Look up the local SMTP server address and port. */ else if (getsockname(vstream_fileno(smtp_client_stream), - (struct sockaddr *) & addr_storage, + (struct sockaddr *) &addr_storage, &addr_storage_len) < 0) { msg_warn("getsockname: %m -- dropping this connection"); status = -1; @@ -155,7 +155,7 @@ static void psc_endpt_local_lookup(VSTREAM *smtp_client_stream, * logging. */ else if ((aierr = psc_sockaddr_to_hostaddr( - (struct sockaddr *) & addr_storage, + (struct sockaddr *) &addr_storage, addr_storage_len, &smtp_server_addr, &smtp_server_port, SOCK_STREAM)) != 0) { msg_warn("cannot convert server address/port to string: %s" @@ -192,7 +192,7 @@ void psc_endpt_lookup(VSTREAM *smtp_client_stream, const PSC_ENDPT_LOOKUP_INFO *pp; if (proto_info == 0) - proto_info = inet_proto_info(); + proto_info = inet_proto_info(); for (pp = psc_endpt_lookup_info; /* see below */ ; pp++) { if (pp->name == 0) diff --git a/postfix/src/postscreen/postscreen_haproxy.c b/postfix/src/postscreen/postscreen_haproxy.c index 36207e180..79ff7fde6 100644 --- a/postfix/src/postscreen/postscreen_haproxy.c +++ b/postfix/src/postscreen/postscreen_haproxy.c @@ -107,8 +107,8 @@ static void psc_endpt_haproxy_event(int event, void *context) } else { read_len = 1; } - vstream_control(state->stream, VSTREAM_CTL_BUFSIZE, read_len, - VSTREAM_CTL_END); + vstream_control(state->stream, VSTREAM_SCTL_BUFSIZE(read_len), + VSTREAM_SCTL_END); } /* Drain the VSTREAM buffer, otherwise this pseudo-thread will hang. */ do { @@ -157,8 +157,8 @@ static void psc_endpt_haproxy_event(int event, void *context) PSC_CLEAR_EVENT_REQUEST(vstream_fileno(state->stream), psc_endpt_haproxy_event, context); vstream_control(state->stream, - VSTREAM_CTL_BUFSIZE, (ssize_t) VSTREAM_BUFSIZE, - VSTREAM_CTL_END); + VSTREAM_SCTL_BUFSIZE(VSTREAM_BUFSIZE), + VSTREAM_SCTL_END); state->notify(status, state->stream, &smtp_client_addr, &smtp_client_port, &smtp_server_addr, &smtp_server_port); diff --git a/postfix/src/postscreen/postscreen_starttls.c b/postfix/src/postscreen/postscreen_starttls.c index a4b40085c..fcefdd4d8 100644 --- a/postfix/src/postscreen/postscreen_starttls.c +++ b/postfix/src/postscreen/postscreen_starttls.c @@ -167,8 +167,8 @@ static void psc_starttls_finish(int event, void *context) */ vstream_fpurge(smtp_state->smtp_client_stream, VSTREAM_PURGE_BOTH); vstream_control(smtp_state->smtp_client_stream, - VSTREAM_CTL_SWAP_FD, tlsproxy_stream, - VSTREAM_CTL_END); + VSTREAM_SCTL_SWAP_FD(tlsproxy_stream), + VSTREAM_SCTL_END); vstream_fclose(tlsproxy_stream); /* direct-to-client stream! */ smtp_state->flags |= PSC_STATE_FLAG_USING_TLS; } diff --git a/postfix/src/postsuper/Makefile.in b/postfix/src/postsuper/Makefile.in index e38b62420..b9a57ca59 100644 --- a/postfix/src/postsuper/Makefile.in +++ b/postfix/src/postsuper/Makefile.in @@ -59,6 +59,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' postsuper.o: ../../include/argv.h +postsuper.o: ../../include/check_arg.h postsuper.o: ../../include/file_id.h postsuper.o: ../../include/mail_conf.h postsuper.o: ../../include/mail_open_ok.h diff --git a/postfix/src/posttls-finger/Makefile.in b/postfix/src/posttls-finger/Makefile.in index ff4507cc5..02b4261ab 100644 --- a/postfix/src/posttls-finger/Makefile.in +++ b/postfix/src/posttls-finger/Makefile.in @@ -63,6 +63,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' posttls-finger.o: ../../include/argv.h +posttls-finger.o: ../../include/check_arg.h posttls-finger.o: ../../include/chroot_uid.h posttls-finger.o: ../../include/dns.h posttls-finger.o: ../../include/dsn.h @@ -94,6 +95,7 @@ posttls-finger.o: ../../include/vstring_vstream.h posttls-finger.o: posttls-finger.c posttls-finger.o: tlsmgrmem.h tlsmgrmem.o: ../../include/argv.h +tlsmgrmem.o: ../../include/check_arg.h tlsmgrmem.o: ../../include/dict.h tlsmgrmem.o: ../../include/htable.h tlsmgrmem.o: ../../include/myflock.h diff --git a/postfix/src/posttls-finger/posttls-finger.c b/postfix/src/posttls-finger/posttls-finger.c index ec44e1195..9ed1a9976 100644 --- a/postfix/src/posttls-finger/posttls-finger.c +++ b/postfix/src/posttls-finger/posttls-finger.c @@ -498,7 +498,7 @@ static RESPONSE *response(STATE *state, int verbose) */ if (rdata.buf == 0) { rdata.buf = vstring_alloc(100); - vstring_ctl(rdata.buf, VSTRING_CTL_MAXLEN, (ssize_t) var_line_limit, 0); + vstring_ctl(rdata.buf, VSTRING_SCTL_MAXLEN(var_line_limit), 0); } /* @@ -1413,8 +1413,7 @@ static int finger(STATE *state) * never-ending lines of text. */ state->buffer = vstring_alloc(100); - vstring_ctl(state->buffer, VSTRING_CTL_MAXLEN, - (ssize_t) var_line_limit, 0); + vstring_ctl(state->buffer, VSTRING_SCTL_MAXLEN(var_line_limit), 0); state->why = dsb_create(); if (!(err = connect_dest(state))) { diff --git a/postfix/src/proxymap/proxymap.c b/postfix/src/proxymap/proxymap.c index 31ae405fb..f10b0aa60 100644 --- a/postfix/src/proxymap/proxymap.c +++ b/postfix/src/proxymap/proxymap.c @@ -596,8 +596,8 @@ static void proxymap_service(VSTREAM *client_stream, char *unused_service, */ if (vstream_fstat(client_stream, VSTREAM_FLAG_DEADLINE) == 0) vstream_control(client_stream, - VSTREAM_CTL_TIMEOUT, 1, - VSTREAM_CTL_END); + VSTREAM_SCTL_TIMEOUT(1), + VSTREAM_SCTL_END); /* * This routine runs whenever a client connects to the socket dedicated @@ -605,8 +605,8 @@ static void proxymap_service(VSTREAM *client_stream, char *unused_service, * the common code in multi_server.c. */ vstream_control(client_stream, - VSTREAM_CTL_START_DEADLINE, - VSTREAM_CTL_END); + VSTREAM_SCTL_START_DEADLINE, + VSTREAM_SCTL_END); if (attr_scan(client_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT, RECV_ATTR_STR(MAIL_ATTR_REQ, request), @@ -629,8 +629,8 @@ static void proxymap_service(VSTREAM *client_stream, char *unused_service, } } vstream_control(client_stream, - VSTREAM_CTL_START_DEADLINE, - VSTREAM_CTL_END); + VSTREAM_SCTL_START_DEADLINE, + VSTREAM_SCTL_END); vstream_fflush(client_stream); } @@ -747,9 +747,9 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; multi_server_main(argc, argv, proxymap_service, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - /* XXX MAIL_SERVER_SOLITARY if proxywrite */ + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + /* XXX MAIL_SERVER_REQ_SOLITARY if proxywrite */ 0); } diff --git a/postfix/src/qmgr/Makefile.in b/postfix/src/qmgr/Makefile.in index 243a9b091..b24b74145 100644 --- a/postfix/src/qmgr/Makefile.in +++ b/postfix/src/qmgr/Makefile.in @@ -198,6 +198,7 @@ qmgr_deliver.o: ../../include/vstring.h qmgr_deliver.o: ../../include/vstring_vstream.h qmgr_deliver.o: qmgr.h qmgr_deliver.o: qmgr_deliver.c +qmgr_enable.o: ../../include/check_arg.h qmgr_enable.o: ../../include/dsn.h qmgr_enable.o: ../../include/msg.h qmgr_enable.o: ../../include/recipient_list.h @@ -226,6 +227,7 @@ qmgr_entry.o: ../../include/vstream.h qmgr_entry.o: ../../include/vstring.h qmgr_entry.o: qmgr.h qmgr_entry.o: qmgr_entry.c +qmgr_error.o: ../../include/check_arg.h qmgr_error.o: ../../include/dsn.h qmgr_error.o: ../../include/mymalloc.h qmgr_error.o: ../../include/recipient_list.h @@ -237,6 +239,7 @@ qmgr_error.o: ../../include/vstream.h qmgr_error.o: ../../include/vstring.h qmgr_error.o: qmgr.h qmgr_error.o: qmgr_error.c +qmgr_feedback.o: ../../include/check_arg.h qmgr_feedback.o: ../../include/dsn.h qmgr_feedback.o: ../../include/mail_conf.h qmgr_feedback.o: ../../include/mail_params.h @@ -252,6 +255,7 @@ qmgr_feedback.o: ../../include/vstream.h qmgr_feedback.o: ../../include/vstring.h qmgr_feedback.o: qmgr.h qmgr_feedback.o: qmgr_feedback.c +qmgr_job.o: ../../include/check_arg.h qmgr_job.o: ../../include/dsn.h qmgr_job.o: ../../include/htable.h qmgr_job.o: ../../include/msg.h @@ -307,6 +311,7 @@ qmgr_message.o: ../../include/vstream.h qmgr_message.o: ../../include/vstring.h qmgr_message.o: qmgr.h qmgr_message.o: qmgr_message.c +qmgr_move.o: ../../include/check_arg.h qmgr_move.o: ../../include/dsn.h qmgr_move.o: ../../include/mail_queue.h qmgr_move.o: ../../include/mail_scan_dir.h @@ -319,6 +324,7 @@ qmgr_move.o: ../../include/vstream.h qmgr_move.o: ../../include/vstring.h qmgr_move.o: qmgr.h qmgr_move.o: qmgr_move.c +qmgr_peer.o: ../../include/check_arg.h qmgr_peer.o: ../../include/dsn.h qmgr_peer.o: ../../include/htable.h qmgr_peer.o: ../../include/msg.h @@ -349,6 +355,7 @@ qmgr_queue.o: ../../include/vstream.h qmgr_queue.o: ../../include/vstring.h qmgr_queue.o: qmgr.h qmgr_queue.o: qmgr_queue.c +qmgr_scan.o: ../../include/check_arg.h qmgr_scan.o: ../../include/dsn.h qmgr_scan.o: ../../include/mail_scan_dir.h qmgr_scan.o: ../../include/msg.h diff --git a/postfix/src/qmgr/qmgr.c b/postfix/src/qmgr/qmgr.c index b8954e348..bbe87bb2e 100644 --- a/postfix/src/qmgr/qmgr.c +++ b/postfix/src/qmgr/qmgr.c @@ -744,15 +744,15 @@ int main(int argc, char **argv) * not talk back to the client. */ trigger_server_main(argc, argv, qmgr_trigger_event, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, qmgr_pre_init, - MAIL_SERVER_POST_INIT, qmgr_post_init, - MAIL_SERVER_LOOP, qmgr_loop, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_SOLITARY, - MAIL_SERVER_WATCHDOG, &var_qmgr_daemon_timeout, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(qmgr_pre_init), + MAIL_SERVER_REQ_POST_INIT(qmgr_post_init), + MAIL_SERVER_REQ_LOOP(qmgr_loop), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_SOLITARY, + MAIL_SERVER_REQ_WATCHDOG(&var_qmgr_daemon_timeout), 0); } diff --git a/postfix/src/qmgr/qmgr_transport.c b/postfix/src/qmgr/qmgr_transport.c index b4c0468cd..410d77ea7 100644 --- a/postfix/src/qmgr/qmgr_transport.c +++ b/postfix/src/qmgr/qmgr_transport.c @@ -349,13 +349,13 @@ void qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOT event_request_timer(qmgr_transport_event, (void *) alloc, 0); return; } -#if (EVENTS_STYLE != EVENTS_STYLE_SELECT) && defined(VSTREAM_CTL_DUPFD) +#if (EVENTS_STYLE != EVENTS_STYLE_SELECT) && defined(VSTREAM_SCTL_DUPFD) #ifndef THRESHOLD_FD_WORKAROUND #define THRESHOLD_FD_WORKAROUND 128 #endif vstream_control(alloc->stream, - VSTREAM_CTL_DUPFD, THRESHOLD_FD_WORKAROUND, - VSTREAM_CTL_END); + VSTREAM_SCTL_DUPFD(THRESHOLD_FD_WORKAROUND), + VSTREAM_SCTL_END); #endif event_enable_read(vstream_fileno(alloc->stream), qmgr_transport_event, (void *) alloc); diff --git a/postfix/src/qmqpd/qmqpd.c b/postfix/src/qmqpd/qmqpd.c index a1b4ba06c..948275bd0 100644 --- a/postfix/src/qmqpd/qmqpd.c +++ b/postfix/src/qmqpd/qmqpd.c @@ -834,11 +834,11 @@ int main(int argc, char **argv) * Pass control to the single-threaded service skeleton. */ single_server_main(argc, argv, qmqpd_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_POST_INIT, post_jail_init, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), 0); } diff --git a/postfix/src/scache/scache.c b/postfix/src/scache/scache.c index 4af9a6261..a1362044d 100644 --- a/postfix/src/scache/scache.c +++ b/postfix/src/scache/scache.c @@ -551,9 +551,9 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; multi_server_main(argc, argv, scache_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_EXIT, scache_status_dump, - MAIL_SERVER_SOLITARY, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_EXIT(scache_status_dump), + MAIL_SERVER_REQ_SOLITARY, 0); } diff --git a/postfix/src/showq/showq.c b/postfix/src/showq/showq.c index 859314593..79b4d6ee9 100644 --- a/postfix/src/showq/showq.c +++ b/postfix/src/showq/showq.c @@ -429,7 +429,7 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, showq_service, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_STR_TABLE, str_table, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), 0); } diff --git a/postfix/src/smtp/smtp.c b/postfix/src/smtp/smtp.c index d66aec33b..1b6b18b00 100644 --- a/postfix/src/smtp/smtp.c +++ b/postfix/src/smtp/smtp.c @@ -260,7 +260,7 @@ /* Optional filter for the \fBsmtp\fR(8) delivery agent to change the /* delivery status code or explanatory text of successful or unsuccessful /* deliveries. -/* .IP "\fBsmtp_dns_reply_filter ($default_dns_reply_filter)\fR" +/* .IP "\fBsmtp_dns_reply_filter (empty)\fR" /* Optional filter for Postfix SMTP client DNS lookup results. /* MIME PROCESSING CONTROLS /* .ad @@ -662,7 +662,7 @@ /* An optional numerical network address that the Postfix SMTP client /* should bind to when making an IPv6 connection. /* .IP "\fBsmtp_helo_name ($myhostname)\fR" -/* The hostname to send in the SMTP EHLO or HELO command. +/* The hostname to send in the SMTP HELO or EHLO command. /* .IP "\fBlmtp_lhlo_name ($myhostname)\fR" /* The hostname to send in the LMTP LHLO command. /* .IP "\fBsmtp_host_lookup (dns)\fR" @@ -1291,18 +1291,18 @@ int main(int argc, char **argv) * Initialize with the LMTP or SMTP parameter name space. */ single_server_main(argc, argv, smtp_service, - MAIL_SERVER_TIME_TABLE, smtp_mode ? - smtp_time_table : lmtp_time_table, - MAIL_SERVER_INT_TABLE, smtp_mode ? - smtp_int_table : lmtp_int_table, - MAIL_SERVER_STR_TABLE, smtp_mode ? - smtp_str_table : lmtp_str_table, - MAIL_SERVER_BOOL_TABLE, smtp_mode ? - smtp_bool_table : lmtp_bool_table, - MAIL_SERVER_PRE_INIT, pre_init, - MAIL_SERVER_POST_INIT, post_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_BOUNCE_INIT, VAR_SMTP_DSN_FILTER, - &var_smtp_dsn_filter, + MAIL_SERVER_REQ_TIME_TABLE(smtp_mode ? + smtp_time_table : lmtp_time_table), + MAIL_SERVER_REQ_INT_TABLE(smtp_mode ? + smtp_int_table : lmtp_int_table), + MAIL_SERVER_REQ_STR_TABLE(smtp_mode ? + smtp_str_table : lmtp_str_table), + MAIL_SERVER_REQ_BOOL_TABLE(smtp_mode ? + smtp_bool_table : lmtp_bool_table), + MAIL_SERVER_REQ_PRE_INIT(pre_init), + MAIL_SERVER_REQ_POST_INIT(post_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_BOUNCE_INIT(VAR_SMTP_DSN_FILTER, + &var_smtp_dsn_filter), 0); } diff --git a/postfix/src/smtpd/Makefile.in b/postfix/src/smtpd/Makefile.in index 987db1c47..13c6e6f09 100644 --- a/postfix/src/smtpd/Makefile.in +++ b/postfix/src/smtpd/Makefile.in @@ -625,6 +625,7 @@ smtpd_state.o: smtpd.h smtpd_state.o: smtpd_chat.h smtpd_state.o: smtpd_sasl_glue.h smtpd_state.o: smtpd_state.c +smtpd_token.o: ../../include/check_arg.h smtpd_token.o: ../../include/mvect.h smtpd_token.o: ../../include/mymalloc.h smtpd_token.o: ../../include/sys_defs.h diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 935a14855..1e12a197e 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -4313,9 +4313,9 @@ static void smtpd_start_tls(SMTPD_STATE *state) * develop a usable abstraction that encapsulates this stream plumbing in * a library module. */ - vstream_control(state->tlsproxy, VSTREAM_CTL_DOUBLE, VSTREAM_CTL_END); - vstream_control(state->client, VSTREAM_CTL_SWAP_FD, state->tlsproxy, - VSTREAM_CTL_END); + vstream_control(state->tlsproxy, VSTREAM_SCTL_DOUBLE, VSTREAM_SCTL_END); + vstream_control(state->client, VSTREAM_SCTL_SWAP_FD(state->tlsproxy), + VSTREAM_SCTL_END); (void) vstream_fclose(state->tlsproxy); /* direct-to-client stream! */ state->tlsproxy = 0; @@ -5715,15 +5715,15 @@ int main(int argc, char **argv) * Pass control to the single-threaded service skeleton. */ single_server_main(argc, argv, smtpd_service, - MAIL_SERVER_NINT_TABLE, nint_table, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_RAW_TABLE, raw_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_NBOOL_TABLE, nbool_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_POST_INIT, post_jail_init, + MAIL_SERVER_REQ_NINT_TABLE(nint_table), + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_RAW_TABLE(raw_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_NBOOL_TABLE(nbool_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), 0); } diff --git a/postfix/src/smtpd/smtpd_chat.h b/postfix/src/smtpd/smtpd_chat.h index 132314b67..6ac49ac0a 100644 --- a/postfix/src/smtpd/smtpd_chat.h +++ b/postfix/src/smtpd/smtpd_chat.h @@ -14,7 +14,7 @@ */ extern void smtpd_chat_reset(SMTPD_STATE *); extern void smtpd_chat_query(SMTPD_STATE *); -extern void PRINTFLIKE(2, 3) smtpd_chat_reply(SMTPD_STATE *, const char *, ...); +extern void PRINTFLIKE(2, 3) smtpd_chat_reply(SMTPD_STATE *, const char *,...); extern void smtpd_chat_notify(SMTPD_STATE *); /* LICENSE @@ -27,4 +27,3 @@ extern void smtpd_chat_notify(SMTPD_STATE *); /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /*--*/ - diff --git a/postfix/src/smtpd/smtpd_check.c b/postfix/src/smtpd/smtpd_check.c index 0c34982f7..a67f8789f 100644 --- a/postfix/src/smtpd/smtpd_check.c +++ b/postfix/src/smtpd/smtpd_check.c @@ -543,10 +543,10 @@ static void policy_client_register(const char *name) if ((policy_name = mystrtok(&cp, sep)) == 0) msg_fatal("empty policy service: \"%s\"", name); attr_override(cp, sep, parens, - ATTR_OVER_TIME_TABLE, time_table, - ATTR_OVER_INT_TABLE, int_table, - ATTR_OVER_STR_TABLE, str_table, - 0); + ATTR_OVER_REQ_TIME_TABLE(time_table), + ATTR_OVER_REQ_INT_TABLE(int_table), + ATTR_OVER_REQ_STR_TABLE(str_table), + ATTR_OVER_REQ_END); } else { policy_name = name; } diff --git a/postfix/src/smtpd/smtpd_check_backup.in b/postfix/src/smtpd/smtpd_check_backup.in index 84ba6ad6f..c4f44bb3d 100644 --- a/postfix/src/smtpd/smtpd_check_backup.in +++ b/postfix/src/smtpd/smtpd_check_backup.in @@ -12,9 +12,9 @@ mydestination wzv.porcupine.org,localhost.porcupine.org inet_interfaces 168.100.189.7,127.0.0.1 recipient_restrictions permit_mx_backup,reject rcpt wietse@wzv.porcupine.org -rcpt wietse@fist.porcupine.org +rcpt wietse@backup.porcupine.org rcpt wietse@porcupine.org permit_mx_backup_networks 168.100.189.5 -rcpt wietse@fist.porcupine.org +rcpt wietse@backup.porcupine.org permit_mx_backup_networks 168.100.189.4 -rcpt wietse@fist.porcupine.org +rcpt wietse@backup.porcupine.org diff --git a/postfix/src/smtpd/smtpd_check_backup.ref b/postfix/src/smtpd/smtpd_check_backup.ref index 3e0b643cc..9f20b9017 100644 --- a/postfix/src/smtpd/smtpd_check_backup.ref +++ b/postfix/src/smtpd/smtpd_check_backup.ref @@ -18,17 +18,17 @@ OK OK >>> rcpt wietse@wzv.porcupine.org OK ->>> rcpt wietse@fist.porcupine.org +>>> rcpt wietse@backup.porcupine.org OK >>> rcpt wietse@porcupine.org ./smtpd_check: : reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 : Recipient address rejected: Access denied; to= proto=SMTP 554 5.7.1 : Recipient address rejected: Access denied >>> permit_mx_backup_networks 168.100.189.5 OK ->>> rcpt wietse@fist.porcupine.org -./smtpd_check: : reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 : Recipient address rejected: Access denied; to= proto=SMTP -554 5.7.1 : Recipient address rejected: Access denied +>>> rcpt wietse@backup.porcupine.org +./smtpd_check: : reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 : Recipient address rejected: Access denied; to= proto=SMTP +554 5.7.1 : Recipient address rejected: Access denied >>> permit_mx_backup_networks 168.100.189.4 OK ->>> rcpt wietse@fist.porcupine.org +>>> rcpt wietse@backup.porcupine.org OK diff --git a/postfix/src/smtpd/smtpd_dns_filter.in b/postfix/src/smtpd/smtpd_dns_filter.in index e2048c57e..df1d8ef9e 100644 --- a/postfix/src/smtpd/smtpd_dns_filter.in +++ b/postfix/src/smtpd/smtpd_dns_filter.in @@ -19,7 +19,7 @@ smtpd_dns_reply_filter regexp:../dns/no-a.reg mail user@spike.porcupine.org helo spike.porcupine.org # EXPECT OK + "all A records dropped" warning + no delayed reject. -helo umbilical.porcupine.org +helo fist.porcupine.org mail user@spike.porcupine.org rcpt user@spike.porcupine.org smtpd_dns_reply_filter regexp:../dns/error.reg @@ -52,7 +52,7 @@ smtpd_dns_reply_filter regexp:../dns/no-a.reg # EXPECT OK (host has AAAA record). mail user@spike.porcupine.org # EXPECT OK + "all A records dropped" warning. -mail user@umbilical.porcupine.org +mail user@fist.porcupine.org smtpd_dns_reply_filter regexp:../dns/error.reg # EXPECT OK + "filter config error" warning + delayed reject. mail user@xn--1xa.porcupine.org diff --git a/postfix/src/smtpd/smtpd_dns_filter.ref b/postfix/src/smtpd/smtpd_dns_filter.ref index f3c9bf98e..edef24650 100644 --- a/postfix/src/smtpd/smtpd_dns_filter.ref +++ b/postfix/src/smtpd/smtpd_dns_filter.ref @@ -33,9 +33,9 @@ OK ./smtpd_check: ignoring DNS RR: spike.porcupine.org. TTL IN A 168.100.189.2 OK >>> # EXPECT OK + "all A records dropped" warning + no delayed reject. ->>> helo umbilical.porcupine.org -./smtpd_check: ignoring DNS RR: umbilical.porcupine.org. TTL IN A 168.100.189.1 -./smtpd_check: warning: umbilical.porcupine.org: address or MX lookup error: DNS reply filter drops all results +>>> helo fist.porcupine.org +./smtpd_check: ignoring DNS RR: fist.porcupine.org. TTL IN A 168.100.189.4 +./smtpd_check: warning: fist.porcupine.org: address or MX lookup error: DNS reply filter drops all results OK >>> mail user@spike.porcupine.org OK @@ -99,9 +99,9 @@ OK ./smtpd_check: ignoring DNS RR: spike.porcupine.org. TTL IN A 168.100.189.2 OK >>> # EXPECT OK + "all A records dropped" warning. ->>> mail user@umbilical.porcupine.org -./smtpd_check: ignoring DNS RR: umbilical.porcupine.org. TTL IN A 168.100.189.1 -./smtpd_check: warning: umbilical.porcupine.org: MX or address lookup error: DNS reply filter drops all results +>>> mail user@fist.porcupine.org +./smtpd_check: ignoring DNS RR: fist.porcupine.org. TTL IN A 168.100.189.4 +./smtpd_check: warning: fist.porcupine.org: MX or address lookup error: DNS reply filter drops all results OK >>> smtpd_dns_reply_filter regexp:../dns/error.reg OK diff --git a/postfix/src/smtpd/smtpd_proxy.c b/postfix/src/smtpd/smtpd_proxy.c index 8a6bffb3a..045c7f44d 100644 --- a/postfix/src/smtpd/smtpd_proxy.c +++ b/postfix/src/smtpd/smtpd_proxy.c @@ -347,8 +347,9 @@ static int smtpd_proxy_connect(SMTPD_STATE *state) } proxy->service_stream = vstream_fdopen(fd, O_RDWR); /* Needed by our DATA-phase record emulation routines. */ - vstream_control(proxy->service_stream, VSTREAM_CTL_CONTEXT, - (void *) state, VSTREAM_CTL_END); + vstream_control(proxy->service_stream, + VSTREAM_SCTL_CONTEXT((void *) state), + VSTREAM_SCTL_END); /* Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. */ if (connect_fn == inet_connect) vstream_tweak_tcp(proxy->service_stream); @@ -993,8 +994,9 @@ static int smtpd_proxy_replay_setup(SMTPD_STATE *state) /* * Needed by our DATA-phase record emulation routines. */ - vstream_control(smtpd_proxy_replay_stream, VSTREAM_CTL_CONTEXT, - (void *) state, VSTREAM_CTL_END); + vstream_control(smtpd_proxy_replay_stream, + VSTREAM_SCTL_CONTEXT((void *) state), + VSTREAM_SCTL_END); return (0); } diff --git a/postfix/src/smtpstone/Makefile.in b/postfix/src/smtpstone/Makefile.in index 1dec35497..5d1af3447 100644 --- a/postfix/src/smtpstone/Makefile.in +++ b/postfix/src/smtpstone/Makefile.in @@ -79,6 +79,7 @@ depend: $(MAKES) @$(EXPORT) make -f Makefile.in Makefile 1>&2 # do not edit below this line - it is generated by 'make depend' +qmqp-sink.o: ../../include/check_arg.h qmqp-sink.o: ../../include/events.h qmqp-sink.o: ../../include/htable.h qmqp-sink.o: ../../include/inet_proto.h @@ -95,6 +96,7 @@ qmqp-sink.o: ../../include/vbuf.h qmqp-sink.o: ../../include/vstream.h qmqp-sink.o: ../../include/vstring.h qmqp-sink.o: qmqp-sink.c +qmqp-source.o: ../../include/check_arg.h qmqp-source.o: ../../include/connect.h qmqp-source.o: ../../include/events.h qmqp-source.o: ../../include/get_hostname.h @@ -118,6 +120,7 @@ qmqp-source.o: ../../include/vbuf.h qmqp-source.o: ../../include/vstream.h qmqp-source.o: ../../include/vstring.h qmqp-source.o: qmqp-source.c +smtp-sink.o: ../../include/check_arg.h smtp-sink.o: ../../include/chroot_uid.h smtp-sink.o: ../../include/events.h smtp-sink.o: ../../include/get_hostname.h @@ -142,6 +145,7 @@ smtp-sink.o: ../../include/vstream.h smtp-sink.o: ../../include/vstring.h smtp-sink.o: ../../include/vstring_vstream.h smtp-sink.o: smtp-sink.c +smtp-source.o: ../../include/check_arg.h smtp-source.o: ../../include/compat_va_copy.h smtp-source.o: ../../include/connect.h smtp-source.o: ../../include/events.h diff --git a/postfix/src/smtpstone/smtp-sink.c b/postfix/src/smtpstone/smtp-sink.c index 51dcb34a8..3e48a3b87 100644 --- a/postfix/src/smtpstone/smtp-sink.c +++ b/postfix/src/smtpstone/smtp-sink.c @@ -95,6 +95,11 @@ /* .IP "\fB-h\fI hostname\fR" /* Use \fIhostname\fR in the SMTP greeting, in the HELO response, /* and in the EHLO response. The default hostname is "smtp-sink". +/* .IP "\fB-H\fI delay\fR" +/* Delay the first read operation after receiving DATA (time +/* in seconds). Combine with a large test message and a small +/* TCP window size (see the \fB-T\fR option) to test the Postfix +/* client write_wait() implementation. /* .IP \fB-L\fR /* Enable LMTP instead of SMTP. /* .IP "\fB-m \fIcount\fR (default: 256)" @@ -376,6 +381,7 @@ static int max_client_count = DEF_MAX_CLIENT_COUNT; static int client_count; static int sock; static int abort_delay = -1; +static int data_read_delay = 0; static char *single_template; /* individual template */ static char *shared_template; /* shared template */ @@ -732,6 +738,28 @@ static void abort_event(int unused_event, void *context) disconnect(state); } +/* delay_read_event - resume input event handling */ + +static void delay_read_event(int event, void *context) +{ + SINK_STATE *state = (SINK_STATE *) context; + + if (event != EVENT_TIME) + msg_panic("delay_read_event: non-timer event %d", event); + + event_enable_read(vstream_fileno(state->stream), read_event, (void *) state); + event_request_timer(read_timeout, (void *) state, var_tmout); +} + +/* delay_read - temporarily suspend input event handling */ + +static void delay_read(SINK_STATE *state, int delay) +{ + event_disable_readwrite(vstream_fileno(state->stream)); + event_cancel_timer(read_timeout, (void *) state); + event_request_timer(delay_read_event, (void *) state, delay); +} + /* data_response - respond to DATA command */ static void data_response(SINK_STATE *state, const char *unused_args) @@ -747,6 +775,9 @@ static void data_response(SINK_STATE *state, const char *unused_args) SMTP_FLUSH(state->stream); if (abort_delay < 0) { state->read_fn = data_read; + /* Todo: move into code that invokes the command response function. */ + if (data_read_delay > 0) + delay_read(state, data_read_delay); } else { /* Stop reading, send premature 550, and disconnect. */ event_disable_readwrite(vstream_fileno(state->stream)); @@ -1427,7 +1458,7 @@ int main(int argc, char **argv) /* * Parse JCL. */ - while ((ch = GETOPT(argc, argv, "468aA:b:B:cCd:D:eEf:Fh:Ln:m:M:NpPq:Q:r:R:s:S:t:T:u:vw:W:")) > 0) { + while ((ch = GETOPT(argc, argv, "468aA:b:B:cCd:D:eEf:Fh:H:Ln:m:M:NpPq:Q:r:R:s:S:t:T:u:vw:W:")) > 0) { switch (ch) { case '4': protocols = INET_PROTO_NAME_IPV4; @@ -1489,6 +1520,10 @@ int main(int argc, char **argv) case 'h': var_myhostname = optarg; break; + case 'H': + if ((data_read_delay = atoi(optarg)) <= 0) + msg_fatal("bad data read delay: %s", optarg); + break; case 'L': enable_lmtp = 1; break; diff --git a/postfix/src/smtpstone/smtp-source.c b/postfix/src/smtpstone/smtp-source.c index f19d284de..36fc78890 100644 --- a/postfix/src/smtpstone/smtp-source.c +++ b/postfix/src/smtpstone/smtp-source.c @@ -305,7 +305,7 @@ static RESPONSE *response(VSTREAM *stream, VSTRING *buf) */ if (rdata.buf == 0) { rdata.buf = vstring_alloc(100); - vstring_ctl(rdata.buf, VSTRING_CTL_MAXLEN, (ssize_t) var_line_limit, 0); + vstring_ctl(rdata.buf, VSTRING_SCTL_MAXLEN(var_line_limit), 0); } /* @@ -1142,7 +1142,7 @@ int main(int argc, char **argv) */ if (buffer == 0) { buffer = vstring_alloc(100); - vstring_ctl(buffer, VSTRING_CTL_MAXLEN, (ssize_t) var_line_limit, 0); + vstring_ctl(buffer, VSTRING_SCTL_MAXLEN(var_line_limit), 0); } /* diff --git a/postfix/src/spawn/Makefile.in b/postfix/src/spawn/Makefile.in index 51fdeee7f..85863b76d 100644 --- a/postfix/src/spawn/Makefile.in +++ b/postfix/src/spawn/Makefile.in @@ -60,6 +60,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' spawn.o: ../../include/argv.h +spawn.o: ../../include/check_arg.h spawn.o: ../../include/dict.h spawn.o: ../../include/mail_conf.h spawn.o: ../../include/mail_params.h diff --git a/postfix/src/spawn/spawn.c b/postfix/src/spawn/spawn.c index c44ebcdfc..419049a2a 100644 --- a/postfix/src/spawn/spawn.c +++ b/postfix/src/spawn/spawn.c @@ -298,15 +298,15 @@ static void spawn_service(VSTREAM *client_stream, char *service, char **argv) * Execute the command. */ export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ); - status = spawn_command(SPAWN_CMD_STDIN, vstream_fileno(client_stream), - SPAWN_CMD_STDOUT, vstream_fileno(client_stream), - SPAWN_CMD_STDERR, vstream_fileno(client_stream), - SPAWN_CMD_UID, attr.uid, - SPAWN_CMD_GID, attr.gid, - SPAWN_CMD_ARGV, attr.argv, - SPAWN_CMD_TIME_LIMIT, attr.time_limit, - SPAWN_CMD_EXPORT, export_env->argv, - SPAWN_CMD_END); + status = spawn_command(SPAWN_SCMD_STDIN(vstream_fileno(client_stream)), + SPAWN_SCMD_STDOUT(vstream_fileno(client_stream)), + SPAWN_SCMD_STDERR(vstream_fileno(client_stream)), + SPAWN_SCMD_UID(attr.uid), + SPAWN_SCMD_GID(attr.gid), + SPAWN_SCMD_ARGV(attr.argv), + SPAWN_SCMD_TIME_LIMIT(attr.time_limit), + SPAWN_SCMD_EXPORT(export_env->argv), + SPAWN_SCMD_END); argv_free(export_env); /* @@ -358,9 +358,9 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, spawn_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_POST_INIT, drop_privileges, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_PRIVILEGED, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_POST_INIT(drop_privileges), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_PRIVILEGED, 0); } diff --git a/postfix/src/tls/Makefile.in b/postfix/src/tls/Makefile.in index 6324fb59c..cddb4915b 100644 --- a/postfix/src/tls/Makefile.in +++ b/postfix/src/tls/Makefile.in @@ -105,6 +105,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' tls_bio_ops.o: ../../include/argv.h +tls_bio_ops.o: ../../include/check_arg.h tls_bio_ops.o: ../../include/dns.h tls_bio_ops.o: ../../include/iostuff.h tls_bio_ops.o: ../../include/msg.h @@ -119,6 +120,7 @@ tls_bio_ops.o: ../../include/vstring.h tls_bio_ops.o: tls.h tls_bio_ops.o: tls_bio_ops.c tls_certkey.o: ../../include/argv.h +tls_certkey.o: ../../include/check_arg.h tls_certkey.o: ../../include/dns.h tls_certkey.o: ../../include/mail_params.h tls_certkey.o: ../../include/msg.h @@ -133,6 +135,7 @@ tls_certkey.o: ../../include/vstring.h tls_certkey.o: tls.h tls_certkey.o: tls_certkey.c tls_client.o: ../../include/argv.h +tls_client.o: ../../include/check_arg.h tls_client.o: ../../include/dict.h tls_client.o: ../../include/dns.h tls_client.o: ../../include/iostuff.h @@ -155,6 +158,7 @@ tls_client.o: tls_client.c tls_client.o: tls_mgr.h tls_client.o: tls_scache.h tls_dane.o: ../../include/argv.h +tls_dane.o: ../../include/check_arg.h tls_dane.o: ../../include/ctable.h tls_dane.o: ../../include/dns.h tls_dane.o: ../../include/events.h @@ -177,6 +181,7 @@ tls_dane.o: ../../include/vstring.h tls_dane.o: tls.h tls_dane.o: tls_dane.c tls_dh.o: ../../include/argv.h +tls_dh.o: ../../include/check_arg.h tls_dh.o: ../../include/dns.h tls_dh.o: ../../include/mail_params.h tls_dh.o: ../../include/msg.h @@ -191,6 +196,7 @@ tls_dh.o: ../../include/vstring.h tls_dh.o: tls.h tls_dh.o: tls_dh.c tls_fprint.o: ../../include/argv.h +tls_fprint.o: ../../include/check_arg.h tls_fprint.o: ../../include/dns.h tls_fprint.o: ../../include/mail_params.h tls_fprint.o: ../../include/msg.h @@ -207,6 +213,7 @@ tls_fprint.o: ../../include/vstring.h tls_fprint.o: tls.h tls_fprint.o: tls_fprint.c tls_level.o: ../../include/argv.h +tls_level.o: ../../include/check_arg.h tls_level.o: ../../include/dns.h tls_level.o: ../../include/myaddrinfo.h tls_level.o: ../../include/name_code.h @@ -240,6 +247,7 @@ tls_mgr.o: tls_mgr.c tls_mgr.o: tls_mgr.h tls_mgr.o: tls_scache.h tls_misc.o: ../../include/argv.h +tls_misc.o: ../../include/check_arg.h tls_misc.o: ../../include/dns.h tls_misc.o: ../../include/mail_conf.h tls_misc.o: ../../include/mail_params.h @@ -349,6 +357,7 @@ tls_proxy_scan.o: tls.h tls_proxy_scan.o: tls_proxy.h tls_proxy_scan.o: tls_proxy_scan.c tls_rsa.o: ../../include/argv.h +tls_rsa.o: ../../include/check_arg.h tls_rsa.o: ../../include/dns.h tls_rsa.o: ../../include/msg.h tls_rsa.o: ../../include/myaddrinfo.h @@ -362,6 +371,7 @@ tls_rsa.o: ../../include/vstring.h tls_rsa.o: tls.h tls_rsa.o: tls_rsa.c tls_scache.o: ../../include/argv.h +tls_scache.o: ../../include/check_arg.h tls_scache.o: ../../include/dict.h tls_scache.o: ../../include/hex_code.h tls_scache.o: ../../include/msg.h @@ -376,6 +386,7 @@ tls_scache.o: ../../include/vstring.h tls_scache.o: tls_scache.c tls_scache.o: tls_scache.h tls_seed.o: ../../include/argv.h +tls_seed.o: ../../include/check_arg.h tls_seed.o: ../../include/dict.h tls_seed.o: ../../include/dns.h tls_seed.o: ../../include/msg.h @@ -393,6 +404,7 @@ tls_seed.o: tls_mgr.h tls_seed.o: tls_scache.h tls_seed.o: tls_seed.c tls_server.o: ../../include/argv.h +tls_server.o: ../../include/check_arg.h tls_server.o: ../../include/dict.h tls_server.o: ../../include/dns.h tls_server.o: ../../include/hex_code.h @@ -415,6 +427,7 @@ tls_server.o: tls_mgr.h tls_server.o: tls_scache.h tls_server.o: tls_server.c tls_session.o: ../../include/argv.h +tls_session.o: ../../include/check_arg.h tls_session.o: ../../include/dns.h tls_session.o: ../../include/msg.h tls_session.o: ../../include/myaddrinfo.h @@ -429,6 +442,7 @@ tls_session.o: ../../include/vstring.h tls_session.o: tls.h tls_session.o: tls_session.c tls_stream.o: ../../include/argv.h +tls_stream.o: ../../include/check_arg.h tls_stream.o: ../../include/dns.h tls_stream.o: ../../include/iostuff.h tls_stream.o: ../../include/msg.h @@ -443,6 +457,7 @@ tls_stream.o: ../../include/vstring.h tls_stream.o: tls.h tls_stream.o: tls_stream.c tls_verify.o: ../../include/argv.h +tls_verify.o: ../../include/check_arg.h tls_verify.o: ../../include/dns.h tls_verify.o: ../../include/msg.h tls_verify.o: ../../include/myaddrinfo.h diff --git a/postfix/src/tls/tls_proxy_clnt.c b/postfix/src/tls/tls_proxy_clnt.c index 70c0096dc..c4516ad86 100644 --- a/postfix/src/tls/tls_proxy_clnt.c +++ b/postfix/src/tls/tls_proxy_clnt.c @@ -27,7 +27,7 @@ /* The result value is a null pointer on failure. The peer_stream /* is not closed. The resulting proxy stream is single-buffered. /* -/* After this, it is a good idea to use the VSTREAM_CTL_SWAP_FD +/* After this, it is a good idea to use the VSTREAM_SCTL_SWAP_FD /* request to swap the file descriptors between the plaintext /* peer_stream and the proxy stream from tls_proxy_open(). /* This avoids the loss of application-configurable VSTREAM diff --git a/postfix/src/tls/tls_stream.c b/postfix/src/tls/tls_stream.c index e58a30b9a..3d4450914 100644 --- a/postfix/src/tls/tls_stream.c +++ b/postfix/src/tls/tls_stream.c @@ -134,10 +134,10 @@ static ssize_t tls_timed_write(int fd, void *buf, size_t len, int timeout, void tls_stream_start(VSTREAM *stream, TLS_SESS_STATE *context) { vstream_control(stream, - VSTREAM_CTL_READ_FN, tls_timed_read, - VSTREAM_CTL_WRITE_FN, tls_timed_write, - VSTREAM_CTL_CONTEXT, (void *) context, - VSTREAM_CTL_END); + VSTREAM_SCTL_READ_FN(tls_timed_read), + VSTREAM_SCTL_WRITE_FN(tls_timed_write), + VSTREAM_SCTL_CONTEXT(context), + VSTREAM_SCTL_END); } /* tls_stream_stop - stop VSTREAM over TLS */ @@ -151,10 +151,10 @@ void tls_stream_stop(VSTREAM *stream) * noise when used. */ vstream_control(stream, - VSTREAM_CTL_READ_FN, dummy_read, - VSTREAM_CTL_WRITE_FN, dummy_write, - VSTREAM_CTL_CONTEXT, (void *) 0, - VSTREAM_CTL_END); + VSTREAM_SCTL_READ_FN(dummy_read), + VSTREAM_SCTL_WRITE_FN(dummy_write), + VSTREAM_SCTL_CONTEXT((void *) 0), + VSTREAM_SCTL_END); } #endif diff --git a/postfix/src/tlsmgr/tlsmgr.c b/postfix/src/tlsmgr/tlsmgr.c index 7072c0c6b..b20ffb68b 100644 --- a/postfix/src/tlsmgr/tlsmgr.c +++ b/postfix/src/tlsmgr/tlsmgr.c @@ -1046,14 +1046,14 @@ int main(int argc, char **argv) * monitoring our service port while this process runs. */ multi_server_main(argc, argv, tlsmgr_service, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_PRE_INIT, tlsmgr_pre_init, - MAIL_SERVER_POST_INIT, tlsmgr_post_init, - MAIL_SERVER_EXIT, tlsmgr_before_exit, - MAIL_SERVER_LOOP, tlsmgr_loop, - MAIL_SERVER_SOLITARY, + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_PRE_INIT(tlsmgr_pre_init), + MAIL_SERVER_REQ_POST_INIT(tlsmgr_post_init), + MAIL_SERVER_REQ_EXIT(tlsmgr_before_exit), + MAIL_SERVER_REQ_LOOP(tlsmgr_loop), + MAIL_SERVER_REQ_SOLITARY, 0); } diff --git a/postfix/src/tlsproxy/Makefile.in b/postfix/src/tlsproxy/Makefile.in index 8e97f2105..744b1d121 100644 --- a/postfix/src/tlsproxy/Makefile.in +++ b/postfix/src/tlsproxy/Makefile.in @@ -90,8 +90,10 @@ tlsproxy.o: ../../include/vstring.h tlsproxy.o: tlsproxy.c tlsproxy.o: tlsproxy.h tlsproxy_state.o: ../../include/argv.h +tlsproxy_state.o: ../../include/check_arg.h tlsproxy_state.o: ../../include/dns.h tlsproxy_state.o: ../../include/events.h +tlsproxy_state.o: ../../include/mail_conf.h tlsproxy_state.o: ../../include/mail_server.h tlsproxy_state.o: ../../include/msg.h tlsproxy_state.o: ../../include/myaddrinfo.h diff --git a/postfix/src/tlsproxy/tlsproxy.c b/postfix/src/tlsproxy/tlsproxy.c index 1bd7fc398..cb05c85a1 100644 --- a/postfix/src/tlsproxy/tlsproxy.c +++ b/postfix/src/tlsproxy/tlsproxy.c @@ -883,9 +883,9 @@ static void tlsp_service(VSTREAM *plaintext_stream, */ non_blocking(plaintext_fd, NON_BLOCKING); vstream_control(plaintext_stream, - VSTREAM_CTL_PATH, "plaintext", - VSTREAM_CTL_TIMEOUT, 5, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH("plaintext"), + VSTREAM_SCTL_TIMEOUT(5), + VSTREAM_SCTL_END); /* * Receive postscreen's remote SMTP client address/port and socket. @@ -1108,16 +1108,16 @@ int main(int argc, char **argv) * Pass control to the single-threaded service skeleton. */ event_server_main(argc, argv, tlsp_service, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_NINT_TABLE, nint_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_NBOOL_TABLE, nbool_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_SLOW_EXIT, tlsp_drain, - MAIL_SERVER_WATCHDOG, &var_tlsp_watchdog, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_NINT_TABLE(nint_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_NBOOL_TABLE(nbool_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_SLOW_EXIT(tlsp_drain), + MAIL_SERVER_REQ_WATCHDOG(&var_tlsp_watchdog), 0); } diff --git a/postfix/src/trivial-rewrite/trivial-rewrite.c b/postfix/src/trivial-rewrite/trivial-rewrite.c index d167a9a7c..ab70d5ad2 100644 --- a/postfix/src/trivial-rewrite/trivial-rewrite.c +++ b/postfix/src/trivial-rewrite/trivial-rewrite.c @@ -629,13 +629,13 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; multi_server_main(argc, argv, rewrite_service, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_NBOOL_TABLE, nbool_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_POST_INIT, post_jail_init, + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_NBOOL_TABLE(nbool_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), #ifdef CHECK_TABLE_STATS_BEFORE_ACCEPT - MAIL_SERVER_PRE_ACCEPT, pre_accept, + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), #endif 0); } diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index ded35f049..e8739d1b2 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -39,7 +39,7 @@ SRCS = alldig.c allprint.c argv.c argv_split.c attr_clnt.c attr_print0.c \ dict_sockmap.c line_number.c recv_pass_attr.c pass_accept.c \ poll_fd.c timecmp.c slmdb.c dict_pipe.c dict_random.c \ valid_utf8_hostname.c midna.c argv_splitq.c balpar.c dict_union.c \ - extpar.c dict_inline.c attr.c + extpar.c dict_inline.c OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \ attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \ @@ -80,7 +80,7 @@ OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ dict_sockmap.o line_number.o recv_pass_attr.o pass_accept.o \ poll_fd.o timecmp.o $(NON_PLUGIN_MAP_OBJ) dict_pipe.o dict_random.o \ valid_utf8_hostname.o midna.o argv_splitq.o balpar.o dict_union.o \ - extpar.o dict_inline.o attr.o + extpar.o dict_inline.o # MAP_OBJ is for maps that may be dynamically loaded with dynamicmaps.cf. # When hard-linking these, makedefs sets NON_PLUGIN_MAP_OBJ=$(MAP_OBJ), # otherwise it sets the PLUGIN_* macros. @@ -509,7 +509,7 @@ midna: $(LIB) $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS) mv junk $@.o -tests: valid_hostname_test mac_expand_test dict_test unescape_test \ +tests: all valid_hostname_test mac_expand_test dict_test unescape_test \ hex_quote_test ctable_test inet_addr_list_test base64_code_test \ attr_scan64_test attr_scan0_test dict_pcre_test host_port_test \ dict_cidr_test attr_scan_plain_test htable_test hex_code_test \ @@ -761,21 +761,25 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' allascii.o: allascii.c +allascii.o: check_arg.h allascii.o: stringops.h allascii.o: sys_defs.h allascii.o: vbuf.h allascii.o: vstring.h alldig.o: alldig.c +alldig.o: check_arg.h alldig.o: stringops.h alldig.o: sys_defs.h alldig.o: vbuf.h alldig.o: vstring.h allprint.o: allprint.c +allprint.o: check_arg.h allprint.o: stringops.h allprint.o: sys_defs.h allprint.o: vbuf.h allprint.o: vstring.h allspace.o: allspace.c +allspace.o: check_arg.h allspace.o: stringops.h allspace.o: sys_defs.h allspace.o: vbuf.h @@ -787,6 +791,7 @@ argv.o: mymalloc.h argv.o: sys_defs.h argv_split.o: argv.h argv_split.o: argv_split.c +argv_split.o: check_arg.h argv_split.o: msg.h argv_split.o: mymalloc.h argv_split.o: stringops.h @@ -795,22 +800,13 @@ argv_split.o: vbuf.h argv_split.o: vstring.h argv_splitq.o: argv.h argv_splitq.o: argv_splitq.c +argv_splitq.o: check_arg.h argv_splitq.o: msg.h argv_splitq.o: mymalloc.h argv_splitq.o: stringops.h argv_splitq.o: sys_defs.h argv_splitq.o: vbuf.h argv_splitq.o: vstring.h -attr.o: attr.c -attr.o: attr.h -attr.o: check_arg.h -attr.o: htable.h -attr.o: mymalloc.h -attr.o: nvtable.h -attr.o: sys_defs.h -attr.o: vbuf.h -attr.o: vstream.h -attr.o: vstring.h attr_clnt.o: attr.h attr_clnt.o: attr_clnt.c attr_clnt.o: attr_clnt.h @@ -901,6 +897,7 @@ attr_scan_plain.o: vstream.h attr_scan_plain.o: vstring.h auto_clnt.o: auto_clnt.c auto_clnt.o: auto_clnt.h +auto_clnt.o: check_arg.h auto_clnt.o: connect.h auto_clnt.o: events.h auto_clnt.o: iostuff.h @@ -911,12 +908,14 @@ auto_clnt.o: sys_defs.h auto_clnt.o: vbuf.h auto_clnt.o: vstream.h balpar.o: balpar.c +balpar.o: check_arg.h balpar.o: stringops.h balpar.o: sys_defs.h balpar.o: vbuf.h balpar.o: vstring.h base32_code.o: base32_code.c base32_code.o: base32_code.h +base32_code.o: check_arg.h base32_code.o: msg.h base32_code.o: mymalloc.h base32_code.o: sys_defs.h @@ -924,12 +923,14 @@ base32_code.o: vbuf.h base32_code.o: vstring.h base64_code.o: base64_code.c base64_code.o: base64_code.h +base64_code.o: check_arg.h base64_code.o: msg.h base64_code.o: mymalloc.h base64_code.o: sys_defs.h base64_code.o: vbuf.h base64_code.o: vstring.h basename.o: basename.c +basename.o: check_arg.h basename.o: stringops.h basename.o: sys_defs.h basename.o: vbuf.h @@ -939,12 +940,11 @@ binhash.o: binhash.h binhash.o: msg.h binhash.o: mymalloc.h binhash.o: sys_defs.h -check_arg.o: check_arg.c -check_arg.o: sys_defs.h chroot_uid.o: chroot_uid.c chroot_uid.o: chroot_uid.h chroot_uid.o: msg.h chroot_uid.o: sys_defs.h +cidr_match.o: check_arg.h cidr_match.o: cidr_match.c cidr_match.o: cidr_match.h cidr_match.o: mask_addr.h @@ -965,6 +965,7 @@ close_on_exec.o: close_on_exec.c close_on_exec.o: iostuff.h close_on_exec.o: msg.h close_on_exec.o: sys_defs.h +concatenate.o: check_arg.h concatenate.o: compat_va_copy.h concatenate.o: concatenate.c concatenate.o: mymalloc.h @@ -980,6 +981,7 @@ ctable.o: mymalloc.h ctable.o: ring.h ctable.o: sys_defs.h dict.o: argv.h +dict.o: check_arg.h dict.o: dict.c dict.o: dict.h dict.o: dict_ht.h @@ -1000,6 +1002,7 @@ dict.o: vstream.h dict.o: vstring.h dict.o: warn_stat.h dict_alloc.o: argv.h +dict_alloc.o: check_arg.h dict_alloc.o: dict.h dict_alloc.o: dict_alloc.c dict_alloc.o: msg.h @@ -1010,6 +1013,7 @@ dict_alloc.o: vbuf.h dict_alloc.o: vstream.h dict_alloc.o: vstring.h dict_cache.o: argv.h +dict_cache.o: check_arg.h dict_cache.o: dict.h dict_cache.o: dict_cache.c dict_cache.o: dict_cache.h @@ -1022,6 +1026,7 @@ dict_cache.o: vbuf.h dict_cache.o: vstream.h dict_cache.o: vstring.h dict_cdb.o: argv.h +dict_cdb.o: check_arg.h dict_cdb.o: dict.h dict_cdb.o: dict_cdb.c dict_cdb.o: dict_cdb.h @@ -1036,6 +1041,7 @@ dict_cdb.o: vstream.h dict_cdb.o: vstring.h dict_cdb.o: warn_stat.h dict_cidr.o: argv.h +dict_cidr.o: check_arg.h dict_cidr.o: cidr_match.h dict_cidr.o: dict.h dict_cidr.o: dict_cidr.c @@ -1052,6 +1058,7 @@ dict_cidr.o: vstream.h dict_cidr.o: vstring.h dict_cidr.o: warn_stat.h dict_db.o: argv.h +dict_db.o: check_arg.h dict_db.o: dict.h dict_db.o: dict_db.c dict_db.o: dict_db.h @@ -1068,6 +1075,7 @@ dict_db.o: warn_stat.h dict_dbm.o: dict_dbm.c dict_dbm.o: sys_defs.h 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: msg.h @@ -1078,6 +1086,7 @@ dict_debug.o: vbuf.h dict_debug.o: vstream.h dict_debug.o: vstring.h dict_env.o: argv.h +dict_env.o: check_arg.h dict_env.o: dict.h dict_env.o: dict_env.c dict_env.o: dict_env.h @@ -1091,6 +1100,7 @@ dict_env.o: vbuf.h dict_env.o: vstream.h dict_env.o: vstring.h dict_fail.o: argv.h +dict_fail.o: check_arg.h dict_fail.o: dict.h dict_fail.o: dict_fail.c dict_fail.o: dict_fail.h @@ -1102,6 +1112,7 @@ dict_fail.o: vbuf.h dict_fail.o: vstream.h dict_fail.o: vstring.h dict_ht.o: argv.h +dict_ht.o: check_arg.h dict_ht.o: dict.h dict_ht.o: dict_ht.c dict_ht.o: dict_ht.h @@ -1114,6 +1125,7 @@ dict_ht.o: vbuf.h dict_ht.o: vstream.h dict_ht.o: vstring.h dict_inline.o: argv.h +dict_inline.o: check_arg.h dict_inline.o: dict.h dict_inline.o: dict_inline.c dict_inline.o: dict_inline.h @@ -1127,6 +1139,7 @@ dict_inline.o: vbuf.h dict_inline.o: vstream.h dict_inline.o: vstring.h dict_lmdb.o: argv.h +dict_lmdb.o: check_arg.h dict_lmdb.o: dict.h dict_lmdb.o: dict_lmdb.c dict_lmdb.o: dict_lmdb.h @@ -1145,6 +1158,7 @@ dict_lmdb.o: warn_stat.h dict_ni.o: dict_ni.c dict_ni.o: sys_defs.h dict_nis.o: argv.h +dict_nis.o: check_arg.h dict_nis.o: dict.h dict_nis.o: dict_nis.c dict_nis.o: dict_nis.h @@ -1157,6 +1171,7 @@ dict_nis.o: vbuf.h dict_nis.o: vstream.h dict_nis.o: vstring.h dict_nisplus.o: argv.h +dict_nisplus.o: check_arg.h dict_nisplus.o: dict.h dict_nisplus.o: dict_nisplus.c dict_nisplus.o: dict_nisplus.h @@ -1169,6 +1184,7 @@ dict_nisplus.o: vbuf.h dict_nisplus.o: vstream.h dict_nisplus.o: vstring.h dict_open.o: argv.h +dict_open.o: check_arg.h dict_open.o: dict.h dict_open.o: dict_cdb.h dict_open.o: dict_cidr.h @@ -1205,6 +1221,7 @@ dict_open.o: vbuf.h dict_open.o: vstream.h dict_open.o: vstring.h dict_pcre.o: argv.h +dict_pcre.o: check_arg.h dict_pcre.o: dict.h dict_pcre.o: dict_pcre.c dict_pcre.o: dict_pcre.h @@ -1221,6 +1238,7 @@ dict_pcre.o: vstream.h dict_pcre.o: vstring.h dict_pcre.o: warn_stat.h dict_pipe.o: argv.h +dict_pipe.o: check_arg.h dict_pipe.o: dict.h dict_pipe.o: dict_pipe.c dict_pipe.o: dict_pipe.h @@ -1234,6 +1252,7 @@ dict_pipe.o: vbuf.h dict_pipe.o: vstream.h dict_pipe.o: vstring.h dict_random.o: argv.h +dict_random.o: check_arg.h dict_random.o: dict.h dict_random.o: dict_random.c dict_random.o: dict_random.h @@ -1247,6 +1266,7 @@ dict_random.o: vbuf.h dict_random.o: vstream.h dict_random.o: vstring.h dict_regexp.o: argv.h +dict_regexp.o: check_arg.h dict_regexp.o: dict.h dict_regexp.o: dict_regexp.c dict_regexp.o: dict_regexp.h @@ -1263,6 +1283,7 @@ dict_regexp.o: vstream.h dict_regexp.o: vstring.h dict_regexp.o: warn_stat.h dict_sdbm.o: argv.h +dict_sdbm.o: check_arg.h dict_sdbm.o: dict.h dict_sdbm.o: dict_sdbm.c dict_sdbm.o: dict_sdbm.h @@ -1279,6 +1300,7 @@ dict_sdbm.o: vstring.h dict_sdbm.o: warn_stat.h dict_sockmap.o: argv.h dict_sockmap.o: auto_clnt.h +dict_sockmap.o: check_arg.h dict_sockmap.o: dict.h dict_sockmap.o: dict_sockmap.c dict_sockmap.o: dict_sockmap.h @@ -1294,6 +1316,7 @@ dict_sockmap.o: vbuf.h dict_sockmap.o: vstream.h dict_sockmap.o: vstring.h dict_static.o: argv.h +dict_static.o: check_arg.h dict_static.o: dict.h dict_static.o: dict_static.c dict_static.o: dict_static.h @@ -1306,6 +1329,7 @@ dict_static.o: vbuf.h dict_static.o: vstream.h dict_static.o: vstring.h dict_surrogate.o: argv.h +dict_surrogate.o: check_arg.h dict_surrogate.o: compat_va_copy.h dict_surrogate.o: dict.h dict_surrogate.o: dict_surrogate.c @@ -1317,6 +1341,7 @@ dict_surrogate.o: vbuf.h dict_surrogate.o: vstream.h dict_surrogate.o: vstring.h dict_tcp.o: argv.h +dict_tcp.o: check_arg.h dict_tcp.o: connect.h dict_tcp.o: dict.h dict_tcp.o: dict_tcp.c @@ -1333,6 +1358,7 @@ dict_tcp.o: vstream.h dict_tcp.o: vstring.h dict_tcp.o: vstring_vstream.h dict_test.o: argv.h +dict_test.o: check_arg.h dict_test.o: dict.h dict_test.o: dict_db.h dict_test.o: dict_lmdb.h @@ -1347,6 +1373,7 @@ dict_test.o: vstream.h dict_test.o: vstring.h dict_test.o: vstring_vstream.h dict_thash.o: argv.h +dict_thash.o: check_arg.h dict_thash.o: dict.h dict_thash.o: dict_thash.c dict_thash.o: dict_thash.h @@ -1363,6 +1390,7 @@ dict_thash.o: vstream.h dict_thash.o: vstring.h dict_thash.o: warn_stat.h dict_union.o: argv.h +dict_union.o: check_arg.h dict_union.o: dict.h dict_union.o: dict_union.c dict_union.o: dict_union.h @@ -1376,6 +1404,7 @@ dict_union.o: vbuf.h dict_union.o: vstream.h dict_union.o: vstring.h dict_unix.o: argv.h +dict_unix.o: check_arg.h dict_unix.o: dict.h dict_unix.o: dict_unix.c dict_unix.o: dict_unix.h @@ -1387,6 +1416,7 @@ dict_unix.o: sys_defs.h dict_unix.o: vbuf.h dict_unix.o: vstream.h dict_unix.o: vstring.h +dir_forest.o: check_arg.h dir_forest.o: dir_forest.c dir_forest.o: dir_forest.h dir_forest.o: msg.h @@ -1410,6 +1440,7 @@ duplex_pipe.o: duplex_pipe.c duplex_pipe.o: iostuff.h duplex_pipe.o: sane_socketpair.h duplex_pipe.o: sys_defs.h +edit_file.o: check_arg.h edit_file.o: edit_file.c edit_file.o: edit_file.h edit_file.o: msg.h @@ -1435,6 +1466,7 @@ exec_command.o: exec_command.c exec_command.o: exec_command.h exec_command.o: msg.h exec_command.o: sys_defs.h +extpar.o: check_arg.h extpar.o: extpar.c extpar.o: msg.h extpar.o: stringops.h @@ -1453,6 +1485,7 @@ fifo_rdonly_bug.o: fifo_rdonly_bug.c fifo_rdonly_bug.o: sys_defs.h fifo_rdwr_bug.o: fifo_rdwr_bug.c fifo_rdwr_bug.o: sys_defs.h +fifo_trigger.o: check_arg.h fifo_trigger.o: fifo_trigger.c fifo_trigger.o: iostuff.h fifo_trigger.o: msg.h @@ -1466,6 +1499,7 @@ file_limit.o: file_limit.c file_limit.o: iostuff.h file_limit.o: msg.h file_limit.o: sys_defs.h +find_inet.o: check_arg.h find_inet.o: find_inet.c find_inet.o: find_inet.h find_inet.o: msg.h @@ -1473,6 +1507,7 @@ find_inet.o: stringops.h find_inet.o: sys_defs.h find_inet.o: vbuf.h find_inet.o: vstring.h +format_tv.o: check_arg.h format_tv.o: format_tv.c format_tv.o: format_tv.h format_tv.o: msg.h @@ -1483,6 +1518,7 @@ fsspace.o: fsspace.c fsspace.o: fsspace.h fsspace.o: msg.h fsspace.o: sys_defs.h +fullname.o: check_arg.h fullname.o: fullname.c fullname.o: fullname.h fullname.o: safe.h @@ -1501,6 +1537,7 @@ get_hostname.o: msg.h get_hostname.o: mymalloc.h get_hostname.o: sys_defs.h get_hostname.o: valid_hostname.h +hex_code.o: check_arg.h hex_code.o: hex_code.c hex_code.o: hex_code.h hex_code.o: msg.h @@ -1508,12 +1545,14 @@ hex_code.o: mymalloc.h hex_code.o: sys_defs.h hex_code.o: vbuf.h hex_code.o: vstring.h +hex_quote.o: check_arg.h hex_quote.o: hex_quote.c hex_quote.o: hex_quote.h hex_quote.o: msg.h hex_quote.o: sys_defs.h hex_quote.o: vbuf.h hex_quote.o: vstring.h +host_port.o: check_arg.h host_port.o: host_port.c host_port.o: host_port.h host_port.o: msg.h @@ -1545,6 +1584,7 @@ inet_addr_list.o: myaddrinfo.h inet_addr_list.o: mymalloc.h inet_addr_list.o: sock_addr.h inet_addr_list.o: sys_defs.h +inet_addr_local.o: check_arg.h inet_addr_local.o: hex_code.h inet_addr_local.o: inet_addr_list.h inet_addr_local.o: inet_addr_local.c @@ -1581,6 +1621,7 @@ inet_listen.o: mymalloc.h inet_listen.o: sane_accept.h inet_listen.o: sock_addr.h inet_listen.o: sys_defs.h +inet_proto.o: check_arg.h inet_proto.o: inet_proto.c inet_proto.o: inet_proto.h inet_proto.o: msg.h @@ -1602,6 +1643,7 @@ inet_windowsize.o: inet_windowsize.c inet_windowsize.o: iostuff.h inet_windowsize.o: msg.h inet_windowsize.o: sys_defs.h +ip_match.o: check_arg.h ip_match.o: ip_match.c ip_match.o: ip_match.h ip_match.o: msg.h @@ -1612,6 +1654,7 @@ ip_match.o: vstring.h killme_after.o: killme_after.c killme_after.o: killme_after.h killme_after.o: sys_defs.h +line_number.o: check_arg.h line_number.o: line_number.c line_number.o: line_number.h line_number.o: sys_defs.h @@ -1620,6 +1663,7 @@ line_number.o: vstring.h line_wrap.o: line_wrap.c line_wrap.o: line_wrap.h line_wrap.o: sys_defs.h +load_file.o: check_arg.h load_file.o: iostuff.h load_file.o: load_file.c load_file.o: load_file.h @@ -1629,7 +1673,10 @@ load_file.o: vbuf.h load_file.o: vstream.h load_file.o: warn_stat.h load_lib.o: load_lib.c +load_lib.o: load_lib.h +load_lib.o: msg.h load_lib.o: sys_defs.h +lowercase.o: check_arg.h lowercase.o: lowercase.c lowercase.o: stringops.h lowercase.o: sys_defs.h @@ -1641,6 +1688,7 @@ lstat_as.o: msg.h lstat_as.o: set_eugid.h lstat_as.o: sys_defs.h lstat_as.o: warn_stat.h +mac_expand.o: check_arg.h mac_expand.o: mac_expand.c mac_expand.o: mac_expand.h mac_expand.o: mac_parse.h @@ -1651,12 +1699,14 @@ mac_expand.o: stringops.h mac_expand.o: sys_defs.h mac_expand.o: vbuf.h mac_expand.o: vstring.h +mac_parse.o: check_arg.h mac_parse.o: mac_parse.c mac_parse.o: mac_parse.h mac_parse.o: msg.h mac_parse.o: sys_defs.h mac_parse.o: vbuf.h mac_parse.o: vstring.h +make_dirs.o: check_arg.h make_dirs.o: make_dirs.c make_dirs.o: make_dirs.h make_dirs.o: msg.h @@ -1671,6 +1721,7 @@ mask_addr.o: mask_addr.h mask_addr.o: msg.h mask_addr.o: sys_defs.h match_list.o: argv.h +match_list.o: check_arg.h match_list.o: dict.h match_list.o: match_list.c match_list.o: match_list.h @@ -1684,6 +1735,7 @@ match_list.o: vstream.h match_list.o: vstring.h match_list.o: vstring_vstream.h match_ops.o: argv.h +match_ops.o: check_arg.h match_ops.o: cidr_match.h match_ops.o: dict.h match_ops.o: match_list.h @@ -1698,6 +1750,7 @@ match_ops.o: sys_defs.h match_ops.o: vbuf.h match_ops.o: vstream.h match_ops.o: vstring.h +midna.o: check_arg.h midna.o: ctable.h midna.o: midna.c midna.o: midna.h @@ -1712,6 +1765,7 @@ msg.o: msg.c msg.o: msg.h msg.o: msg_output.h msg.o: sys_defs.h +msg_output.o: check_arg.h msg_output.o: msg_output.c msg_output.o: msg_output.h msg_output.o: msg_vstream.h @@ -1722,12 +1776,14 @@ msg_output.o: sys_defs.h msg_output.o: vbuf.h msg_output.o: vstream.h msg_output.o: vstring.h +msg_rate_delay.o: check_arg.h msg_rate_delay.o: events.h msg_rate_delay.o: msg.h msg_rate_delay.o: msg_rate_delay.c msg_rate_delay.o: sys_defs.h msg_rate_delay.o: vbuf.h msg_rate_delay.o: vstring.h +msg_syslog.o: check_arg.h msg_syslog.o: msg.h msg_syslog.o: msg_output.h msg_syslog.o: msg_syslog.c @@ -1737,6 +1793,7 @@ msg_syslog.o: stringops.h msg_syslog.o: sys_defs.h msg_syslog.o: vbuf.h msg_syslog.o: vstring.h +msg_vstream.o: check_arg.h msg_vstream.o: msg.h msg_vstream.o: msg_output.h msg_vstream.o: msg_vstream.c @@ -1748,6 +1805,7 @@ mvect.o: mvect.c mvect.o: mvect.h mvect.o: mymalloc.h mvect.o: sys_defs.h +myaddrinfo.o: check_arg.h myaddrinfo.o: inet_proto.h myaddrinfo.o: msg.h myaddrinfo.o: myaddrinfo.c @@ -1771,6 +1829,7 @@ mymalloc.o: sys_defs.h myrand.o: myrand.c myrand.o: myrand.h myrand.o: sys_defs.h +mystrtok.o: check_arg.h mystrtok.o: mystrtok.c mystrtok.o: stringops.h mystrtok.o: sys_defs.h @@ -1779,6 +1838,7 @@ mystrtok.o: vstring.h name_code.o: name_code.c name_code.o: name_code.h name_code.o: sys_defs.h +name_mask.o: check_arg.h name_mask.o: msg.h name_mask.o: mymalloc.h name_mask.o: name_mask.c @@ -1793,6 +1853,7 @@ nbbio.o: mymalloc.h nbbio.o: nbbio.c nbbio.o: nbbio.h nbbio.o: sys_defs.h +netstring.o: check_arg.h netstring.o: compat_va_copy.h netstring.o: msg.h netstring.o: netstring.c @@ -1801,6 +1862,7 @@ netstring.o: sys_defs.h netstring.o: vbuf.h netstring.o: vstream.h netstring.o: vstring.h +neuter.o: check_arg.h neuter.o: neuter.c neuter.o: stringops.h neuter.o: sys_defs.h @@ -1823,6 +1885,7 @@ open_as.o: sys_defs.h open_limit.o: iostuff.h open_limit.o: open_limit.c open_limit.o: sys_defs.h +open_lock.o: check_arg.h open_lock.o: msg.h open_lock.o: myflock.h open_lock.o: open_lock.c @@ -1856,6 +1919,7 @@ pass_trigger.o: trigger.h peekfd.o: iostuff.h peekfd.o: peekfd.c peekfd.o: sys_defs.h +percentm.o: check_arg.h percentm.o: percentm.c percentm.o: percentm.h percentm.o: sys_defs.h @@ -1868,6 +1932,7 @@ poll_fd.o: sys_defs.h posix_signals.o: posix_signals.c posix_signals.o: posix_signals.h posix_signals.o: sys_defs.h +printable.o: check_arg.h printable.o: printable.c printable.o: stringops.h printable.o: sys_defs.h @@ -1878,6 +1943,7 @@ rand_sleep.o: msg.h rand_sleep.o: myrand.h rand_sleep.o: rand_sleep.c rand_sleep.o: sys_defs.h +readlline.o: check_arg.h readlline.o: msg.h readlline.o: readlline.c readlline.o: readlline.h @@ -1902,6 +1968,7 @@ ring.o: ring.h safe_getenv.o: safe.h safe_getenv.o: safe_getenv.c safe_getenv.o: sys_defs.h +safe_open.o: check_arg.h safe_open.o: msg.h safe_open.o: safe_open.c safe_open.o: safe_open.h @@ -1915,6 +1982,7 @@ sane_accept.o: msg.h sane_accept.o: sane_accept.c sane_accept.o: sane_accept.h sane_accept.o: sys_defs.h +sane_basename.o: check_arg.h sane_basename.o: sane_basename.c sane_basename.o: stringops.h sane_basename.o: sys_defs.h @@ -1942,6 +2010,7 @@ sane_time.o: msg.h sane_time.o: sane_time.c sane_time.o: sane_time.h sane_time.o: sys_defs.h +scan_dir.o: check_arg.h scan_dir.o: msg.h scan_dir.o: mymalloc.h scan_dir.o: scan_dir.c @@ -1950,6 +2019,7 @@ scan_dir.o: stringops.h scan_dir.o: sys_defs.h scan_dir.o: vbuf.h scan_dir.o: vstring.h +select_bug.o: check_arg.h select_bug.o: msg.h select_bug.o: msg_vstream.h select_bug.o: select_bug.c @@ -1969,11 +2039,13 @@ sigdelay.o: posix_signals.h sigdelay.o: sigdelay.c sigdelay.o: sigdelay.h sigdelay.o: sys_defs.h +skipblanks.o: check_arg.h skipblanks.o: skipblanks.c skipblanks.o: stringops.h skipblanks.o: sys_defs.h skipblanks.o: vbuf.h skipblanks.o: vstring.h +slmdb.o: check_arg.h slmdb.o: slmdb.c slmdb.o: slmdb.h sock_addr.o: msg.h @@ -1981,6 +2053,7 @@ sock_addr.o: sock_addr.c sock_addr.o: sock_addr.h sock_addr.o: sys_defs.h spawn_command.o: argv.h +spawn_command.o: check_arg.h spawn_command.o: clean_env.h spawn_command.o: exec_command.h spawn_command.o: msg.h @@ -1992,6 +2065,7 @@ spawn_command.o: timed_wait.h split_at.o: split_at.c split_at.o: split_at.h split_at.o: sys_defs.h +split_nameval.o: check_arg.h split_nameval.o: msg.h split_nameval.o: split_nameval.c split_nameval.o: stringops.h @@ -2025,6 +2099,7 @@ stream_send_fd.o: iostuff.h stream_send_fd.o: msg.h stream_send_fd.o: stream_send_fd.c stream_send_fd.o: sys_defs.h +stream_test.o: check_arg.h stream_test.o: connect.h stream_test.o: htable.h stream_test.o: iostuff.h @@ -2066,16 +2141,19 @@ timed_write.o: iostuff.h timed_write.o: msg.h timed_write.o: sys_defs.h timed_write.o: timed_write.c +translit.o: check_arg.h translit.o: stringops.h translit.o: sys_defs.h translit.o: translit.c translit.o: vbuf.h translit.o: vstring.h +trimblanks.o: check_arg.h trimblanks.o: stringops.h trimblanks.o: sys_defs.h trimblanks.o: trimblanks.c trimblanks.o: vbuf.h trimblanks.o: vstring.h +unescape.o: check_arg.h unescape.o: stringops.h unescape.o: sys_defs.h unescape.o: unescape.c @@ -2095,6 +2173,7 @@ unix_listen.o: msg.h unix_listen.o: sane_accept.h unix_listen.o: sys_defs.h unix_listen.o: unix_listen.c +unix_pass_fd_fix.o: check_arg.h unix_pass_fd_fix.o: iostuff.h unix_pass_fd_fix.o: name_mask.h unix_pass_fd_fix.o: sys_defs.h @@ -2120,6 +2199,7 @@ unix_trigger.o: unix_trigger.c unsafe.o: safe.h unsafe.o: sys_defs.h unsafe.o: unsafe.c +uppercase.o: check_arg.h uppercase.o: stringops.h uppercase.o: sys_defs.h uppercase.o: uppercase.c @@ -2128,6 +2208,7 @@ uppercase.o: vstring.h username.o: sys_defs.h username.o: username.c username.o: username.h +valid_hostname.o: check_arg.h valid_hostname.o: msg.h valid_hostname.o: mymalloc.h valid_hostname.o: stringops.h @@ -2136,6 +2217,7 @@ valid_hostname.o: valid_hostname.c valid_hostname.o: valid_hostname.h valid_hostname.o: vbuf.h valid_hostname.o: vstring.h +valid_utf8_hostname.o: check_arg.h valid_utf8_hostname.o: midna.h valid_utf8_hostname.o: msg.h valid_utf8_hostname.o: mymalloc.h @@ -2146,6 +2228,7 @@ valid_utf8_hostname.o: valid_utf8_hostname.c valid_utf8_hostname.o: valid_utf8_hostname.h valid_utf8_hostname.o: vbuf.h valid_utf8_hostname.o: vstring.h +valid_utf8_string.o: check_arg.h valid_utf8_string.o: stringops.h valid_utf8_string.o: sys_defs.h valid_utf8_string.o: valid_utf8_string.c @@ -2154,12 +2237,14 @@ valid_utf8_string.o: vstring.h vbuf.o: sys_defs.h vbuf.o: vbuf.c vbuf.o: vbuf.h +vbuf_print.o: check_arg.h vbuf_print.o: msg.h vbuf_print.o: sys_defs.h vbuf_print.o: vbuf.h vbuf_print.o: vbuf_print.c vbuf_print.o: vbuf_print.h vbuf_print.o: vstring.h +vstream.o: check_arg.h vstream.o: iostuff.h vstream.o: msg.h vstream.o: mymalloc.h @@ -2170,6 +2255,7 @@ vstream.o: vstream.c vstream.o: vstream.h vstream.o: vstring.h vstream_popen.o: argv.h +vstream_popen.o: check_arg.h vstream_popen.o: clean_env.h vstream_popen.o: exec_command.h vstream_popen.o: iostuff.h @@ -2179,11 +2265,13 @@ vstream_popen.o: sys_defs.h vstream_popen.o: vbuf.h vstream_popen.o: vstream.h vstream_popen.o: vstream_popen.c +vstream_tweak.o: check_arg.h vstream_tweak.o: msg.h vstream_tweak.o: sys_defs.h vstream_tweak.o: vbuf.h vstream_tweak.o: vstream.h vstream_tweak.o: vstream_tweak.c +vstring.o: check_arg.h vstring.o: msg.h vstring.o: mymalloc.h vstring.o: sys_defs.h @@ -2191,6 +2279,7 @@ vstring.o: vbuf.h vstring.o: vbuf_print.h vstring.o: vstring.c vstring.o: vstring.h +vstring_vstream.o: check_arg.h vstring_vstream.o: msg.h vstring_vstream.o: sys_defs.h vstring_vstream.o: vbuf.h diff --git a/postfix/src/util/attr.c b/postfix/src/util/attr.c deleted file mode 100644 index e382184f9..000000000 --- a/postfix/src/util/attr.c +++ /dev/null @@ -1,49 +0,0 @@ -/*++ -/* NAME -/* attr 3 -/* SUMMARY -/* attribute list manipulations -/* SYNOPSIS -/* #include -/* DESCRIPTION -/* This module allocates storage for dummy variables that are -/* never referenced. They are used in expressions that are -/* discarded by the compiler. Only defective compiler would -/* generate code that references these variables. -/* LICENSE -/* .ad -/* .fi -/* The Secure Mailer license must be distributed with this software. -/* AUTHOR(S) -/* Wietse Venema -/* IBM T.J. Watson Research -/* P.O. Box 704 -/* Yorktown Heights, NY 10598, USA -/*--*/ - - /* - * System library. - */ -#include - - /* - * Utility library. - */ -#include - - /* - * These should never be referenced, but they are here just in case. - */ -int CHECK_VAL_DUMMY(int); -long CHECK_VAL_DUMMY(long); -ssize_t CHECK_VAL_DUMMY(ssize_t); -int *CHECK_PTR_DUMMY(int); -long *CHECK_PTR_DUMMY(long); -void *CHECK_PTR_DUMMY(void); -const char *CHECK_CONST_PTR_DUMMY(char); -const void *CHECK_CONST_PTR_DUMMY(void); -VSTRING *CHECK_PTR_DUMMY(VSTRING); -HTABLE *CHECK_PTR_DUMMY(HTABLE); -const HTABLE *CHECK_CONST_PTR_DUMMY(HTABLE); -NVTABLE *CHECK_PTR_DUMMY(NVTABLE); -const NVTABLE *CHECK_CONST_PTR_DUMMY(NVTABLE); diff --git a/postfix/src/util/attr.h b/postfix/src/util/attr.h index e398f2389..b5d92e4f5 100644 --- a/postfix/src/util/attr.h +++ b/postfix/src/util/attr.h @@ -40,38 +40,35 @@ #define ATTR_HASH_LIMIT 1024 /* Size of hash table */ -#define SEND_ATTR_INT(name, val) ATTR_TYPE_INT, CHECK_CONST_PTR(char, name), CHECK_VAL(int, val) -#define SEND_ATTR_STR(name, val) ATTR_TYPE_STR, CHECK_CONST_PTR(char, name), CHECK_CONST_PTR(char, val) -#define SEND_ATTR_HASH(val) ATTR_TYPE_HASH, CHECK_CONST_PTR(HTABLE, val) -#define SEND_ATTR_NV(val) ATTR_TYPE_NV, CHECK_CONST_PTR(NVTABLE, val) -#define SEND_ATTR_LONG(name, val) ATTR_TYPE_LONG, CHECK_CONST_PTR(char, name), CHECK_VAL(long, val) -#define SEND_ATTR_DATA(name, len, val) ATTR_TYPE_DATA, CHECK_CONST_PTR(char, name), CHECK_VAL(ssize_t, len), CHECK_CONST_PTR(void, val) -#define SEND_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, (func), CHECK_CONST_PTR(void, val) - -#define RECV_ATTR_INT(name, val) ATTR_TYPE_INT, CHECK_CONST_PTR(char, name), CHECK_PTR(int, val) -#define RECV_ATTR_STR(name, val) ATTR_TYPE_STR, CHECK_CONST_PTR(char, name), CHECK_PTR(VSTRING, val) -#define RECV_ATTR_HASH(val) ATTR_TYPE_HASH, CHECK_PTR(HTABLE, val) -#define RECV_ATTR_NV(val) ATTR_TYPE_NV, CHECK_PTR(NVTABLE, val) -#define RECV_ATTR_LONG(name, val) ATTR_TYPE_LONG, CHECK_CONST_PTR(char, name), CHECK_PTR(long, val) -#define RECV_ATTR_DATA(name, val) ATTR_TYPE_DATA, CHECK_CONST_PTR(char, name), CHECK_PTR(VSTRING, val) -#define RECV_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, (func), CHECK_PTR(void, val) - -extern int CHECK_VAL_DUMMY(int); -extern long CHECK_VAL_DUMMY(long); -extern ssize_t CHECK_VAL_DUMMY(ssize_t); -extern int *CHECK_PTR_DUMMY(int); -extern long *CHECK_PTR_DUMMY(long); -extern void *CHECK_PTR_DUMMY(void); -extern const char *CHECK_CONST_PTR_DUMMY(char); -extern const void *CHECK_CONST_PTR_DUMMY(void); - -extern VSTRING *CHECK_PTR_DUMMY(VSTRING); - -extern HTABLE *CHECK_PTR_DUMMY(HTABLE); -extern const HTABLE *CHECK_CONST_PTR_DUMMY(HTABLE); - -extern NVTABLE *CHECK_PTR_DUMMY(NVTABLE); -extern const NVTABLE *CHECK_CONST_PTR_DUMMY(NVTABLE); +#define SEND_ATTR_INT(name, val) ATTR_TYPE_INT, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_VAL(ATTR_TAG, int, (val)) +#define SEND_ATTR_STR(name, val) ATTR_TYPE_STR, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_CPTR(ATTR_TAG, char, (val)) +#define SEND_ATTR_HASH(val) ATTR_TYPE_HASH, CHECK_CPTR(ATTR_TAG, HTABLE, (val)) +#define SEND_ATTR_NV(val) ATTR_TYPE_NV, CHECK_CPTR(ATTR_TAG, NVTABLE, (val)) +#define SEND_ATTR_LONG(name, val) ATTR_TYPE_LONG, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_VAL(ATTR_TAG, long, (val)) +#define SEND_ATTR_DATA(name, len, val) ATTR_TYPE_DATA, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_VAL(ATTR_TAG, ssize_t, (len)), CHECK_CPTR(ATTR_TAG, void, (val)) +#define SEND_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, (func), CHECK_CPTR(ATTR_TAG, void, (val)) + +#define RECV_ATTR_INT(name, val) ATTR_TYPE_INT, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_PTR(ATTR_TAG, int, (val)) +#define RECV_ATTR_STR(name, val) ATTR_TYPE_STR, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_PTR(ATTR_TAG, VSTRING, (val)) +#define RECV_ATTR_HASH(val) ATTR_TYPE_HASH, CHECK_PTR(ATTR_TAG, HTABLE, (val)) +#define RECV_ATTR_NV(val) ATTR_TYPE_NV, CHECK_PTR(ATTR_TAG, NVTABLE, (val)) +#define RECV_ATTR_LONG(name, val) ATTR_TYPE_LONG, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_PTR(ATTR_TAG, long, (val)) +#define RECV_ATTR_DATA(name, val) ATTR_TYPE_DATA, CHECK_CPTR(ATTR_TAG, char, (name)), CHECK_PTR(ATTR_TAG, VSTRING, (val)) +#define RECV_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, (func), CHECK_PTR(ATTR_TAG, void, (val)) + +CHECK_VAL_HELPER_DCL(ATTR_TAG, ssize_t); +CHECK_VAL_HELPER_DCL(ATTR_TAG, long); +CHECK_VAL_HELPER_DCL(ATTR_TAG, int); +CHECK_PTR_HELPER_DCL(ATTR_TAG, void); +CHECK_PTR_HELPER_DCL(ATTR_TAG, long); +CHECK_PTR_HELPER_DCL(ATTR_TAG, int); +CHECK_PTR_HELPER_DCL(ATTR_TAG, VSTRING); +CHECK_PTR_HELPER_DCL(ATTR_TAG, NVTABLE); +CHECK_PTR_HELPER_DCL(ATTR_TAG, HTABLE); +CHECK_CPTR_HELPER_DCL(ATTR_TAG, void); +CHECK_CPTR_HELPER_DCL(ATTR_TAG, char); +CHECK_CPTR_HELPER_DCL(ATTR_TAG, NVTABLE); +CHECK_CPTR_HELPER_DCL(ATTR_TAG, HTABLE); /* * Flags that control processing. See attr_scan(3) for documentation. diff --git a/postfix/src/util/attr_clnt.h b/postfix/src/util/attr_clnt.h index 9f038e289..c5e5ac0ae 100644 --- a/postfix/src/util/attr_clnt.h +++ b/postfix/src/util/attr_clnt.h @@ -31,7 +31,7 @@ typedef int (*ATTR_CLNT_SCAN_FN) (VSTREAM *, int, va_list); extern ATTR_CLNT *attr_clnt_create(const char *, int, int, int); extern int attr_clnt_request(ATTR_CLNT *, int,...); extern void attr_clnt_free(ATTR_CLNT *); -extern void attr_clnt_control(ATTR_CLNT *, int, ...); +extern void attr_clnt_control(ATTR_CLNT *, int,...); #define ATTR_CLNT_CTL_END 0 #define ATTR_CLNT_CTL_PROTO 1 /* print/scan functions */ diff --git a/postfix/src/util/attr_print0.c b/postfix/src/util/attr_print0.c index 650fd6d7f..44238f5c7 100644 --- a/postfix/src/util/attr_print0.c +++ b/postfix/src/util/attr_print0.c @@ -41,25 +41,24 @@ /* By default, attr_print0() automatically appends an attribute list /* terminator when it has sent the last requested attribute. /* .RE -/* .IP type -/* The type determines the arguments that follow. +/* .IP List of attributes followed by terminator: /* .RS -/* .IP "ATTR_TYPE_INT (char *, int)" -/* This argument is followed by an attribute name and an integer. -/* .IP "ATTR_TYPE_LONG (char *, long)" -/* This argument is followed by an attribute name and a long integer. -/* .IP "ATTR_TYPE_STR (char *, char *)" -/* This argument is followed by an attribute name and a null-terminated +/* .IP "SEND_ATTR_INT(const char *name, int value)" +/* The arguments are an attribute name and an integer. +/* .IP "SEND_ATTR_LONG(const char *name, long value)" +/* The arguments are an attribute name and a long integer. +/* .IP "SEND_ATTR_STR(const char *name, const char *value)" +/* The arguments are an attribute name and a null-terminated /* string. -/* .IP "ATTR_TYPE_DATA (char *, ssize_t, char *)" -/* This argument is followed by an attribute name, an attribute value +/* .IP "SEND_ATTR_DATA(const char *name, ssize_t len, const void *value)" +/* The arguments are an attribute name, an attribute value /* length, and an attribute value pointer. -/* .IP "ATTR_TYPE_FUNC (ATTR_PRINT_SLAVE_FN, void *)" -/* This argument is followed by a function pointer and generic data +/* .IP "SEND_ATTR_FUNC(ATTR_PRINT_SLAVE_FN, const void *value)" +/* The arguments are a function pointer and generic data /* pointer. The caller-specified function returns whatever the /* specified attribute printing function returns. -/* .IP "ATTR_TYPE_HASH (HTABLE *)" -/* .IP "ATTR_TYPE_NAMEVAL (NVTABLE *)" +/* .IP "SEND_ATTR_HASH(const HTABLE *table)" +/* .IP "SEND_ATTR_NAMEVAL(const NVTABLE *table)" /* The content of the table is sent as a sequence of string-valued /* attributes with names equal to the table lookup keys. /* .IP ATTR_TYPE_END diff --git a/postfix/src/util/attr_print64.c b/postfix/src/util/attr_print64.c index 00d945fa3..63871a048 100644 --- a/postfix/src/util/attr_print64.c +++ b/postfix/src/util/attr_print64.c @@ -41,25 +41,24 @@ /* By default, attr_print64() automatically appends an attribute list /* terminator when it has sent the last requested attribute. /* .RE -/* .IP type -/* The type determines the arguments that follow. +/* .IP List of attributes followed by terminator: /* .RS -/* .IP "ATTR_TYPE_INT (char *, int)" -/* This argument is followed by an attribute name and an integer. -/* .IP "ATTR_TYPE_LONG (char *, long)" -/* This argument is followed by an attribute name and a long integer. -/* .IP "ATTR_TYPE_STR (char *, char *)" -/* This argument is followed by an attribute name and a null-terminated +/* .IP "SEND_ATTR_INT(const char *name, int value)" +/* The arguments are an attribute name and an integer. +/* .IP "SEND_ATTR_LONG(const char *name, long value)" +/* The arguments are an attribute name and a long integer. +/* .IP "SEND_ATTR_STR(const char *name, const char *value)" +/* The arguments are an attribute name and a null-terminated /* string. -/* .IP "ATTR_TYPE_DATA (char *, ssize_t, char *)" -/* This argument is followed by an attribute name, an attribute value +/* .IP "SEND_ATTR_DATA(const char *name, ssize_t len, const void *value)" +/* The arguments are an attribute name, an attribute value /* length, and an attribute value pointer. -/* .IP "ATTR_TYPE_FUNC (ATTR_PRINT_SLAVE_FN, void *)" -/* This argument is followed by a function pointer and generic data +/* .IP "SEND_ATTR_FUNC(ATTR_PRINT_SLAVE_FN, const void *value)" +/* The arguments are a function pointer and generic data /* pointer. The caller-specified function returns whatever the /* specified attribute printing function returns. -/* .IP "ATTR_TYPE_HASH (HTABLE *)" -/* .IP "ATTR_TYPE_NAMEVAL (NVTABLE *)" +/* .IP "SEND_ATTR_HASH(const HTABLE *table)" +/* .IP "SEND_ATTR_NAMEVAL(const NVTABLE *table)" /* The content of the table is sent as a sequence of string-valued /* attributes with names equal to the table lookup keys. /* .IP ATTR_TYPE_END diff --git a/postfix/src/util/attr_print_plain.c b/postfix/src/util/attr_print_plain.c index 4edb100d9..f94afb9af 100644 --- a/postfix/src/util/attr_print_plain.c +++ b/postfix/src/util/attr_print_plain.c @@ -41,25 +41,24 @@ /* By default, attr_print_plain() automatically appends an attribute list /* terminator when it has sent the last requested attribute. /* .RE -/* .IP type -/* The type determines the arguments that follow. +/* .IP List of attributes followed by terminator: /* .RS -/* .IP "ATTR_TYPE_INT (char *, int)" -/* This argument is followed by an attribute name and an integer. -/* .IP "ATTR_TYPE_LONG (char *, long)" -/* This argument is followed by an attribute name and a long integer. -/* .IP "ATTR_TYPE_STR (char *, char *)" -/* This argument is followed by an attribute name and a null-terminated +/* .IP "SEND_ATTR_INT(const char *name, int value)" +/* The arguments are an attribute name and an integer. +/* .IP "SEND_ATTR_LONG(const char *name, long value)" +/* The arguments are an attribute name and a long integer. +/* .IP "SEND_ATTR_STR(const char *name, const char *value)" +/* The arguments are an attribute name and a null-terminated /* string. -/* .IP "ATTR_TYPE_DATA (char *, ssize_t, char *)" -/* This argument is followed by an attribute name, an attribute value -/* length, and a pointer to attribute value. -/* .IP "ATTR_TYPE_FUNC (ATTR_PRINT_SLAVE_FN, void *)" -/* This argument is followed by a function pointer and generic data +/* .IP "SEND_ATTR_DATA(const char *name, ssize_t len, const void *value)" +/* The arguments are an attribute name, an attribute value +/* length, and an attribute value pointer. +/* .IP "SEND_ATTR_FUNC(ATTR_PRINT_SLAVE_FN, const void *value)" +/* The arguments are a function pointer and generic data /* pointer. The caller-specified function returns whatever the /* specified attribute printing function returns. -/* .IP "ATTR_TYPE_HASH (HTABLE *)" -/* .IP "ATTR_TYPE_NAMEVAL (NVTABLE *)" +/* .IP "SEND_ATTR_HASH(const HTABLE *table)" +/* .IP "SEND_ATTR_NAMEVAL(const NVTABLE *table)" /* The content of the table is sent as a sequence of string-valued /* attributes with names equal to the table lookup keys. /* .IP ATTR_TYPE_END diff --git a/postfix/src/util/attr_scan0.c b/postfix/src/util/attr_scan0.c index e15ffefe6..41299aef8 100644 --- a/postfix/src/util/attr_scan0.c +++ b/postfix/src/util/attr_scan0.c @@ -82,23 +82,22 @@ /* .IP ATTR_FLAG_NONE /* For convenience, this value requests none of the above. /* .RE -/* .IP type -/* The type argument determines the arguments that follow. +/* .IP List of attributes followed by terminator: /* .RS -/* .IP "ATTR_TYPE_INT (char *, int *)" +/* .IP "RECV_ATTR_INT(const char *name, int *ptr)" /* This argument is followed by an attribute name and an integer pointer. -/* .IP "ATTR_TYPE_LONG (char *, long *)" +/* .IP "RECV_ATTR_LONG(const char *name, long *ptr)" /* This argument is followed by an attribute name and a long pointer. -/* .IP "ATTR_TYPE_STR (char *, VSTRING *)" +/* .IP "RECV_ATTR_STR(const char *name, VSTRING *vp)" /* This argument is followed by an attribute name and a VSTRING pointer. -/* .IP "ATTR_TYPE_DATA (char *, VSTRING *)" +/* .IP "RECV_ATTR_DATA(const char *name, VSTRING *vp)" /* This argument is followed by an attribute name and a VSTRING pointer. -/* .IP "ATTR_TYPE_FUNC (ATTR_SCAN_SLAVE_FN, void *)" +/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_SLAVE_FN, void *data)" /* This argument is followed by a function pointer and a generic data /* pointer. The caller-specified function returns < 0 in case of /* error. -/* .IP "ATTR_TYPE_HASH (HTABLE *)" -/* .IP "ATTR_TYPE_NAMEVAL (NVTABLE *)" +/* .IP "RECV_ATTR_HASH(HTABLE *table)" +/* .IP "RECV_ATTR_NAMEVAL(NVTABLE *table)" /* All further input attributes are processed as string attributes. /* No specific attribute sequence is enforced. /* All attributes up to the attribute list terminator are read, @@ -115,7 +114,7 @@ /* This argument terminates the requested attribute list. /* .RE /* BUGS -/* ATTR_TYPE_HASH (ATTR_TYPE_NAMEVAL) accepts attributes with arbitrary +/* RECV_ATTR_HASH (RECV_ATTR_NAMEVAL) accepts attributes with arbitrary /* names from possibly untrusted sources. /* This is unsafe, unless the resulting table is queried only with /* known to be good attribute names. diff --git a/postfix/src/util/attr_scan64.c b/postfix/src/util/attr_scan64.c index 52a3ba3fa..488c4c5f5 100644 --- a/postfix/src/util/attr_scan64.c +++ b/postfix/src/util/attr_scan64.c @@ -84,23 +84,22 @@ /* .IP ATTR_FLAG_NONE /* For convenience, this value requests none of the above. /* .RE -/* .IP type -/* The type argument determines the arguments that follow. +/* .IP List of attributes followed by terminator: /* .RS -/* .IP "ATTR_TYPE_INT (char *, int *)" +/* .IP "RECV_ATTR_INT(const char *name, int *ptr)" /* This argument is followed by an attribute name and an integer pointer. -/* .IP "ATTR_TYPE_LONG (char *, long *)" +/* .IP "RECV_ATTR_LONG(const char *name, long *ptr)" /* This argument is followed by an attribute name and a long pointer. -/* .IP "ATTR_TYPE_STR (char *, VSTRING *)" +/* .IP "RECV_ATTR_STR(const char *name, VSTRING *vp)" /* This argument is followed by an attribute name and a VSTRING pointer. -/* .IP "ATTR_TYPE_DATA (char *, VSTRING *)" +/* .IP "RECV_ATTR_DATA(const char *name, VSTRING *vp)" /* This argument is followed by an attribute name and a VSTRING pointer. -/* .IP "ATTR_TYPE_FUNC (ATTR_SCAN_SLAVE_FN, void *)" +/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_SLAVE_FN, void *data)" /* This argument is followed by a function pointer and a generic data /* pointer. The caller-specified function returns < 0 in case of /* error. -/* .IP "ATTR_TYPE_HASH (HTABLE *)" -/* .IP "ATTR_TYPE_NAMEVAL (NVTABLE *)" +/* .IP "RECV_ATTR_HASH(HTABLE *table)" +/* .IP "RECV_ATTR_NAMEVAL(NVTABLE *table)" /* All further input attributes are processed as string attributes. /* No specific attribute sequence is enforced. /* All attributes up to the attribute list terminator are read, @@ -117,7 +116,7 @@ /* This argument terminates the requested attribute list. /* .RE /* BUGS -/* ATTR_TYPE_HASH (ATTR_TYPE_NAMEVAL) accepts attributes with arbitrary +/* RECV_ATTR_HASH (RECV_ATTR_NAMEVAL) accepts attributes with arbitrary /* names from possibly untrusted sources. /* This is unsafe, unless the resulting table is queried only with /* known to be good attribute names. diff --git a/postfix/src/util/attr_scan_plain.c b/postfix/src/util/attr_scan_plain.c index 9fd5c7c99..4a99f5cdf 100644 --- a/postfix/src/util/attr_scan_plain.c +++ b/postfix/src/util/attr_scan_plain.c @@ -82,23 +82,22 @@ /* .IP ATTR_FLAG_NONE /* For convenience, this value requests none of the above. /* .RE -/* .IP type -/* The type argument determines the arguments that follow. +/* .IP List of attributes followed by terminator: /* .RS -/* .IP "ATTR_TYPE_INT (char *, int *)" +/* .IP "RECV_ATTR_INT(const char *name, int *ptr)" /* This argument is followed by an attribute name and an integer pointer. -/* .IP "ATTR_TYPE_LONG (char *, long *)" +/* .IP "RECV_ATTR_LONG(const char *name, long *ptr)" /* This argument is followed by an attribute name and a long pointer. -/* .IP "ATTR_TYPE_STR (char *, VSTRING *)" +/* .IP "RECV_ATTR_STR(const char *name, VSTRING *vp)" /* This argument is followed by an attribute name and a VSTRING pointer. -/* .IP "ATTR_TYPE_DATA (char *, VSTRING *)" +/* .IP "RECV_ATTR_DATA(const char *name, VSTRING *vp)" /* This argument is followed by an attribute name and a VSTRING pointer. -/* .IP "ATTR_TYPE_FUNC (ATTR_SCAN_SLAVE_FN, void *)" +/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_SLAVE_FN, void *data)" /* This argument is followed by a function pointer and a generic data /* pointer. The caller-specified function returns < 0 in case of /* error. -/* .IP "ATTR_TYPE_HASH (HTABLE *)" -/* .IP "ATTR_TYPE_NAMEVAL (NVTABLE *)" +/* .IP "RECV_ATTR_HASH(HTABLE *table)" +/* .IP "RECV_ATTR_NAMEVAL(NVTABLE *table)" /* All further input attributes are processed as string attributes. /* No specific attribute sequence is enforced. /* All attributes up to the attribute list terminator are read, @@ -115,7 +114,7 @@ /* This argument terminates the requested attribute list. /* .RE /* BUGS -/* ATTR_TYPE_HASH (ATTR_TYPE_NAMEVAL) accepts attributes with arbitrary +/* RECV_ATTR_HASH (RECV_ATTR_NAMEVAL) accepts attributes with arbitrary /* names from possibly untrusted sources. /* This is unsafe, unless the resulting table is queried only with /* known to be good attribute names. diff --git a/postfix/src/util/auto_clnt.c b/postfix/src/util/auto_clnt.c index 8b4a82e44..8ff34d750 100644 --- a/postfix/src/util/auto_clnt.c +++ b/postfix/src/util/auto_clnt.c @@ -191,9 +191,9 @@ static void auto_clnt_open(AUTO_CLNT *auto_clnt) msg_info("%s: connected to %s", myname, auto_clnt->endpoint); auto_clnt->vstream = vstream_fdopen(fd, O_RDWR); vstream_control(auto_clnt->vstream, - VSTREAM_CTL_PATH, auto_clnt->endpoint, - VSTREAM_CTL_TIMEOUT, auto_clnt->timeout, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(auto_clnt->endpoint), + VSTREAM_SCTL_TIMEOUT(auto_clnt->timeout), + VSTREAM_SCTL_END); } if (auto_clnt->vstream != 0) { diff --git a/postfix/src/util/check_arg.h b/postfix/src/util/check_arg.h index f8f4a7503..3a8389507 100644 --- a/postfix/src/util/check_arg.h +++ b/postfix/src/util/check_arg.h @@ -9,71 +9,139 @@ /* SYNOPSIS /* #include /* -/* extern int CHECK_VAL_DUMMY(int); -/* extern int CHECK_PTR_DUMMY(int); -/* extern int CHECK_CONST_PTR_DUMMY(int); +/* /* Example checking infrastructure for int, int *, const int *. */ +/* CHECK_VAL_HELPER_DCL(tag, int); +/* CHECK_PTR_HELPER_DCL(tag, int); +/* CHECK_CPTR_HELPER_DCL(tag, int); /* -/* int val; -/* int *p1; -/* const int *p2; +/* /* Example variables with type int, int *, const int *. */ +/* int int_val; +/* int *int_ptr; +/* const int *int_cptr; /* -/* func(CHECK_VAL(int, val), CHECK_PTR(int, p1), CHECK_CONST_PTR(int, p2)); +/* /* Example variadic function with type-flag arguments. */ +/* func(FLAG_INT_VAL, CHECK_VAL(tag, int, int_val), +/* FLAG_INT_PTR, CHECK_PTR(tag, int, int_ptr), +/* FLAG_INT_CPTR, CHECK_CPTR(tag, int, int_cptr) +/* FLAG_END); /* DESCRIPTION -/* This module implements wrappers for unprototyped function -/* arguments, to enable the same type checking, type narrowing, -/* and type widening as for prototyped function arguments. The +/* This module implements wrappers for unprototyped function +/* arguments, to enable the same type checking, type narrowing, +/* and type widening as for prototyped function arguments. The /* wrappers may also be useful in other contexts. /* -/* Each non-pointer argument type is handled by a corresponding -/* CHECK_VAL(type, value) wrapper (type = int, long, etc.), and -/* each pointer argument type is handled by a corresponding -/* CHECK_CONST_PTR(type, ptr) or CHECK_PTR(type, ptr) wrapper. +/* Typically, these wrappers are hidden away in a per-module +/* header file that is read by the consumers of that module. +/* To protect consumers against name collisions between wrappers +/* in different header files, wrappers should be called with +/* a distinct per-module tag value. The tag syntax is that +/* of a C identifier. /* -/* A good compiler will report the following problems: +/* Use CHECK_VAL(tag, type, argument) for arguments with a +/* basic type: int, long, etc., and types defined with "typedef" +/* where indirection is built into the type itself (for example, +/* the result of "typedef int *foo" or function pointer +/* typedefs). +/* +/* Use CHECK_PTR(tag, type, argument) for non-const pointer +/* arguments, CHECK_CPTR(tag, type, argument) for const pointer +/* arguments, and CHECK_PPTR(tag, type, argument) for pointer- +/* to-pointer arguments. +/* +/* Use CHECK_*_HELPER_DCL(tag, type) to provide the +/* checking infrastructure for all CHECK_*(tag, type, ...) +/* instances with the same *, tag and type. Depending on +/* the compilation environment, the infrastructure consists +/* of an inline function definition or a dummy assignment +/* target declaration. +/* +/* The compiler should report the following problems: /* .IP \(bu -/* Const pointer argument where a non-const pointer is expected. +/* Const pointer argument where a non-const pointer is expected. /* .IP \(bu -/* Pointer argument where a non-pointer is expected. +/* Pointer argument where a non-pointer is expected and +/* vice-versa. /* .IP \(bu -/* Pointer/pointer type mismatches except void/non-void pointers. -/* The latter is why all check_arg_xxx_ptr() macros cast their -/* result to the desired type. +/* Pointer/pointer type mismatches except void/non-void pointers. +/* Just like function prototypes, all CHECK_*PTR() wrappers +/* cast their result to the desired type. /* .IP \(bu -/* Non-constant non-pointer argument where a pointer is expected. +/* Non-constant non-pointer argument where a pointer is expected. /*. PP -/* Just like function prototypes, the CHECK_(CONST_)PTR() wrappers -/* handle "bare" numeric constants by casting their argument to -/* the desired pointer type. +/* Just like function prototypes, the CHECK_*PTR() wrappers +/* handle "bare" numerical constants by casting their argument +/* to the desired pointer type. /* -/* Just like function prototypes, the CHECK_VAL() wrapper cannot -/* force the caller to specify a particular non-pointer type and -/* casts its argument to the desired type. +/* Just like function prototypes, the CHECK_VAL() wrapper +/* cannot force the caller to specify a particular non-pointer +/* type and casts its argument value to the desired type which +/* may wider or narrower than the argument value. /* IMPLEMENTATION -/* .ad -/* .fi -/* This implementation uses unreachable assignments to dummy -/* variables. Even a basic optimizer will eliminate these -/* assignments along with any reference to the dummy assignment -/* targets. It should be possible to declare these variables as -/* extern only, without any actual definition for storage -/* allocation. -/* .na -/* .nf /* - * Templates for parameter value checks. + * Choose between an implementation based on inline functions (standardized + * with C99) or conditional assignment (portable to older compilers, with + * some caveats as discussed below). */ -#define CHECK_VAL(type, v) ((type) (1 ? (v) : (CHECK_VAL_DUMMY(type) = (v)))) -#define CHECK_PTR(type, p) ((type *) (1 ? (p) : (CHECK_PTR_DUMMY(type) = (p)))) -#define CHECK_CONST_PTR(type, p) \ - ((const type *) (1 ? (p) : (CHECK_CONST_PTR_DUMMY(type) = (p)))) +#ifndef NO_INLINE /* - * Templates for dummy assignment targets. These will never be referenced, + * Parameter checks expand into inline helper function calls. + */ +#define CHECK_VAL(tag, type, v) check_val_##tag##type(v) +#define CHECK_PTR(tag, type, v) check_ptr_##tag##type(v) +#define CHECK_CPTR(tag, type, v) check_cptr_##tag##type(v) +#define CHECK_PPTR(tag, type, v) check_pptr_##tag##type(v) + + /* + * Macros to instantiate the inline helper functions. + */ +#define CHECK_VAL_HELPER_DCL(tag, type) \ + static inline type check_val_##tag##type(type v) { return v; } +#define CHECK_PTR_HELPER_DCL(tag, type) \ + static inline type *check_ptr_##tag##type(type *v) { return v; } +#define CHECK_CPTR_HELPER_DCL(tag, type) \ + static inline const type *check_cptr_##tag##type(const type *v) \ + { return v; } +#define CHECK_PPTR_HELPER_DCL(tag, type) \ + static inline type **check_pptr_##tag##type(type **v) { return v; } + +#else /* NO_INLINE */ + + /* + * Parameter checks expand into unreachable conditional assignments. + * Inspired by OpenSSL's verified pointer check, our implementation also + * detects const/non-const pointer conflicts, and it also supports + * non-pointer expressions. + */ +#define CHECK_VAL(tag, type, v) ((type) (1 ? (v) : (CHECK_VAL_DUMMY(type) = (v)))) +#define CHECK_PTR(tag, type, v) ((type *) (1 ? (v) : (CHECK_PTR_DUMMY(type) = (v)))) +#define CHECK_CPTR(tag, type, v) \ + ((const type *) (1 ? (v) : (CHECK_CPTR_DUMMY(type) = (v)))) +#define CHECK_PPTR(tag, type, v) ((type **) (1 ? (v) : (CHECK_PPTR_DUMMY(type) = (v)))) + + /* + * These macros instantiate assignment target declarations. Since the + * assignment is made in unreachable code, the compiler "should" not emit + * any references to those assignment targets. We use the "extern" class so + * that gcc will not complain about unused variables. Using "extern" breaks + * when a compiler does emit references unreachable assignment targets. + * Hopefully, those cases will be rare. + */ +#define CHECK_VAL_HELPER_DCL(tag, type) extern type CHECK_VAL_DUMMY(type) +#define CHECK_PTR_HELPER_DCL(tag, type) extern type *CHECK_PTR_DUMMY(type) +#define CHECK_CPTR_HELPER_DCL(tag, type) extern const type *CHECK_CPTR_DUMMY(type) +#define CHECK_PPTR_HELPER_DCL(tag, type) extern type **CHECK_PPTR_DUMMY(type) + + /* + * The actual dummy assignment target names. */ #define CHECK_VAL_DUMMY(type) check_val_dummy_##type #define CHECK_PTR_DUMMY(type) check_ptr_dummy_##type -#define CHECK_CONST_PTR_DUMMY(type) check_const_ptr_dummy_##type +#define CHECK_CPTR_DUMMY(type) check_cptr_dummy_##type +#define CHECK_PPTR_DUMMY(type) check_pptr_dummy_##type + +#endif /* NO_INLINE */ /* LICENSE /* .ad diff --git a/postfix/src/util/ctable.c b/postfix/src/util/ctable.c index 7a25cb4aa..6a17aee9b 100644 --- a/postfix/src/util/ctable.c +++ b/postfix/src/util/ctable.c @@ -296,7 +296,7 @@ int main(int unused_argc, char **argv) data_buf = vstring_alloc(100); cache = ctable_create(1, ask, drop, (void *) data_buf); msg_verbose = 1; - vstream_control(VSTREAM_IN, VSTREAM_CTL_EXCEPT, VSTREAM_CTL_END); + vstream_control(VSTREAM_IN, VSTREAM_SCTL_EXCEPT, VSTREAM_SCTL_END); if (vstream_setjmp(VSTREAM_IN) == 0) { for (;;) { diff --git a/postfix/src/util/dict_cache.c b/postfix/src/util/dict_cache.c index c9e85f9ae..3b39ec04d 100644 --- a/postfix/src/util/dict_cache.c +++ b/postfix/src/util/dict_cache.c @@ -95,27 +95,27 @@ /* /* dict_cache_control() provides control over the built-in /* cache cleanup feature and logging. The arguments are a list -/* of (name, value) pairs, terminated with DICT_CACHE_CTL_END. -/* The following lists the names and the types of the corresponding -/* value arguments. -/* .IP "DICT_CACHE_FLAGS (int flags)" +/* of macros with zero or more arguments, terminated with +/* DICT_CACHE_SCTL_END which has none. The following lists +/* the macros and corresponding argument types. +/* .IP "DICT_CACHE_SCTL_FLAGS(int flags)" /* The arguments to this command are the bit-wise OR of zero /* or more of the following: /* .RS -/* .IP DICT_CACHE_FLAG_VERBOSE +/* .IP DICT_CACHE_SCTL_FLAG_VERBOSE /* Enable verbose logging of cache activity. -/* .IP DICT_CACHE_FLAG_EXP_SUMMARY +/* .IP DICT_CACHE_SCTL_FLAG_EXP_SUMMARY /* Log cache statistics after each cache cleanup run. /* .RE -/* .IP "DICT_CACHE_CTL_INTERVAL (int interval)" +/* .IP "DICT_CACHE_SCTL_INTERVAL(int interval)" /* The interval between cache cleanup runs. Specify a null /* validator or interval to stop cache cleanup. -/* .IP "DICT_CACHE_CTL_VALIDATOR (DICT_CACHE_VALIDATOR_FN validator)" +/* .IP "DICT_CACHE_SCTL_VALIDATOR(DICT_CACHE_VALIDATOR_FN validator)" /* An application call-back routine that returns non-zero when /* a cache entry should be kept. The call-back function should /* not make changes to the cache. Specify a null validator or /* interval to stop cache cleanup. -/* .IP "DICT_CACHE_CTL_CONTEXT (void *context)" +/* .IP "DICT_CACHE_SCTL_CONTEXT(void *context)" /* Application context that is passed to the validator function. /* .RE /* .PP diff --git a/postfix/src/util/dict_cache.h b/postfix/src/util/dict_cache.h index e86cfc22d..392284dec 100644 --- a/postfix/src/util/dict_cache.h +++ b/postfix/src/util/dict_cache.h @@ -15,6 +15,7 @@ * Utility library. */ #include +#include /* * External interface. @@ -34,12 +35,24 @@ extern const char *dict_cache_name(DICT_CACHE *); #define DICT_CACHE_FLAG_VERBOSE (1<<0) /* verbose operation */ #define DICT_CACHE_FLAG_STATISTICS (1<<1) /* log cache statistics */ +/* Legacy API: type-unchecked argument, internal use. */ #define DICT_CACHE_CTL_END 0 /* list terminator */ #define DICT_CACHE_CTL_FLAGS 1 /* see above */ #define DICT_CACHE_CTL_INTERVAL 2 /* cleanup interval */ #define DICT_CACHE_CTL_VALIDATOR 3 /* call-back validator */ #define DICT_CACHE_CTL_CONTEXT 4 /* call-back context */ +/* Safer API: type-checked arguments, external use. */ +#define DICT_CACHE_SCTL_END DICT_CACHE_CTL_END +#define DICT_CACHE_SCTL_FLAGS(v) DICT_CACHE_CTL_FLAGS, CHECK_VAL(DICT_CACHE, int, (v)) +#define DICT_CACHE_SCTL_INTERVAL(v) DICT_CACHE_CTL_INTERVAL, CHECK_VAL(DICT_CACHE, int, (v)) +#define DICT_CACHE_SCTL_VALIDATOR(v) DICT_CACHE_CTL_VALIDATOR, CHECK_VAL(DICT_CACHE, DICT_CACHE_VALIDATOR_FN, (v)) +#define DICT_CACHE_SCTL_CONTEXT(v) DICT_CACHE_CTL_CONTEXT, CHECK_PTR(DICT_CACHE, void, (v)) + +CHECK_VAL_HELPER_DCL(DICT_CACHE, int); +CHECK_VAL_HELPER_DCL(DICT_CACHE, DICT_CACHE_VALIDATOR_FN); +CHECK_PTR_HELPER_DCL(DICT_CACHE, void); + /* LICENSE /* .ad /* .fi diff --git a/postfix/src/util/dict_lmdb.c b/postfix/src/util/dict_lmdb.c index 2df583088..bc3b03cff 100644 --- a/postfix/src/util/dict_lmdb.c +++ b/postfix/src/util/dict_lmdb.c @@ -680,14 +680,14 @@ DICT *dict_lmdb_open(const char *path, int open_flags, int dict_flags) * memory corruption problem. */ if (slmdb_control(&dict_lmdb->slmdb, - SLMDB_CTL_API_RETRY_LIMIT, DICT_LMDB_API_RETRY_LIMIT, - SLMDB_CTL_BULK_RETRY_LIMIT, DICT_LMDB_BULK_RETRY_LIMIT, - SLMDB_CTL_LONGJMP_FN, dict_lmdb_longjmp, - SLMDB_CTL_NOTIFY_FN, msg_verbose ? - dict_lmdb_notify : (SLMDB_NOTIFY_FN) 0, - SLMDB_CTL_ASSERT_FN, dict_lmdb_assert, - SLMDB_CTL_CB_CONTEXT, (void *) dict_lmdb, - SLMDB_CTL_END) != 0) + SLMDB_SCTL_API_RETRY_LIMIT(DICT_LMDB_API_RETRY_LIMIT), + SLMDB_SCTL_BULK_RETRY_LIMIT(DICT_LMDB_BULK_RETRY_LIMIT), + SLMDB_SCTL_LONGJMP_FN(dict_lmdb_longjmp), + SLMDB_SCTL_NOTIFY_FN(msg_verbose ? + dict_lmdb_notify : (SLMDB_NOTIFY_FN) 0), + SLMDB_SCTL_ASSERT_FN(dict_lmdb_assert), + SLMDB_SCTL_CB_CONTEXT((void *) dict_lmdb), + SLMDB_SCTL_END) != 0) msg_panic("dict_lmdb_open: slmdb_control: %m"); if (msg_verbose) diff --git a/postfix/src/util/dict_tcp.c b/postfix/src/util/dict_tcp.c index a20956538..7b4aa8df1 100644 --- a/postfix/src/util/dict_tcp.c +++ b/postfix/src/util/dict_tcp.c @@ -128,8 +128,8 @@ static int dict_tcp_connect(DICT_TCP *dict_tcp) } dict_tcp->fp = vstream_fdopen(fd, O_RDWR); vstream_control(dict_tcp->fp, - VSTREAM_CTL_TIMEOUT, DICT_TCP_TMOUT, - VSTREAM_CTL_END); + VSTREAM_SCTL_TIMEOUT(DICT_TCP_TMOUT), + VSTREAM_SCTL_END); /* * Allocate per-map I/O buffers on the fly. diff --git a/postfix/src/util/dict_test.c b/postfix/src/util/dict_test.c index 2fedcb60f..0fb0133bf 100644 --- a/postfix/src/util/dict_test.c +++ b/postfix/src/util/dict_test.c @@ -81,11 +81,11 @@ void dict_test(int argc, char **argv) dict_allow_surrogate = 1; dict = dict_open(dict_name, open_flags, dict_flags); dict_register(dict_name, dict); - vstream_printf("owner=%s (uid=%ld)\n", - dict->owner.status == DICT_OWNER_TRUSTED ? "trusted" : - dict->owner.status == DICT_OWNER_UNTRUSTED? "untrusted" : - dict->owner.status == DICT_OWNER_UNKNOWN? "unspecified" : - "error", (long) dict->owner.uid); + vstream_printf("owner=%s (uid=%ld)\n", + dict->owner.status == DICT_OWNER_TRUSTED ? "trusted" : + dict->owner.status == DICT_OWNER_UNTRUSTED ? "untrusted" : + dict->owner.status == DICT_OWNER_UNKNOWN ? "unspecified" : + "error", (long) dict->owner.uid); vstream_fflush(VSTREAM_OUT); while (vstring_fgets_nonl(inbuf, VSTREAM_IN)) { diff --git a/postfix/src/util/netstring.c b/postfix/src/util/netstring.c index 02b2b48d8..0e888d65f 100644 --- a/postfix/src/util/netstring.c +++ b/postfix/src/util/netstring.c @@ -177,9 +177,9 @@ void netstring_setup(VSTREAM *stream, int timeout) { vstream_control(stream, - VSTREAM_CTL_TIMEOUT, timeout, - VSTREAM_CTL_EXCEPT, - VSTREAM_CTL_END); + VSTREAM_SCTL_TIMEOUT(timeout), + VSTREAM_SCTL_EXCEPT, + VSTREAM_SCTL_END); } /* netstring_except - process netstring stream exception */ @@ -466,9 +466,9 @@ int main(int argc, char **argv) * Run the specified command as a child process with stdin and stdout * connected to us. */ - child_stream = vstream_popen(O_RDWR, VSTREAM_POPEN_ARGV, argv + 1, - VSTREAM_POPEN_END); - vstream_control(child_stream, VSTREAM_CTL_DOUBLE, VSTREAM_CTL_END); + child_stream = vstream_popen(O_RDWR, VSTREAM_SPOPEN_ARGV(argv + 1), + VSTREAM_SPOPEN_END); + vstream_control(child_stream, VSTREAM_SCTL_DOUBLE, VSTREAM_SCTL_END); netstring_setup(child_stream, 10); /* diff --git a/postfix/src/util/recv_pass_attr.c b/postfix/src/util/recv_pass_attr.c index 3e7a9d0c0..2eaaa5e5d 100644 --- a/postfix/src/util/recv_pass_attr.c +++ b/postfix/src/util/recv_pass_attr.c @@ -66,10 +66,10 @@ int recv_pass_attr(int fd, HTABLE **attr, int timeout, ssize_t bufsize) */ fp = vstream_fdopen(fd, O_RDWR); vstream_control(fp, - VSTREAM_CTL_BUFSIZE, bufsize, - VSTREAM_CTL_TIMEOUT, timeout, - VSTREAM_CTL_START_DEADLINE, - VSTREAM_CTL_END); + VSTREAM_SCTL_BUFSIZE(bufsize), + VSTREAM_SCTL_TIMEOUT(timeout), + VSTREAM_SCTL_START_DEADLINE, + VSTREAM_SCTL_END); (void) attr_scan(fp, ATTR_FLAG_NONE, ATTR_TYPE_HASH, *attr = htable_create(1), ATTR_TYPE_END); diff --git a/postfix/src/util/slmdb.c b/postfix/src/util/slmdb.c index 81ecf3e9d..539f15a01 100644 --- a/postfix/src/util/slmdb.c +++ b/postfix/src/util/slmdb.c @@ -146,32 +146,32 @@ /* LMDB cursor operation. /* .IP request /* The start of a list of (name, value) pairs, terminated with -/* SLMDB_CTL_END. The following text enumerates the symbolic -/* request names and the corresponding value types. +/* SLMDB_SCTL_END. The following text enumerates the symbolic +/* request names and the corresponding argument types. /* .RS -/* .IP "SLMDB_CTL_LONGJMP_FN (void (*)(void *, int)) +/* .IP "SLMDB_SCTL_LONGJMP_FN(void (*)(void *, int)) /* Call-back function pointer. The function is called to repeat /* a failed bulk-mode transaction from the start. The arguments /* are the application context and the setjmp() or sigsetjmp() /* result value. -/* .IP "SLMDB_CTL_NOTIFY_FN (void (*)(void *, int, ...))" +/* .IP "SLMDB_SCTL_NOTIFY_FN(void (*)(void *, int, ...))" /* Call-back function pointer. The function is called to report /* succesful error recovery. The arguments are the application /* context, the MDB error code, and additional arguments that /* depend on the error code. Details are given in the section /* "ERROR RECOVERY". -/* .IP "SLMDB_CTL_ASSERT_FN (void (*)(void *, const char *))" +/* .IP "SLMDB_SCTL_ASSERT_FN(void (*)(void *, const char *))" /* Call-back function pointer. The function is called to /* report an LMDB internal assertion failure. The arguments /* are the application context, and text that describes the /* problem. -/* .IP "SLMDB_CTL_CB_CONTEXT (void *)" +/* .IP "SLMDB_SCTL_CB_CONTEXT(void *)" /* Application context that is passed in call-back function /* calls. -/* .IP "SLMDB_CTL_API_RETRY_LIMIT (int)" +/* .IP "SLMDB_SCTL_API_RETRY_LIMIT(int)" /* How many times to recover from LMDB errors within the /* execution of a single slmdb(3) API call before giving up. -/* .IP "SLMDB_CTL_BULK_RETRY_LIMIT (int)" +/* .IP "SLMDB_SCTL_BULK_RETRY_LIMIT(int)" /* How many times to recover from a bulk-mode transaction /* before giving up. /* .RE diff --git a/postfix/src/util/slmdb.h b/postfix/src/util/slmdb.h index 4b41cae18..fd2a8dc0b 100644 --- a/postfix/src/util/slmdb.h +++ b/postfix/src/util/slmdb.h @@ -22,6 +22,11 @@ #include #endif + /* + * Utility library. + */ +#include + /* * External interface. */ @@ -72,19 +77,34 @@ extern int slmdb_close(SLMDB *); #define slmdb_fd(slmdb) ((slmdb)->db_fd) #define slmdb_curr_limit(slmdb) ((slmdb)->curr_limit) -#define SLMDB_CTL_END 0 -#define SLMDB_CTL_LONGJMP_FN 1 /* exception handling */ -#define SLMDB_CTL_NOTIFY_FN 2 /* debug logging function */ -#define SLMDB_CTL_CB_CONTEXT 3 /* call-back context */ -#define SLMDB_CTL_HARD_LIMIT 4 /* hard database size limit */ +/* Legacy API: type-unchecked arguments, internal use. */ +#define SLMDB_CTL_END 0 +#define SLMDB_CTL_LONGJMP_FN 1 /* exception handling */ +#define SLMDB_CTL_NOTIFY_FN 2 /* debug logging function */ +#define SLMDB_CTL_CB_CONTEXT 3 /* call-back context */ #define SLMDB_CTL_API_RETRY_LIMIT 5 /* per slmdb(3) API call */ #define SLMDB_CTL_BULK_RETRY_LIMIT 6 /* per bulk update */ -#define SLMDB_CTL_ASSERT_FN 7 /* report assertion failure */ +#define SLMDB_CTL_ASSERT_FN 7 /* report assertion failure */ + +/* Safer API: type-checked arguments, external use. */ +#define SLMDB_SCTL_END SLMDB_CTL_END +#define SLMDB_SCTL_LONGJMP_FN(v) SLMDB_CTL_LONGJMP_FN, CHECK_VAL(SLMDB, SLMDB_LONGJMP_FN, (v)) +#define SLMDB_SCTL_NOTIFY_FN(v) SLMDB_CTL_NOTIFY_FN, CHECK_VAL(SLMDB, SLMDB_NOTIFY_FN, (v)) +#define SLMDB_SCTL_CB_CONTEXT(v) SLMDB_CTL_CB_CONTEXT, CHECK_PTR(SLMDB, void, (v)) +#define SLMDB_SCTL_API_RETRY_LIMIT(v) SLMDB_CTL_API_RETRY_LIMIT, CHECK_VAL(SLMDB, int, (v)) +#define SLMDB_SCTL_BULK_RETRY_LIMIT(v) SLMDB_CTL_BULK_RETRY_LIMIT, CHECK_VAL(SLMDB, int, (v)) +#define SLMDB_SCTL_ASSERT_FN(v) SLMDB_CTL_ASSERT_FN, CHECK_VAL(SLMDB, SLMDB_ASSERT_FN, (v)) typedef void (*SLMDB_NOTIFY_FN) (void *, int,...); typedef void (*SLMDB_LONGJMP_FN) (void *, int); typedef void (*SLMDB_ASSERT_FN) (void *, const char *); +CHECK_VAL_HELPER_DCL(SLMDB, int); +CHECK_VAL_HELPER_DCL(SLMDB, SLMDB_NOTIFY_FN); +CHECK_VAL_HELPER_DCL(SLMDB, SLMDB_LONGJMP_FN); +CHECK_VAL_HELPER_DCL(SLMDB, SLMDB_ASSERT_FN); +CHECK_PTR_HELPER_DCL(SLMDB, void); + /* LICENSE /* .ad /* .fi diff --git a/postfix/src/util/spawn_command.c b/postfix/src/util/spawn_command.c index 2cfb3b272..650839fe4 100644 --- a/postfix/src/util/spawn_command.c +++ b/postfix/src/util/spawn_command.c @@ -14,46 +14,46 @@ /* /* Arguments: /* .IP key -/* Specifies what value will follow. spawn_command() takes a list -/* of (key, value) arguments, terminated by SPAWN_CMD_END. The -/* following is a listing of key codes together with the expected -/* value type. +/* spawn_command() takes a list of macros with arguments, +/* terminated by SPAWN_SCMD_END which has no arguments. The +/* following is a listing of macros and expected argument +/* types. /* .RS -/* .IP "SPAWN_CMD_COMMAND (char *)" +/* .IP "SPAWN_SCMD_COMMAND(const char *)" /* Specifies the command to execute as a string. The string is /* passed to the shell when it contains shell meta characters /* or when it appears to be a shell built-in command, otherwise /* the command is executed without invoking a shell. -/* One of SPAWN_CMD_COMMAND or SPAWN_CMD_ARGV must be specified. +/* One of SPAWN_SCMD_COMMAND or SPAWN_SCMD_ARGV must be specified. /* See also the SPAWN_CMD_SHELL attribute below. -/* .IP "SPAWN_CMD_ARGV (char **)" +/* .IP "SPAWN_SCMD_ARGV(char **)" /* The command is specified as an argument vector. This vector is /* passed without further inspection to the \fIexecvp\fR() routine. -/* One of SPAWN_CMD_COMMAND or SPAWN_CMD_ARGV must be specified. -/* .IP "SPAWN_CMD_ENV (char **)" +/* One of SPAWN_SCMD_COMMAND or SPAWN_SCMD_ARGV must be specified. +/* .IP "SPAWN_SCMD_ENV(char **)" /* Additional environment information, in the form of a null-terminated /* list of name, value, name, value, ... elements. By default only the /* command search path is initialized to _PATH_DEFPATH. -/* .IP "SPAWN_CMD_EXPORT (char **)" +/* .IP "SPAWN_SCMD_EXPORT(char **)" /* Null-terminated array of names of environment parameters that can /* be exported. By default, everything is exported. -/* .IP "SPAWN_CMD_STDIN (int)" -/* .IP "SPAWN_CMD_STDOUT (int)" -/* .IP "SPAWN_CMD_STDERR (int)" +/* .IP "SPAWN_SCMD_STDIN(int)" +/* .IP "SPAWN_SCMD_STDOUT(int)" +/* .IP "SPAWN_SCMD_STDERR(int)" /* Each of these specifies I/O redirection of one of the standard file /* descriptors for the command. -/* .IP "SPAWN_CMD_UID (uid_t)" +/* .IP "SPAWN_SCMD_UID(uid_t)" /* The user ID to execute the command as. The value -1 is reserved /* and cannot be specified. -/* .IP "SPAWN_CMD_GID (gid_t)" +/* .IP "SPAWN_SCMD_GID(gid_t)" /* The group ID to execute the command as. The value -1 is reserved /* and cannot be specified. -/* .IP "SPAWN_CMD_TIME_LIMIT (int)" +/* .IP "SPAWN_SCMD_TIME_LIMIT(int)" /* The amount of time in seconds the command is allowed to run before /* it is terminated with SIGKILL. The default is no time limit. -/* .IP "SPAWN_CMD_SHELL (char *)" +/* .IP "SPAWN_SCMD_SHELL(const char *)" /* The shell to use when executing the command specified with -/* SPAWN_CMD_COMMAND. This shell is invoked regardless of the +/* SPAWN_SCMD_COMMAND. This shell is invoked regardless of the /* command content. /* .RE /* DIAGNOSTICS diff --git a/postfix/src/util/spawn_command.h b/postfix/src/util/spawn_command.h index 9282528a6..e9be82557 100644 --- a/postfix/src/util/spawn_command.h +++ b/postfix/src/util/spawn_command.h @@ -12,8 +12,11 @@ /* .nf /* - * Request arguments. + * Utility library. */ +#include + +/* Legacy API: type-unchecked arguments, internal use. */ #define SPAWN_CMD_END 0 /* terminator */ #define SPAWN_CMD_ARGV 1 /* command is array */ #define SPAWN_CMD_COMMAND 2 /* command is string */ @@ -27,6 +30,26 @@ #define SPAWN_CMD_SHELL 10 /* alternative shell */ #define SPAWN_CMD_EXPORT 11 /* exportable parameters */ +/* Safer API: type-checked arguments, external use. */ +#define SPAWN_SCMD_END SPAWN_CMD_END +#define SPAWN_SCMD_ARGV(v) SPAWN_CMD_ARGV, CHECK_PPTR(SPAWN_SCMD, char, (v)) +#define SPAWN_SCMD_COMMAND(v) SPAWN_CMD_COMMAND, CHECK_CPTR(SPAWN_SCMD, char, (v)) +#define SPAWN_SCMD_STDIN(v) SPAWN_CMD_STDIN, CHECK_VAL(SPAWN_SCMD, int, (v)) +#define SPAWN_SCMD_STDOUT(v) SPAWN_CMD_STDOUT, CHECK_VAL(SPAWN_SCMD, int, (v)) +#define SPAWN_SCMD_STDERR(v) SPAWN_CMD_STDERR, CHECK_VAL(SPAWN_SCMD, int, (v)) +#define SPAWN_SCMD_UID(v) SPAWN_CMD_UID, CHECK_VAL(SPAWN_SCMD, uid_t, (v)) +#define SPAWN_SCMD_GID(v) SPAWN_CMD_GID, CHECK_VAL(SPAWN_SCMD, gid_t, (v)) +#define SPAWN_SCMD_TIME_LIMIT(v) SPAWN_CMD_TIME_LIMIT, CHECK_VAL(SPAWN_SCMD, int, (v)) +#define SPAWN_SCMD_ENV(v) SPAWN_CMD_ENV, CHECK_PPTR(SPAWN_SCMD, char, (v)) +#define SPAWN_SCMD_SHELL(v) SPAWN_CMD_SHELL, CHECK_CPTR(SPAWN_SCMD, char, (v)) +#define SPAWN_SCMD_EXPORT(v) SPAWN_CMD_EXPORT, CHECK_PPTR(SPAWN_SCMD, char, (v)) + +CHECK_VAL_HELPER_DCL(SPAWN_SCMD, uid_t); +CHECK_VAL_HELPER_DCL(SPAWN_SCMD, int); +CHECK_VAL_HELPER_DCL(SPAWN_SCMD, gid_t); +CHECK_PPTR_HELPER_DCL(SPAWN_SCMD, char); +CHECK_CPTR_HELPER_DCL(SPAWN_SCMD, char); + extern WAIT_STATUS_T spawn_command(int,...); /* LICENSE diff --git a/postfix/src/util/valid_hostname.c b/postfix/src/util/valid_hostname.c index 7a40d6e4b..5b11ad1b1 100644 --- a/postfix/src/util/valid_hostname.c +++ b/postfix/src/util/valid_hostname.c @@ -29,9 +29,9 @@ /* valid_hostname() scrutinizes a hostname: the name should /* be no longer than VALID_HOSTNAME_LEN characters, should /* contain only letters, digits, dots and hyphens, no adjacent -/* dots and hyphens, no leading or trailing dots or hyphens, -/* no labels longer than VALID_LABEL_LEN characters, and it -/* should not be all numeric. +/* dots, no leading or trailing dots or hyphens, no labels +/* longer than VALID_LABEL_LEN characters, and it should not +/* be all numeric. /* /* valid_hostaddr() requires that the input is a valid string /* representation of an IPv4 or IPv6 network address as diff --git a/postfix/src/util/vstream.c b/postfix/src/util/vstream.c index f05e0e72b..bf71e9a84 100644 --- a/postfix/src/util/vstream.c +++ b/postfix/src/util/vstream.c @@ -264,11 +264,11 @@ /* or error conditions. /* /* vstream_control() allows the user to fine tune the behavior of -/* the specified stream. The arguments are a list of (name, -/* value) pairs, terminated with VSTREAM_CTL_END. -/* The following lists the names and the types of the corresponding -/* value arguments. -/* .IP "VSTREAM_CTL_READ_FN (ssize_t (*)(int, void *, size_t, int, void *))" +/* the specified stream. The arguments are a list of macros with +/* zero or more arguments, terminated with VSTREAM_SCTL_END +/* which has none. The following lists the names and the types +/* of the corresponding value arguments. +/* .IP "VSTREAM_SCTL_READ_FN(ssize_t (*)(int, void *, size_t, int, void *))" /* The argument specifies an alternative for the timed_read(3) function, /* for example, a read function that performs decryption. /* This function receives as arguments a file descriptor, buffer pointer, @@ -276,7 +276,7 @@ /* A timeout value <= 0 disables the time limit. /* This function should return the positive number of bytes transferred, /* 0 upon EOF, and -1 upon error with errno set appropriately. -/* .IP "VSTREAM_CTL_WRITE_FN (ssize_t (*)(int, void *, size_t, int, void *))" +/* .IP "VSTREAM_SCTL_WRITE_FN(ssize_t (*)(int, void *, size_t, int, void *))" /* The argument specifies an alternative for the timed_write(3) function, /* for example, a write function that performs encryption. /* This function receives as arguments a file descriptor, buffer pointer, @@ -285,45 +285,45 @@ /* This function should return the positive number of bytes transferred, /* and -1 upon error with errno set appropriately. Instead of -1 it may /* also return 0, e.g., upon remote party-initiated protocol shutdown. -/* .IP "VSTREAM_CTL_CONTEXT (void *)" +/* .IP "VSTREAM_SCTL_CONTEXT(void *)" /* The argument specifies application context that is passed on to /* the application-specified read/write routines. No copy is made. -/* .IP "VSTREAM_CTL_PATH (char *)" +/* .IP "VSTREAM_SCTL_PATH(const char *)" /* Updates the stored pathname of the specified stream. The pathname /* is copied. -/* .IP "VSTREAM_CTL_DOUBLE (no value)" +/* .IP "VSTREAM_SCTL_DOUBLE (no arguments)" /* Use separate buffers for reading and for writing. This prevents /* unread input from being discarded upon change of I/O direction. -/* .IP "VSTREAM_CTL_READ_FD (int) +/* .IP "VSTREAM_SCTL_READ_FD(int) /* The argument specifies the file descriptor to be used for reading. /* This feature is limited to double-buffered streams, and makes the /* stream non-seekable. -/* .IP "VSTREAM_CTL_WRITE_FD (int) +/* .IP "VSTREAM_SCTL_WRITE_FD(int) /* The argument specifies the file descriptor to be used for writing. /* This feature is limited to double-buffered streams, and makes the /* stream non-seekable. -/* .IP "VSTREAM_CTL_SWAP_FD (VSTREAM *)" +/* .IP "VSTREAM_SCTL_SWAP_FD(VSTREAM *)" /* The argument specifies a VSTREAM pointer; the request swaps the /* file descriptor members of the two streams. This feature is limited /* to streams that are both double-buffered or both single-buffered. -/* .IP "VSTREAM_CTL_DUPFD (int)" +/* .IP "VSTREAM_SCTL_DUPFD(int)" /* The argument specifies a minimum file descriptor value. If /* the actual stream's file descriptors are below the minimum, /* reallocate the descriptors to the first free value greater /* than or equal to the minimum. The VSTREAM_CTL_DUPFD macro /* is defined only on systems with fcntl() F_DUPFD support. -/* .IP "VSTREAM_CTL_WAITPID_FN (int (*)(pid_t, WAIT_STATUS_T *, int))" +/* .IP "VSTREAM_SCTL_WAITPID_FN(int (*)(pid_t, WAIT_STATUS_T *, int))" /* A pointer to function that behaves like waitpid(). This information /* is used by the vstream_pclose() routine. -/* .IP "VSTREAM_CTL_TIMEOUT (int) +/* .IP "VSTREAM_SCTL_TIMEOUT(int) /* The deadline for a descriptor to become readable in case of a read /* request, or writable in case of a write request. Specify a value /* of 0 to disable deadlines. -/* .IP "VSTREAM_CTL_EXCEPT (no value)" +/* .IP "VSTREAM_SCTL_EXCEPT (no arguments)" /* Enable exception handling with vstream_setjmp() and vstream_longjmp(). /* This involves allocation of additional memory that normally isn't /* used. -/* .IP "VSTREAM_CTL_BUFSIZE (ssize_t)" +/* .IP "VSTREAM_SCTL_BUFSIZE(ssize_t)" /* Specify a non-default buffer size for the next read(2) or /* write(2) operation, or zero to implement a no-op. Requests /* to reduce the buffer size are silently ignored (i.e. any @@ -337,16 +337,11 @@ /* NOTE: the vstream_*printf() routines may silently expand a /* buffer, so that the result of some %letter specifiers can /* be written to contiguous memory. -/* -/* NOTE: the VSTREAM_CTL_BUFSIZE argument type is ssize_t, not -/* int. Use an explicit cast to avoid problems on LP64 -/* environments and other environments where ssize_t is larger -/* than int. -/* .IP VSTREAM_CTL_START_DEADLINE +/* .IP VSTREAM_SCTL_START_DEADLINE (no arguments) /* Change the VSTREAM_CTL_TIMEOUT behavior, to limit the total /* time for all subsequent file descriptor read or write /* operations, and recharge the deadline timer. -/* .IP VSTREAM_CTL_STOP_DEADLINE +/* .IP VSTREAM_SCTL_STOP_DEADLINE (no arguments) /* Revert VSTREAM_CTL_TIMEOUT behavior to the default, i.e. /* a time limit for individual file descriptor read or write /* operations. @@ -497,19 +492,19 @@ VSTREAM vstream_fstd[] = { 0, /* flags */ 0, 0, 0, 0, /* buffer */ vstream_buf_get_ready, vstream_buf_put_ready, vstream_buf_space, - }, STDIN_FILENO, (VSTREAM_FN) timed_read, (VSTREAM_FN) timed_write, + }, STDIN_FILENO, (VSTREAM_RW_FN) timed_read, (VSTREAM_RW_FN) timed_write, 0,}, {{ 0, /* flags */ 0, 0, 0, 0, /* buffer */ vstream_buf_get_ready, vstream_buf_put_ready, vstream_buf_space, - }, STDOUT_FILENO, (VSTREAM_FN) timed_read, (VSTREAM_FN) timed_write, + }, STDOUT_FILENO, (VSTREAM_RW_FN) timed_read, (VSTREAM_RW_FN) timed_write, 0,}, {{ VBUF_FLAG_FIXED | VSTREAM_FLAG_WRITE, vstream_fstd_buf, VSTREAM_BUFSIZE, VSTREAM_BUFSIZE, vstream_fstd_buf, vstream_buf_get_ready, vstream_buf_put_ready, vstream_buf_space, - }, STDERR_FILENO, (VSTREAM_FN) timed_read, (VSTREAM_FN) timed_write, + }, STDERR_FILENO, (VSTREAM_RW_FN) timed_read, (VSTREAM_RW_FN) timed_write, VSTREAM_BUFSIZE,}, }; @@ -1217,8 +1212,8 @@ VSTREAM *vstream_fdopen(int fd, int flags) */ stream = (VSTREAM *) mymalloc(sizeof(*stream)); stream->fd = fd; - stream->read_fn = VSTREAM_CAN_READ(flags) ? (VSTREAM_FN) timed_read : 0; - stream->write_fn = VSTREAM_CAN_WRITE(flags) ? (VSTREAM_FN) timed_write : 0; + stream->read_fn = VSTREAM_CAN_READ(flags) ? (VSTREAM_RW_FN) timed_read : 0; + stream->write_fn = VSTREAM_CAN_WRITE(flags) ? (VSTREAM_RW_FN) timed_write : 0; vstream_buf_init(&stream->buf, flags); stream->offset = 0; stream->path = 0; @@ -1380,10 +1375,10 @@ void vstream_control(VSTREAM *stream, int name,...) for (va_start(ap, name); name != VSTREAM_CTL_END; name = va_arg(ap, int)) { switch (name) { case VSTREAM_CTL_READ_FN: - stream->read_fn = va_arg(ap, VSTREAM_FN); + stream->read_fn = va_arg(ap, VSTREAM_RW_FN); break; case VSTREAM_CTL_WRITE_FN: - stream->write_fn = va_arg(ap, VSTREAM_FN); + stream->write_fn = va_arg(ap, VSTREAM_RW_FN); break; case VSTREAM_CTL_CONTEXT: stream->context = va_arg(ap, void *); @@ -1604,8 +1599,8 @@ static void copy_line(ssize_t bufsize) { int c; - vstream_control(VSTREAM_IN, VSTREAM_CTL_BUFSIZE, bufsize, VSTREAM_CTL_END); - vstream_control(VSTREAM_OUT, VSTREAM_CTL_BUFSIZE, bufsize, VSTREAM_CTL_END); + vstream_control(VSTREAM_IN, VSTREAM_CTL_BUFSIZE(bufsize), VSTREAM_CTL_END); + vstream_control(VSTREAM_OUT, VSTREAM_CTL_BUFSIZE(bufsize), VSTREAM_CTL_END); while ((c = VSTREAM_GETC(VSTREAM_IN)) != VSTREAM_EOF) { VSTREAM_PUTC(c, VSTREAM_OUT); if (c == '\n') diff --git a/postfix/src/util/vstream.h b/postfix/src/util/vstream.h index ee8d84347..21d294ac0 100644 --- a/postfix/src/util/vstream.h +++ b/postfix/src/util/vstream.h @@ -25,13 +25,14 @@ * Utility library. */ #include +#include /* * Simple buffered stream. The members of this structure are not part of the * official interface and can change without prior notice. */ -typedef ssize_t (*VSTREAM_FN) (int, void *, size_t, int, void *); -typedef int (*VSTREAM_WAITPID_FN) (pid_t, WAIT_STATUS_T *, int); +typedef ssize_t (*VSTREAM_RW_FN) (int, void *, size_t, int, void *); +typedef pid_t (*VSTREAM_WAITPID_FN) (pid_t, WAIT_STATUS_T *, int); #ifdef NO_SIGSETJMP #define VSTREAM_JMP_BUF jmp_buf @@ -42,8 +43,8 @@ typedef int (*VSTREAM_WAITPID_FN) (pid_t, WAIT_STATUS_T *, int); typedef struct VSTREAM { VBUF buf; /* generic intelligent buffer */ int fd; /* file handle, no 256 limit */ - VSTREAM_FN read_fn; /* buffer fill action */ - VSTREAM_FN write_fn; /* buffer fill action */ + VSTREAM_RW_FN read_fn; /* buffer fill action */ + VSTREAM_RW_FN write_fn; /* buffer fill action */ ssize_t req_bufsize; /* requested read/write buffer size */ void *context; /* application context */ off_t offset; /* cached seek info */ @@ -130,6 +131,7 @@ extern int vstream_fdclose(VSTREAM *); extern void vstream_control(VSTREAM *, int,...); +/* Legacy API: type-unchecked arguments, internal use. */ #define VSTREAM_CTL_END 0 #define VSTREAM_CTL_READ_FN 1 #define VSTREAM_CTL_WRITE_FN 2 @@ -146,8 +148,36 @@ extern void vstream_control(VSTREAM *, int,...); #endif #define VSTREAM_CTL_BUFSIZE 12 #define VSTREAM_CTL_SWAP_FD 13 -#define VSTREAM_CTL_START_DEADLINE 14 -#define VSTREAM_CTL_STOP_DEADLINE 15 +#define VSTREAM_CTL_START_DEADLINE 14 +#define VSTREAM_CTL_STOP_DEADLINE 15 + +/* Safer API: type-checked arguments, external use. */ +#define VSTREAM_SCTL_END VSTREAM_CTL_END +#define VSTREAM_SCTL_READ_FN(v) VSTREAM_CTL_READ_FN, CHECK_VAL(VSTREAM_SCTL, VSTREAM_RW_FN, (v)) +#define VSTREAM_SCTL_WRITE_FN(v) VSTREAM_CTL_WRITE_FN, CHECK_VAL(VSTREAM_SCTL, VSTREAM_RW_FN, (v)) +#define VSTREAM_SCTL_PATH(v) VSTREAM_CTL_PATH, CHECK_CPTR(VSTREAM_SCTL, char, (v)) +#define VSTREAM_SCTL_DOUBLE VSTREAM_CTL_DOUBLE +#define VSTREAM_SCTL_READ_FD(v) VSTREAM_CTL_READ_FD, CHECK_VAL(VSTREAM_SCTL, int, (v)) +#define VSTREAM_SCTL_WRITE_FD(v) VSTREAM_CTL_WRITE_FD, CHECK_VAL(VSTREAM_SCTL, int, (v)) +#define VSTREAM_SCTL_WAITPID_FN(v) VSTREAM_CTL_WAITPID_FN, CHECK_VAL(VSTREAM_SCTL, VSTREAM_WAITPID_FN, (v)) +#define VSTREAM_SCTL_TIMEOUT(v) VSTREAM_CTL_TIMEOUT, CHECK_VAL(VSTREAM_SCTL, int, (v)) +#define VSTREAM_SCTL_EXCEPT VSTREAM_CTL_EXCEPT +#define VSTREAM_SCTL_CONTEXT(v) VSTREAM_CTL_CONTEXT, CHECK_PTR(VSTREAM_SCTL, void, (v)) +#ifdef F_DUPFD +#define VSTREAM_SCTL_DUPFD(v) VSTREAM_CTL_DUPFD, CHECK_VAL(VSTREAM_SCTL, int, (v)) +#endif +#define VSTREAM_SCTL_BUFSIZE(v) VSTREAM_CTL_BUFSIZE, CHECK_VAL(VSTREAM_SCTL, ssize_t, (v)) +#define VSTREAM_SCTL_SWAP_FD(v) VSTREAM_CTL_SWAP_FD, CHECK_PTR(VSTREAM_SCTL, VSTREAM, (v)) +#define VSTREAM_SCTL_START_DEADLINE VSTREAM_CTL_START_DEADLINE +#define VSTREAM_SCTL_STOP_DEADLINE VSTREAM_CTL_STOP_DEADLINE + +CHECK_VAL_HELPER_DCL(VSTREAM_SCTL, ssize_t); +CHECK_VAL_HELPER_DCL(VSTREAM_SCTL, int); +CHECK_VAL_HELPER_DCL(VSTREAM_SCTL, VSTREAM_WAITPID_FN); +CHECK_VAL_HELPER_DCL(VSTREAM_SCTL, VSTREAM_RW_FN); +CHECK_PTR_HELPER_DCL(VSTREAM_SCTL, void); +CHECK_PTR_HELPER_DCL(VSTREAM_SCTL, VSTREAM); +CHECK_CPTR_HELPER_DCL(VSTREAM_SCTL, char); extern VSTREAM *PRINTFLIKE(1, 2) vstream_printf(const char *,...); extern VSTREAM *PRINTFLIKE(2, 3) vstream_fprintf(VSTREAM *, const char *,...); @@ -157,6 +187,7 @@ extern int vstream_pclose(VSTREAM *); #define vstream_ispipe(vp) ((vp)->pid != 0) +/* Legacy API: type-unchecked arguments, internal use. */ #define VSTREAM_POPEN_END 0 /* terminator */ #define VSTREAM_POPEN_COMMAND 1 /* command is string */ #define VSTREAM_POPEN_ARGV 2 /* command is array */ @@ -167,6 +198,23 @@ extern int vstream_pclose(VSTREAM *); #define VSTREAM_POPEN_WAITPID_FN 7 /* child catcher, waitpid() compat. */ #define VSTREAM_POPEN_EXPORT 8 /* exportable environment */ +/* Safer API: type-checked arguments, external use. */ +#define VSTREAM_SPOPEN_END VSTREAM_POPEN_END +#define VSTREAM_SPOPEN_COMMAND(v) VSTREAM_POPEN_COMMAND, CHECK_CPTR(VSTREAM_SPOP, char, (v)) +#define VSTREAM_SPOPEN_ARGV(v) VSTREAM_POPEN_ARGV, CHECK_PPTR(VSTREAM_SPOP, char, (v)) +#define VSTREAM_SPOPEN_UID(v) VSTREAM_POPEN_UID, CHECK_VAL(VSTREAM_SPOP, uid_t, (v)) +#define VSTREAM_SPOPEN_GID(v) VSTREAM_POPEN_GID, CHECK_VAL(VSTREAM_SPOP, gid_t, (v)) +#define VSTREAM_SPOPEN_ENV(v) VSTREAM_POPEN_ENV, CHECK_PPTR(VSTREAM_SPOP, char, (v)) +#define VSTREAM_SPOPEN_SHELL(v) VSTREAM_POPEN_SHELL, CHECK_CPTR(VSTREAM_SPOP, char, (v)) +#define VSTREAM_SPOPEN_WAITPID_FN(v) VSTREAM_POPEN_WAITPID_FN, CHECK_VAL(VSTREAM_SPOP, VSTREAM_WAITPID_FN, (v)) +#define VSTREAM_SPOPEN_EXPORT(v) VSTREAM_POPEN_EXPORT, CHECK_PPTR(VSTREAM_SPOP, char, (v)) + +CHECK_VAL_HELPER_DCL(VSTREAM_SPOP, uid_t); +CHECK_VAL_HELPER_DCL(VSTREAM_SPOP, gid_t); +CHECK_VAL_HELPER_DCL(VSTREAM_SPOP, VSTREAM_WAITPID_FN); +CHECK_PPTR_HELPER_DCL(VSTREAM_SPOP, char); +CHECK_CPTR_HELPER_DCL(VSTREAM_SPOP, char); + extern VSTREAM *vstream_vprintf(const char *, va_list); extern VSTREAM *vstream_vfprintf(VSTREAM *, const char *, va_list); diff --git a/postfix/src/util/vstream_popen.c b/postfix/src/util/vstream_popen.c index 7c54ec14a..66077e6dc 100644 --- a/postfix/src/util/vstream_popen.c +++ b/postfix/src/util/vstream_popen.c @@ -18,38 +18,38 @@ /* argument is as with vstream_fopen(). The child's standard input and /* standard output are redirected to the stream, which is based on a /* socketpair or other suitable local IPC. vstream_popen() takes a list -/* of (key, value) arguments, terminated by VSTREAM_POPEN_END. The key -/* argument specifies what value will follow. The following is a listing -/* of key codes together with the expected value type. +/* of macros with zero or more arguments, terminated by +/* VSTREAM_SPOPEN_END. The following is a listing of macros +/* with the expected argument type. /* .RS -/* .IP "VSTREAM_POPEN_COMMAND (char *)" +/* .IP "VSTREAM_SPOPEN_COMMAND(const char *)" /* Specifies the command to execute as a string. The string is /* passed to the shell when it contains shell meta characters /* or when it appears to be a shell built-in command, otherwise /* the command is executed without invoking a shell. -/* One of VSTREAM_POPEN_COMMAND or VSTREAM_POPEN_ARGV must be specified. -/* .IP "VSTREAM_POPEN_ARGV (char **)" +/* One of VSTREAM_SPOPEN_COMMAND or VSTREAM_POPEN_ARGV must be specified. +/* .IP "VSTREAM_SPOPEN_ARGV(char **)" /* The command is specified as an argument vector. This vector is /* passed without further inspection to the \fIexecvp\fR() routine. -/* One of VSTREAM_POPEN_COMMAND or VSTREAM_POPEN_ARGV must be specified. -/* See also the VSTREAM_POPEN_SHELL attribute below. -/* .IP "VSTREAM_POPEN_ENV (char **)" +/* One of VSTREAM_SPOPEN_COMMAND or VSTREAM_POPEN_ARGV must be specified. +/* See also the VSTREAM_SPOPEN_SHELL attribute below. +/* .IP "VSTREAM_SPOPEN_ENV(char **)" /* Additional environment information, in the form of a null-terminated /* list of name, value, name, value, ... elements. By default only the /* command search path is initialized to _PATH_DEFPATH. -/* .IP "VSTREAM_POPEN_EXPORT (char **)" +/* .IP "VSTREAM_SPOPEN_EXPORT(char **)" /* This argument is passed to clean_env(). /* Null-terminated array of names of environment parameters /* that can be exported. By default, everything is exported. -/* .IP "VSTREAM_POPEN_UID (uid_t)" +/* .IP "VSTREAM_SPOPEN_UID(uid_t)" /* The user ID to execute the command as. The user ID must be non-zero. -/* .IP "VSTREAM_POPEN_GID (gid_t)" +/* .IP "VSTREAM_SPOPEN_GID(gid_t)" /* The group ID to execute the command as. The group ID must be non-zero. -/* .IP "VSTREAM_POPEN_SHELL (char *)" +/* .IP "VSTREAM_SPOPEN_SHELL(const char *)" /* The shell to use when executing the command specified with -/* VSTREAM_POPEN_COMMAND. This shell is invoked regardless of the +/* VSTREAM_SPOPEN_COMMAND. This shell is invoked regardless of the /* command content. -/* .IP "VSTREAM_POPEN_WAITPID_FN ((*)(pid_t, WAIT_STATUS_T *, int))" +/* .IP "VSTREAM_SPOPEN_WAITPID_FN(pid_t (*)(pid_t, WAIT_STATUS_T *, int))" /* waitpid()-like function to reap the child exit status when /* vstream_pclose() is called. /* .RE diff --git a/postfix/src/util/vstream_tweak.c b/postfix/src/util/vstream_tweak.c index 28ba0b1c5..9169b7e52 100644 --- a/postfix/src/util/vstream_tweak.c +++ b/postfix/src/util/vstream_tweak.c @@ -120,7 +120,7 @@ int vstream_tweak_tcp(VSTREAM *fp) * changes and IP path MTU discovery is turned on, so we choose a * somewhat larger buffer. * - * Note: as of 20120527, the VSTREAM_CTL_BUFSIZE request can reduce the + * Note: as of 20120527, the VSTREAM_SCTL_BUFSIZE request can reduce the * stream buffer size to less than VSTREAM_BUFSIZE, when the request is * made before the first stream read or write operation. We don't want to * reduce the buffer size. @@ -128,13 +128,13 @@ int vstream_tweak_tcp(VSTREAM *fp) #define EFF_BUFFER_SIZE(fp) (vstream_req_bufsize(fp) ? \ vstream_req_bufsize(fp) : VSTREAM_BUFSIZE) -#ifdef VSTREAM_CTL_BUFSIZE +#ifdef VSTREAM_SCTL_BUFSIZE if (mss > EFF_BUFFER_SIZE(fp) / 2) { if (mss < INT_MAX / 2) mss *= 2; vstream_control(fp, - VSTREAM_CTL_BUFSIZE, (ssize_t) mss, - VSTREAM_CTL_END); + VSTREAM_SCTL_BUFSIZE(mss), + VSTREAM_SCTL_END); } /* diff --git a/postfix/src/util/vstring.c b/postfix/src/util/vstring.c index 6732507af..a2bc3f13f 100644 --- a/postfix/src/util/vstring.c +++ b/postfix/src/util/vstring.c @@ -131,15 +131,15 @@ /* is a null-terminated string of length zero. /* /* vstring_ctl() gives additional control over VSTRING behavior. -/* The function takes a VSTRING pointer and a list of zero -/* or more (name,value) pairs. The expected value type -/* depends on the specified name. The value name codes are: -/* .IP "VSTRING_CTL_MAXLEN (ssize_t)" +/* The function takes a VSTRING pointer and a list of zero or +/* more macros with zer or more arguments, terminated with +/* VSTRING_SCTL_END which has none. +/* .IP "VSTRING_SCTL_MAXLEN(ssize_t len) /* Specifies a hard upper limit on a string's length. When the /* length would be exceeded, the program simulates a memory /* allocation problem (i.e. it terminates through msg_fatal()). /* This fuctionality is currently unimplemented. -/* .IP "VSTRING_CTL_END (no value)" +/* .IP "VSTRING_SCTL_END (no argument)" /* Specifies the end of the argument list. Forgetting to terminate /* the argument list may cause the program to crash. /* .PP diff --git a/postfix/src/util/vstring.h b/postfix/src/util/vstring.h index 30b463d1e..b220b0f7f 100644 --- a/postfix/src/util/vstring.h +++ b/postfix/src/util/vstring.h @@ -20,6 +20,7 @@ * Utility library. */ #include +#include /* * We can't allow bare VBUFs in the interface, because VSTRINGs have a @@ -27,7 +28,7 @@ */ typedef struct VSTRING { VBUF vbuf; - ssize_t maxlen; + ssize_t maxlen; } VSTRING; extern VSTRING *vstring_alloc(ssize_t); @@ -45,13 +46,20 @@ extern VSTRING *vstring_insert(VSTRING *, ssize_t, const char *, ssize_t); extern VSTRING *vstring_prepend(VSTRING *, const char *, ssize_t); extern VSTRING *PRINTFLIKE(2, 3) vstring_sprintf(VSTRING *, const char *,...); extern VSTRING *PRINTFLIKE(2, 3) vstring_sprintf_append(VSTRING *, const char *,...); -extern VSTRING *PRINTFLIKE(2, 3) vstring_sprintf_prepend(VSTRING *, const char *, ...); +extern VSTRING *PRINTFLIKE(2, 3) vstring_sprintf_prepend(VSTRING *, const char *,...); extern char *vstring_export(VSTRING *); extern VSTRING *vstring_import(char *); +/* Legacy API: constant plus type-unchecked argument. */ #define VSTRING_CTL_MAXLEN 1 #define VSTRING_CTL_END 0 +/* Safer API: type-checked arguments. */ +#define VSTRING_SCTL_END VSTRING_CTL_END +#define VSTRING_SCTL_MAXLEN(val) VSTRING_CTL_MAXLEN, CHECK_VAL(VSTRING, ssize_t, (val)) + +CHECK_VAL_HELPER_DCL(VSTRING, ssize_t); + /* * Macros. Unsafe macros have UPPERCASE names. */ diff --git a/postfix/src/verify/verify.c b/postfix/src/verify/verify.c index d7642c9fc..cc45581f6 100644 --- a/postfix/src/verify/verify.c +++ b/postfix/src/verify/verify.c @@ -532,7 +532,7 @@ static void verify_query_service(VSTREAM *client_stream) /* verify_cache_validator - cache cleanup validator */ static int verify_cache_validator(const char *addr, const char *raw_data, - char *context) + void *context) { VSTRING *get_buf = (VSTRING *) context; int addr_status; @@ -591,7 +591,7 @@ static void verify_service(VSTREAM *client_stream, char *unused_service, /* verify_dump - dump some statistics */ -static void verify_dump(void) +static void verify_dump(char *unused_name, char **unused_argv) { /* @@ -629,11 +629,11 @@ static void post_jail_init(char *unused_name, char **unused_argv) if (msg_verbose) cache_flags |= DICT_CACHE_FLAG_VERBOSE; dict_cache_control(verify_map, - DICT_CACHE_CTL_FLAGS, cache_flags, - DICT_CACHE_CTL_INTERVAL, var_verify_scan_cache, - DICT_CACHE_CTL_VALIDATOR, verify_cache_validator, - DICT_CACHE_CTL_CONTEXT, (void *) vstring_alloc(100), - DICT_CACHE_CTL_END); + DICT_CACHE_SCTL_FLAGS(cache_flags), + DICT_CACHE_SCTL_INTERVAL(var_verify_scan_cache), + DICT_CACHE_SCTL_VALIDATOR(verify_cache_validator), + DICT_CACHE_SCTL_CONTEXT((void *) vstring_alloc(100)), + DICT_CACHE_SCTL_END); } } @@ -724,11 +724,11 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; multi_server_main(argc, argv, verify_service, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_TIME_TABLE, time_table, - MAIL_SERVER_PRE_INIT, pre_jail_init, - MAIL_SERVER_POST_INIT, post_jail_init, - MAIL_SERVER_SOLITARY, - MAIL_SERVER_EXIT, verify_dump, + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_TIME_TABLE(time_table), + MAIL_SERVER_REQ_PRE_INIT(pre_jail_init), + MAIL_SERVER_REQ_POST_INIT(post_jail_init), + MAIL_SERVER_REQ_SOLITARY, + MAIL_SERVER_REQ_EXIT(verify_dump), 0); } diff --git a/postfix/src/virtual/virtual.c b/postfix/src/virtual/virtual.c index 6b56226da..9c0d9091e 100644 --- a/postfix/src/virtual/virtual.c +++ b/postfix/src/virtual/virtual.c @@ -531,15 +531,15 @@ int main(int argc, char **argv) MAIL_VERSION_STAMP_ALLOCATE; single_server_main(argc, argv, local_service, - MAIL_SERVER_INT_TABLE, int_table, - MAIL_SERVER_LONG_TABLE, long_table, - MAIL_SERVER_STR_TABLE, str_table, - MAIL_SERVER_BOOL_TABLE, bool_table, - MAIL_SERVER_PRE_INIT, pre_init, - MAIL_SERVER_POST_INIT, post_init, - MAIL_SERVER_PRE_ACCEPT, pre_accept, - MAIL_SERVER_PRIVILEGED, - MAIL_SERVER_BOUNCE_INIT, VAR_VIRT_DSN_FILTER, - &var_virt_dsn_filter, + MAIL_SERVER_REQ_INT_TABLE(int_table), + MAIL_SERVER_REQ_LONG_TABLE(long_table), + MAIL_SERVER_REQ_STR_TABLE(str_table), + MAIL_SERVER_REQ_BOOL_TABLE(bool_table), + MAIL_SERVER_REQ_PRE_INIT(pre_init), + MAIL_SERVER_REQ_POST_INIT(post_init), + MAIL_SERVER_REQ_PRE_ACCEPT(pre_accept), + MAIL_SERVER_REQ_PRIVILEGED, + MAIL_SERVER_REQ_BOUNCE_INIT(VAR_VIRT_DSN_FILTER, + &var_virt_dsn_filter), 0); } diff --git a/postfix/src/xsasl/Makefile.in b/postfix/src/xsasl/Makefile.in index 3abdfca3d..9a7b171b5 100644 --- a/postfix/src/xsasl/Makefile.in +++ b/postfix/src/xsasl/Makefile.in @@ -82,6 +82,7 @@ depend: $(MAKES) # do not edit below this line - it is generated by 'make depend' xsasl_client.o: ../../include/argv.h +xsasl_client.o: ../../include/check_arg.h xsasl_client.o: ../../include/msg.h xsasl_client.o: ../../include/mymalloc.h xsasl_client.o: ../../include/sys_defs.h @@ -92,6 +93,7 @@ xsasl_client.o: xsasl.h xsasl_client.o: xsasl_client.c xsasl_client.o: xsasl_cyrus.h xsasl_cyrus_client.o: ../../include/argv.h +xsasl_cyrus_client.o: ../../include/check_arg.h xsasl_cyrus_client.o: ../../include/mail_params.h xsasl_cyrus_client.o: ../../include/msg.h xsasl_cyrus_client.o: ../../include/mymalloc.h @@ -108,6 +110,7 @@ xsasl_cyrus_log.o: ../../include/msg.h xsasl_cyrus_log.o: ../../include/sys_defs.h xsasl_cyrus_log.o: xsasl_cyrus_common.h xsasl_cyrus_log.o: xsasl_cyrus_log.c +xsasl_cyrus_security.o: ../../include/check_arg.h xsasl_cyrus_security.o: ../../include/name_mask.h xsasl_cyrus_security.o: ../../include/sys_defs.h xsasl_cyrus_security.o: ../../include/vbuf.h @@ -115,6 +118,7 @@ xsasl_cyrus_security.o: ../../include/vstring.h xsasl_cyrus_security.o: xsasl_cyrus_common.h xsasl_cyrus_security.o: xsasl_cyrus_security.c xsasl_cyrus_server.o: ../../include/argv.h +xsasl_cyrus_server.o: ../../include/check_arg.h xsasl_cyrus_server.o: ../../include/mail_params.h xsasl_cyrus_server.o: ../../include/msg.h xsasl_cyrus_server.o: ../../include/mymalloc.h @@ -129,6 +133,7 @@ xsasl_cyrus_server.o: xsasl_cyrus.h xsasl_cyrus_server.o: xsasl_cyrus_common.h xsasl_cyrus_server.o: xsasl_cyrus_server.c xsasl_dovecot_server.o: ../../include/argv.h +xsasl_dovecot_server.o: ../../include/check_arg.h xsasl_dovecot_server.o: ../../include/connect.h xsasl_dovecot_server.o: ../../include/iostuff.h xsasl_dovecot_server.o: ../../include/mail_params.h @@ -147,6 +152,7 @@ xsasl_dovecot_server.o: xsasl.h xsasl_dovecot_server.o: xsasl_dovecot.h xsasl_dovecot_server.o: xsasl_dovecot_server.c xsasl_server.o: ../../include/argv.h +xsasl_server.o: ../../include/check_arg.h xsasl_server.o: ../../include/msg.h xsasl_server.o: ../../include/mymalloc.h xsasl_server.o: ../../include/sys_defs.h diff --git a/postfix/src/xsasl/xsasl_dovecot_server.c b/postfix/src/xsasl/xsasl_dovecot_server.c index 7f5458280..f2a08f2d5 100644 --- a/postfix/src/xsasl/xsasl_dovecot_server.c +++ b/postfix/src/xsasl/xsasl_dovecot_server.c @@ -278,9 +278,9 @@ static int xsasl_dovecot_server_connect(XSASL_DOVECOT_SERVER_IMPL *xp) } sasl_stream = vstream_fdopen(fd, O_RDWR); vstream_control(sasl_stream, - VSTREAM_CTL_PATH, xp->socket_path, - VSTREAM_CTL_TIMEOUT, AUTH_TIMEOUT, - VSTREAM_CTL_END); + VSTREAM_SCTL_PATH(xp->socket_path), + VSTREAM_SCTL_TIMEOUT(AUTH_TIMEOUT), + VSTREAM_SCTL_END); /* XXX Encapsulate for logging. */ vstream_fprintf(sasl_stream,