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.
(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
====================================
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?
delivery status code or explanatory text of successful or unsuc-
cessful deliveries.
- <b><a href="postconf.5.html#smtp_dns_reply_filter">smtp_dns_reply_filter</a> ($<a href="postconf.5.html#default_dns_reply_filter">default_dns_reply_filter</a>)</b>
+ <b><a href="postconf.5.html#smtp_dns_reply_filter">smtp_dns_reply_filter</a> (empty)</b>
Optional filter for Postfix SMTP client DNS lookup results.
<b>MIME PROCESSING CONTROLS</b>
client should bind to when making an IPv6 connection.
<b><a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
- The hostname to send in the SMTP EHLO or HELO command.
+ The hostname to send in the SMTP HELO or EHLO command.
<b><a href="postconf.5.html#lmtp_lhlo_name">lmtp_lhlo_name</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
The hostname to send in the LMTP LHLO command.
when not present. Postfix 2.6 and later add these headers only
when clients match the <a href="postconf.5.html#local_header_rewrite_clients">local_header_rewrite_clients</a> parameter
setting. Earlier Postfix versions always add these headers; this
-may break DKIM signatures that cover non-existent headers. </p>
+may break DKIM signatures that cover non-existent headers.
+The <a href="postconf.5.html#undisclosed_recipients_header">undisclosed_recipients_header</a> parameter setting determines
+whether a To: header will be added. </p>
</DD>
Use <i>hostname</i> in the SMTP greeting, in the HELO response, and in
the EHLO response. The default hostname is "smtp-sink".
+ <b>-H</b> <i>delay</i>
+ 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 <b>-T</b> option) to test the Postfix client
+ write_wait() implementation.
+
<b>-L</b> Enable LMTP instead of SMTP.
<b>-m</b> <i>count</i> (default: 256)
An upper bound on the maximal number of simultaneous connections
- that <b>smtp-sink</b> will handle. This prevents the process from run-
- ning out of file descriptors. Excess connections will stay
+ that <b>smtp-sink</b> will handle. This prevents the process from run-
+ ning out of file descriptors. Excess connections will stay
queued in the TCP/IP stack.
<b>-M</b> <i>count</i>
<b>-p</b> Do not announce support for ESMTP command pipelining.
- <b>-P</b> Change the server greeting so that it appears to come through a
+ <b>-P</b> Change the server greeting so that it appears to come through a
CISCO PIX system. Implies <b>-e</b>.
<b>-q</b> <i>command,command,...</i>
- 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.
<b>-Q</b> <i>command,command,...</i>
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.
<b>-r</b> <i>command,command,...</i>
- Reject the specified commands with a soft (4xx) error code.
+ Reject the specified commands with a soft (4xx) error code.
This option implies <b>-p</b>.
- 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.
<b>-R</b> <i>root-directory</i>
- Change the process root directory to the specified location.
- This option requires super-user privileges. See also the <b>-u</b>
+ Change the process root directory to the specified location.
+ This option requires super-user privileges. See also the <b>-u</b>
option.
<b>-s</b> <i>command,command,...</i>
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.
<b>-S start-string</b>
- 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), \<i>ddd</i> (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), \<i>ddd</i> (up
to three octal digits) and \\ (the backslash character).
<b>-t</b> <i>timeout</i> (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.
<b>-T</b> <i>windowsize</i>
- 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.
<b>-u</b> <i>username</i>
- 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 <b>-R</b> option.
<b>-v</b> Show the SMTP conversations.
Wait <i>delay</i> seconds before responding to a DATA command.
<b>-W</b> <i>command:delay[:odds]</i>
- Wait <i>delay</i> seconds before responding to <i>command</i>. If <i>odds</i> is
- also specified (a number between 1-99 inclusive), wait for a
- random multiple of <i>delay</i>. The random multiplier is equal to the
+ Wait <i>delay</i> seconds before responding to <i>command</i>. If <i>odds</i> is
+ also specified (a number between 1-99 inclusive), wait for a
+ random multiple of <i>delay</i>. 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 <i>odds</i>.
[<b>inet:</b>][<i>host</i>]:<i>port</i>
- Listen on network interface <i>host</i> (default: any interface) TCP
- port <i>port</i>. Both <i>host</i> and <i>port</i> may be specified in numeric or
+ Listen on network interface <i>host</i> (default: any interface) TCP
+ port <i>port</i>. Both <i>host</i> and <i>port</i> may be specified in numeric or
symbolic form.
<b>unix:</b><i>pathname</i>
Listen on the UNIX-domain socket at <i>pathname</i>.
<i>backlog</i>
- The maximum length the queue of pending connections, as defined
+ The maximum length the queue of pending connections, as defined
by the <b>listen</b>(2) system call.
<b>DUMP FILE FORMAT</b>
- 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:
<b>o</b> The optional string specified with the <b>-S</b> option.
The format of the <b>smtp-sink</b> generated headers is as follows:
<b>X-Client-Addr:</b> <i>text</i>
- 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.
<b>X-Client-Proto:</b> <i>text</i>
- The client protocol: SMTP, ESMTP or LMTP. This record is always
+ The client protocol: SMTP, ESMTP or LMTP. This record is always
present.
<b>X-Helo-Args:</b> <i>text</i>
- 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.
<b>X-Mail-Args:</b> <i>text</i>
- 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.
<b>X-Rcpt-Args:</b> <i>text</i>
- 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.
<b>Received:</b> <i>text</i>
- 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 <b>smtp-sink</b>, and is formatted as follows:
<b>from</b> <i>helo</i> <b>([</b><i>addr</i><b>])</b>
- 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.
<b>by</b> <i>host</i> <b>(smtp-sink) with</b> <i>proto</i> <b>id</b> <i>random</i><b>;</b>
- The hostname specified with the <b>-h</b> option, the client
- protocol (see <b>X-Client-Proto</b> above), and the pseudo-ran-
+ The hostname specified with the <b>-h</b> option, the client
+ protocol (see <b>X-Client-Proto</b> above), and the pseudo-ran-
dom portion of the per-message capture file name.
<i>time-stamp</i>
delivery status code or explanatory text of successful or unsuc-
cessful deliveries.
- <b><a href="postconf.5.html#smtp_dns_reply_filter">smtp_dns_reply_filter</a> ($<a href="postconf.5.html#default_dns_reply_filter">default_dns_reply_filter</a>)</b>
+ <b><a href="postconf.5.html#smtp_dns_reply_filter">smtp_dns_reply_filter</a> (empty)</b>
Optional filter for Postfix SMTP client DNS lookup results.
<b>MIME PROCESSING CONTROLS</b>
client should bind to when making an IPv6 connection.
<b><a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
- The hostname to send in the SMTP EHLO or HELO command.
+ The hostname to send in the SMTP HELO or EHLO command.
<b><a href="postconf.5.html#lmtp_lhlo_name">lmtp_lhlo_name</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
The hostname to send in the LMTP LHLO command.
# 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
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
;;
.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)"
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.
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
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"
(SMTPUTF8) support. By default, EAI support is compiled in when
the "icuuc" library and header files are found. </td> </tr>
+<tr> <td> </td> <td> -DNO_INLINE </td> <td> Do not require support
+for C99 "inline" functions. Instead, implement argument typechecks
+for non-printf/scanf-like functions with ternary operators and
+unreachable code. </td> </tr>
+
<tr> <td> </td> <td> -DNO_IPV6 </td> <td> 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
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. </p>
+may break DKIM signatures that cover non-existent headers.
+The undisclosed_recipients_header parameter setting determines
+whether a To: header will be added. </p>
%PARAM lmtp_header_checks
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)
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);
}
* 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);
}
* 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);
}
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);
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
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);
}
# 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
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
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
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
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
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
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
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
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
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
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
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);
}
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
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);
}
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);
}
@$(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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
/* SYNOPSIS
/* #include <attr_override.h>
/*
-/* 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;
/* 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
/*
* External interface.
*/
+#include <check_arg.h>
+
extern void attr_override(char *, const char *, const char *,...);
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
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);
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);
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;
}
}
}
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);
}
/* 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.
*/
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) {
(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
*/
#include <vstream.h>
#include <vstring.h>
+#include <check_arg.h>
/*
* External interface.
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 */
#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 *);
* 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
/* 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
/* 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)
{
* 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;
/*
*/
#include <vstream.h>
#include <vstring.h>
+#include <check_arg.h>
/*
* Global library.
#include <dsn_buf.h>
/*
- * 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.
* 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 */
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 */
{
char *extension;
char *stripped;
- char* delim = "+-";
+ char *delim = "+-";
#define NO_DELIM ""
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 */
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);
}
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);
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);
}
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
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
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
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
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
/* 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.
/* 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
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);
*/
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();
*/
#include <vstream.h>
+ /*
+ * Global library.
+ */
+#include <mail_conf.h>
+
/*
* External interface. Tables are defined in mail_conf.h.
*/
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
*/
/* 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.
/* 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
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);
*/
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();
/* 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.
/* 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
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)
*/
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();
/* 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.
/* 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
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,
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);
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
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;
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;
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
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
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
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
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
* 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);
}
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);
* 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);
}
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,
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);
}
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
# 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
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)
/* 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. */
*/
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);
}
# 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
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
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
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
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
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
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
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
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
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
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
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
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
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
* 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. */
# 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
# 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
@$(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
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
# 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
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)
# 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
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);
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
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
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
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
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
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
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
/* psc_dump - dump some statistics before exit */
-static void psc_dump(void)
+static void psc_dump(char *unused_service, char **unused_argv)
{
/*
static int psc_cache_validator(const char *client_addr,
const char *stamp_str,
- char *unused_context)
+ void *unused_context)
{
PSC_STATE dummy;
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.
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);
}
}
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),
/* 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,
/* 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);
* 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;
}
* 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"
* 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;
* 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"
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)
} 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 {
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);
*/
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;
}
# 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
# 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
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
*/
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);
}
/*
* 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))) {
*/
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
* 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),
}
}
vstream_control(client_stream,
- VSTREAM_CTL_START_DEADLINE,
- VSTREAM_CTL_END);
+ VSTREAM_SCTL_START_DEADLINE,
+ VSTREAM_SCTL_END);
vstream_fflush(client_stream);
}
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);
}
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
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
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
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
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
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
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
* 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);
}
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);
* 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);
}
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);
}
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);
}
/* 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
/* 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"
* 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);
}
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
* 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;
* 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);
}
*/
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
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
-
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;
}
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
OK
>>> rcpt wietse@wzv.porcupine.org
OK
->>> rcpt wietse@fist.porcupine.org
+>>> rcpt wietse@backup.porcupine.org
OK
>>> rcpt wietse@porcupine.org
./smtpd_check: <queue id>: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <wietse@porcupine.org>: Recipient address rejected: Access denied; to=<wietse@porcupine.org> proto=SMTP
554 5.7.1 <wietse@porcupine.org>: Recipient address rejected: Access denied
>>> permit_mx_backup_networks 168.100.189.5
OK
->>> rcpt wietse@fist.porcupine.org
-./smtpd_check: <queue id>: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <wietse@fist.porcupine.org>: Recipient address rejected: Access denied; to=<wietse@fist.porcupine.org> proto=SMTP
-554 5.7.1 <wietse@fist.porcupine.org>: Recipient address rejected: Access denied
+>>> rcpt wietse@backup.porcupine.org
+./smtpd_check: <queue id>: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <wietse@backup.porcupine.org>: Recipient address rejected: Access denied; to=<wietse@backup.porcupine.org> proto=SMTP
+554 5.7.1 <wietse@backup.porcupine.org>: 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
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
# 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
./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
./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
}
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);
/*
* 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);
}
@$(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
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
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
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
/* .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)"
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 */
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)
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));
/*
* 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;
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;
*/
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);
}
/*
*/
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);
}
/*
# 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
* 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);
/*
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);
}
# 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
/* 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
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 */
* 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
* 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);
}
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
*/
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.
* 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);
}
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);
}
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 \
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.
$(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 \
# 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
+++ /dev/null
-/*++
-/* NAME
-/* attr 3
-/* SUMMARY
-/* attribute list manipulations
-/* SYNOPSIS
-/* #include <attr.h>
-/* 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 <sys_defs.h>
-
- /*
- * Utility library.
- */
-#include <attr.h>
-
- /*
- * 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);
#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.
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 */
/* 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
/* 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
/* 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
/* .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,
/* 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.
/* .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,
/* 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.
/* .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,
/* 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.
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) {
/* SYNOPSIS
/* #include <check_arg.h>
/*
-/* 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
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 (;;) {
/*
/* 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
* Utility library.
*/
#include <dict.h>
+#include <check_arg.h>
/*
* External interface.
#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
* 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)
}
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.
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)) {
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 */
* 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);
/*
*/
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);
/* 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
#include <lmdb.h>
#endif
+ /*
+ * Utility library.
+ */
+#include <check_arg.h>
+
/*
* External interface.
*/
#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
/*
/* 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
/* .nf
/*
- * Request arguments.
+ * Utility library.
*/
+#include <check_arg.h>
+
+/* 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 */
#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
/* 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
/* 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,
/* 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,
/* 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
/* 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.
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,},
};
*/
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;
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 *);
{
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')
* Utility library.
*/
#include <vbuf.h>
+#include <check_arg.h>
/*
* 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
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 */
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
#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 *,...);
#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 */
#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);
/* 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
* 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.
#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);
}
/*
/* 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
* Utility library.
*/
#include <vbuf.h>
+#include <check_arg.h>
/*
* We can't allow bare VBUFs in the interface, because VSTRINGs have a
*/
typedef struct VSTRING {
VBUF vbuf;
- ssize_t maxlen;
+ ssize_t maxlen;
} VSTRING;
extern VSTRING *vstring_alloc(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.
*/
/* 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;
/* verify_dump - dump some statistics */
-static void verify_dump(void)
+static void verify_dump(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);
}
}
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);
}
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);
}
# 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
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
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
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
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
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
}
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,