2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-22 09:57:34 +00:00

postfix-3.6-20200610

This commit is contained in:
Wietse Venema 2020-06-10 00:00:00 -05:00 committed by Viktor Dukhovni
parent 119d6abed9
commit c22bee85a2
37 changed files with 241 additions and 192 deletions

View File

@ -24839,3 +24839,31 @@ Apologies for any names omitted.
agent visible, where it would otherwise have remained
invisible, which would complicate troubleshooting. File:
global/deliver_pass.c.
20200610
Respectful code: replace 'slave' in internal identifiers
and comments, and make the master(5) description more
consistent with that in master(8). Postfix does not have a
master/slave architecture, and these identifiers and comments
were just poorly worded. Files: conf/postmulti-script,
html/master.5.html, man/man5/master.5, proto/master,
global/dsb_scan.c, global/dsb_scan.h, global/dsn_print.c,
global/dsn_print.h, global/msg_stats.h, global/msg_stats_print.c,
global/msg_stats_scan.c, global/rcpt_buf.c, global/rcpt_buf.h,
global/rcpt_print.c, global/rcpt_print.h, milter/milter.h,
milter/milter_macros.c, tls/tls_proxy.h,
tls/tls_proxy_client_print.c, tls/tls_proxy_client_scan.c,
tls/tls_proxy_context_print.c, tls/tls_proxy_context_scan.c,
tls/tls_proxy_server_print.c, tls/tls_proxy_server_scan.c,
util/argv_attr.h, util/argv_attr_print.c, util/argv_attr_scan.c,
util/attr.h, util/attr_print0.c, util/attr_print64.c,
util/attr_print_plain.c, util/attr_scan0.c, util/attr_scan64.c,
util/attr_scan_plain.c.
Bugfix (introduced: Postfix 3.4): in the Postfix SMTP server,
the SNI callback reported an error when it was called a
second time. This happened after the server-side TLS engine
sent a TLSv1.3 HelloRetryRequest (HRR) to a remote SMTP
client. Reported by Ján Máté, fixed by Viktor Dukhovni.
File: tls/tls_misc.c.

View File

@ -219,7 +219,7 @@ create|import)
# and drop from alternate_config_directories
#
# XXX: Must happen before set-permissions below, otherwise instance
# is treated as a non-slave instance by post-install via postfix(1).
# is treated as an independent instance by post-install via postfix(1).
#
update_cfdirs del $config_directory || exit 1
@ -227,7 +227,7 @@ create|import)
# queue_directory and data_directory, ...
#
# XXX: Must happen after instance list updates above, otherwise instance
# is treated as a non-slave instance by post-install via postfix(1).
# is treated as an independent instance by post-install via postfix(1).
#
postfix -c $config_directory set-permissions || exit 1
;;

View File

@ -15,41 +15,41 @@ MASTER(5) MASTER(5)
services that run in the background.
Postfix services are implemented by daemon processes. These run in the
background under control of the <a href="master.8.html"><b>master</b>(8)</a> process. The <a href="master.5.html">master.cf</a> con-
figuration file defines how a client program connects to a service, and
what daemon program runs when a service is requested. Most daemon pro-
cesses are short-lived and terminate voluntarily after serving <b><a href="postconf.5.html#max_use">max_use</a></b>
clients, or after inactivity for <b><a href="postconf.5.html#max_idle">max_idle</a></b> or more units of time.
background, started on-demand by the <a href="master.8.html"><b>master</b>(8)</a> process. The <a href="master.5.html">master.cf</a>
configuration file defines how a client program connects to a service,
and what daemon program runs when a service is requested. Most daemon
processes are short-lived and terminate voluntarily after serving
<b><a href="postconf.5.html#max_use">max_use</a></b> clients, or after inactivity for <b><a href="postconf.5.html#max_idle">max_idle</a></b> or more units of
time.
All daemons specified here must speak a Postfix-internal protocol. In
order to execute non-Postfix software use the <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a> or
<a href="spawn.8.html"><b>spawn</b>(8)</a> services, or run the server under control by <b>inetd</b>(8) or
equivalent.
All daemons specified here must speak a Postfix-internal protocol. In
order to execute non-Postfix software use the <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a> or
<a href="spawn.8.html"><b>spawn</b>(8)</a> services, or execute the software with <b>inetd</b>(8) or equivalent.
After changing <a href="master.5.html">master.cf</a> you must execute "<b>postfix reload</b>" to reload
After changing <a href="master.5.html">master.cf</a> you must execute "<b>postfix reload</b>" to reload
the configuration.
<b>SYNTAX</b>
The general format of the <a href="master.5.html">master.cf</a> file is as follows:
<b>o</b> Empty lines and whitespace-only lines are ignored, as are lines
<b>o</b> Empty lines and whitespace-only lines are ignored, as are lines
whose first non-whitespace character is a `#'.
<b>o</b> A logical line starts with non-whitespace text. A line that
<b>o</b> A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.
<b>o</b> Each logical line defines a single Postfix service. Each ser-
vice is identified by its name and type as described below.
<b>o</b> Each logical line defines a single Postfix service. Each ser-
vice is identified by its name and type as described below.
When multiple lines specify the same service name and type, only
the last one is remembered. Otherwise, the order of <a href="master.5.html">master.cf</a>
the last one is remembered. Otherwise, the order of <a href="master.5.html">master.cf</a>
service definitions does not matter.
Each logical line consists of eight fields separated by whitespace.
These are described below in the order as they appear in the <a href="master.5.html">master.cf</a>
Each logical line consists of eight fields separated by whitespace.
These are described below in the order as they appear in the <a href="master.5.html">master.cf</a>
file.
Where applicable a field of "-" requests that the built-in default
value be used. For boolean fields specify "y" or "n" to override the
Where applicable a field of "-" requests that the built-in default
value be used. For boolean fields specify "y" or "n" to override the
default value.
<b>Service name</b>
@ -59,70 +59,70 @@ MASTER(5) MASTER(5)
<b>Service type</b>
Specify one of the following service types:
<b>inet</b> The service listens on a TCP/IP socket and is accessible
<b>inet</b> The service listens on a TCP/IP socket and is accessible
via the network.
The service name is specified as <i>host:port</i>, denoting the
host and port on which new connections should be
accepted. The host part (and colon) may be omitted.
Either host or port may be given in symbolic form (see
<b>hosts</b>(5) or <b>services</b>(5)) or in numeric form (IP address
The service name is specified as <i>host:port</i>, denoting the
host and port on which new connections should be
accepted. The host part (and colon) may be omitted.
Either host or port may be given in symbolic form (see
<b>hosts</b>(5) or <b>services</b>(5)) or in numeric form (IP address
or port number). Host information may be enclosed inside
"[]"; this form is necessary only with IPv6 addresses.
Examples: a service named <b>127.0.0.1:smtp</b> or <b>::1:smtp</b>
Examples: a service named <b>127.0.0.1:smtp</b> or <b>::1:smtp</b>
receives mail via the loopback interface only; and a ser-
vice named <b>10025</b> accepts connections on TCP port 10025
via all interfaces configured with the <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b>
vice named <b>10025</b> accepts connections on TCP port 10025
via all interfaces configured with the <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b>
parameter.
Note: with Postfix version 2.2 and later specify
"<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = loopback-only</b>" in <a href="postconf.5.html">main.cf</a>, instead of
hard-coding loopback IP address information in <a href="master.5.html">master.cf</a>
Note: with Postfix version 2.2 and later specify
"<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = loopback-only</b>" in <a href="postconf.5.html">main.cf</a>, instead of
hard-coding loopback IP address information in <a href="master.5.html">master.cf</a>
or in <a href="postconf.5.html">main.cf</a>.
<b>unix</b> The service listens on a UNIX-domain stream socket and is
accessible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
<b><a href="postconf.5.html#queue_directory">queue_directory</a></b> configuration parameter in <a href="postconf.5.html">main.cf</a>).
On Solaris 8 and earlier systems the <b>unix</b> type is imple-
On Solaris 8 and earlier systems the <b>unix</b> type is imple-
mented with streams sockets.
<b>unix-dgram</b>
The service listens on a UNIX-domain datagram socket and
The service listens on a UNIX-domain datagram socket and
is accessible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
<b><a href="postconf.5.html#queue_directory">queue_directory</a></b> configuration parameter in <a href="postconf.5.html">main.cf</a>).
<b>fifo</b> (obsolete)
The service listens on a FIFO (named pipe) and is acces-
sible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
<b><a href="postconf.5.html#queue_directory">queue_directory</a></b> configuration parameter in <a href="postconf.5.html">main.cf</a>).
<b>pass</b> The service listens on a UNIX-domain stream socket, and
is accessible to local clients only. It receives one open
connection (file descriptor passing) per connection
request.
<b>fifo</b> (obsolete)
The service listens on a FIFO (named pipe) and is acces-
sible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
<b><a href="postconf.5.html#queue_directory">queue_directory</a></b> configuration parameter in <a href="postconf.5.html">main.cf</a>).
On Solaris 8 and earlier systems the <b>pass</b> type is imple-
<b>pass</b> The service listens on a UNIX-domain stream socket, and
is accessible to local clients only. It receives one open
connection (file descriptor passing) per connection
request.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
<b><a href="postconf.5.html#queue_directory">queue_directory</a></b> configuration parameter in <a href="postconf.5.html">main.cf</a>).
On Solaris 8 and earlier systems the <b>pass</b> type is imple-
mented with streams sockets.
This feature is available as of Postfix version 2.5.
<b>Private (default: y)</b>
Whether or not access is restricted to the mail system. Inter-
Whether or not access is restricted to the mail system. Inter-
net (type <b>inet</b>) services can't be private.
<b>Unprivileged (default: y)</b>
@ -130,80 +130,80 @@ MASTER(5) MASTER(5)
the Postfix system (the owner name is controlled by the
<b><a href="postconf.5.html#mail_owner">mail_owner</a></b> configuration variable in the <a href="postconf.5.html">main.cf</a> file).
The <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a>, <a href="spawn.8.html"><b>spawn</b>(8)</a>, and <a href="virtual.8.html"><b>virtual</b>(8)</a> daemons require
The <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a>, <a href="spawn.8.html"><b>spawn</b>(8)</a>, and <a href="virtual.8.html"><b>virtual</b>(8)</a> daemons require
privileges.
<b>Chroot (default: Postfix</b> &gt;<b>= 3.0: n, Postfix</b> &lt;<b>3.0: y)</b>
Whether or not the service runs chrooted to the mail queue
Whether or not the service runs chrooted to the mail queue
directory (pathname is controlled by the <b><a href="postconf.5.html#queue_directory">queue_directory</a></b> config-
uration variable in the <a href="postconf.5.html">main.cf</a> file).
Chroot should not be used with the <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a>, <a href="spawn.8.html"><b>spawn</b>(8)</a>,
Chroot should not be used with the <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a>, <a href="spawn.8.html"><b>spawn</b>(8)</a>,
and <a href="virtual.8.html"><b>virtual</b>(8)</a> daemons. Although the <a href="proxymap.8.html"><b>proxymap</b>(8)</a> server can run
chrooted, doing so defeats most of the purpose of having that
chrooted, doing so defeats most of the purpose of having that
service in the first place.
The files in the examples/chroot-setup subdirectory of the Post-
fix source show how to set up a Postfix chroot environment on a
variety of systems. See also <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a> for
fix source show how to set up a Postfix chroot environment on a
variety of systems. See also <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a> for
issues related to running daemons chrooted.
<b>Wake up time (default: 0)</b>
Automatically wake up the named service after the specified num-
ber of seconds. The wake up is implemented by connecting to the
service and sending a wake up request. A ? at the end of the
wake-up time field requests that no wake up events be sent
ber of seconds. The wake up is implemented by connecting to the
service and sending a wake up request. A ? at the end of the
wake-up time field requests that no wake up events be sent
before the first time a service is used. Specify 0 for no auto-
matic wake up.
The <a href="pickup.8.html"><b>pickup</b>(8)</a>, <a href="qmgr.8.html"><b>qmgr</b>(8)</a> and <a href="flush.8.html"><b>flush</b>(8)</a> daemons require a wake up
The <a href="pickup.8.html"><b>pickup</b>(8)</a>, <a href="qmgr.8.html"><b>qmgr</b>(8)</a> and <a href="flush.8.html"><b>flush</b>(8)</a> daemons require a wake up
timer.
<b>Process limit (default: $<a href="postconf.5.html#default_process_limit">default_process_limit</a>)</b>
The maximum number of processes that may execute this service
The maximum number of processes that may execute this service
simultaneously. Specify 0 for no process count limit.
NOTE: Some Postfix services must be configured as a sin-
gle-process service (for example, <a href="qmgr.8.html"><b>qmgr</b>(8)</a>) and some services
must be configured with no process limit (for example,
NOTE: Some Postfix services must be configured as a sin-
gle-process service (for example, <a href="qmgr.8.html"><b>qmgr</b>(8)</a>) and some services
must be configured with no process limit (for example,
<a href="cleanup.8.html"><b>cleanup</b>(8)</a>). These limits must not be changed.
<b>Command name + arguments</b>
The command to be executed. Characters that are special to the
shell such as "&gt;" or "|" have no special meaning here, and
quotes cannot be used to protect arguments containing white-
space. To protect whitespace, use "{" and "}" as described
The command to be executed. Characters that are special to the
shell such as "&gt;" or "|" have no special meaning here, and
quotes cannot be used to protect arguments containing white-
space. To protect whitespace, use "{" and "}" as described
below.
The command name is relative to the Postfix daemon directory
(pathname is controlled by the <b><a href="postconf.5.html#daemon_directory">daemon_directory</a></b> configuration
The command name is relative to the Postfix daemon directory
(pathname is controlled by the <b><a href="postconf.5.html#daemon_directory">daemon_directory</a></b> configuration
variable).
The command argument syntax for specific commands is specified
The command argument syntax for specific commands is specified
in the respective daemon manual page.
The following command-line options have the same effect for all
The following command-line options have the same effect for all
daemon programs:
<b>-D</b> Run the daemon under control by the command specified
<b>-D</b> Run the daemon under control by the command specified
with the <b><a href="postconf.5.html#debugger_command">debugger_command</a></b> variable in the <a href="postconf.5.html">main.cf</a> config-
uration file. See <a href="DEBUG_README.html">DEBUG_README</a> for hints and tips.
<b>-o {</b> <i>name</i> = <i>value</i> <b>}</b> (long form, Postfix &gt;= 3.0)
<b>-o</b> <i>name</i>=<i>value</i> (short form)
Override the named <a href="postconf.5.html">main.cf</a> configuration parameter. The
parameter value can refer to other parameters as <i>$name</i>
etc., just like in <a href="postconf.5.html">main.cf</a>. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
Override the named <a href="postconf.5.html">main.cf</a> configuration parameter. The
parameter value can refer to other parameters as <i>$name</i>
etc., just like in <a href="postconf.5.html">main.cf</a>. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
NOTE 1: With the "long form" shown above, whitespace
after "{", around "=", and before "}" is ignored, and
NOTE 1: With the "long form" shown above, whitespace
after "{", around "=", and before "}" is ignored, and
whitespace within the parameter value is preserved.
NOTE 2: with the "short form" shown above, do not specify
whitespace around the "=" or in parameter values. To
specify a parameter value that contains whitespace, use
the long form described above, or use commas instead of
whitespace around the "=" or in parameter values. To
specify a parameter value that contains whitespace, use
the long form described above, or use commas instead of
spaces, or specify the value in <a href="postconf.5.html">main.cf</a>. Example:
/etc/postfix/<a href="master.5.html">master.cf</a>:
@ -214,18 +214,18 @@ MASTER(5) MASTER(5)
submission_xxx_yyy = text with whitespace...
NOTE 3: Over-zealous use of parameter overrides makes the
Postfix configuration hard to understand and maintain.
At a certain point, it might be easier to configure mul-
Postfix configuration hard to understand and maintain.
At a certain point, it might be easier to configure mul-
tiple instances of Postfix, instead of configuring multi-
ple personalities via <a href="master.5.html">master.cf</a>.
<b>-v</b> Increase the verbose logging level. Specify multiple <b>-v</b>
options to make a Postfix daemon process increasingly
<b>-v</b> Increase the verbose logging level. Specify multiple <b>-v</b>
options to make a Postfix daemon process increasingly
verbose.
Other command-line arguments
Specify "{" and "}" around command arguments that contain
whitespace (Postfix 3.0 and later). Whitespace after "{"
whitespace (Postfix 3.0 and later). Whitespace after "{"
and before "}" is ignored.
<b>SEE ALSO</b>

View File

@ -13,7 +13,7 @@ The Postfix mail system is implemented by small number of
a larger number of services that run in the background.
Postfix services are implemented by daemon processes. These
run in the background under control of the \fBmaster\fR(8)
run in the background, started on\-demand by the \fBmaster\fR(8)
process. The master.cf configuration file defines how a
client program connects to a service, and what daemon
program runs when a service is requested. Most daemon
@ -24,7 +24,7 @@ serving \fBmax_use\fR clients, or after inactivity for
All daemons specified here must speak a Postfix\-internal
protocol. In order to execute non\-Postfix software use the
\fBlocal\fR(8), \fBpipe\fR(8) or \fBspawn\fR(8) services, or
run the server under control by \fBinetd\fR(8) or equivalent.
execute the software with \fBinetd\fR(8) or equivalent.
.PP
After changing master.cf you must execute "\fBpostfix reload\fR"
to reload the configuration.

View File

@ -9,7 +9,7 @@
# a larger number of services that run in the background.
#
# Postfix services are implemented by daemon processes. These
# run in the background under control of the \fBmaster\fR(8)
# run in the background, started on-demand by the \fBmaster\fR(8)
# process. The master.cf configuration file defines how a
# client program connects to a service, and what daemon
# program runs when a service is requested. Most daemon
@ -20,7 +20,7 @@
# All daemons specified here must speak a Postfix-internal
# protocol. In order to execute non-Postfix software use the
# \fBlocal\fR(8), \fBpipe\fR(8) or \fBspawn\fR(8) services, or
# run the server under control by \fBinetd\fR(8) or equivalent.
# execute the software with \fBinetd\fR(8) or equivalent.
# .PP
# After changing master.cf you must execute "\fBpostfix reload\fR"
# to reload the configuration.

View File

@ -7,7 +7,7 @@
/* #include <dsb_scan.h>
/*
/* int dsb_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -45,7 +45,7 @@
/* dsb_scan - read DSN_BUF from stream */
int dsb_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int dsb_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
DSN_BUF *dsb = (DSN_BUF *) ptr;

View File

@ -25,7 +25,7 @@
/*
* External interface.
*/
extern int dsb_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int dsb_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
/* LICENSE
/* .ad

View File

@ -7,7 +7,7 @@
/* #include <dsn_print.h>
/*
/* int dsn_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -45,7 +45,7 @@
/* dsn_print - write DSN to stream */
int dsn_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int dsn_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
DSN *dsn = (DSN *) ptr;

View File

@ -25,7 +25,7 @@
/*
* External interface.
*/
extern int dsn_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int dsn_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
/* LICENSE
/* .ad

View File

@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
#define MAIL_RELEASE_DATE "20200531"
#define MAIL_RELEASE_DATE "20200610"
#define MAIL_VERSION_NUMBER "3.6"
#ifdef SNAPSHOT

View File

@ -82,8 +82,8 @@ typedef struct {
(st) \
)
extern int msg_stats_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int msg_stats_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int msg_stats_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
extern int msg_stats_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
/* LICENSE
/* .ad

View File

@ -7,7 +7,7 @@
/* #include <msg_stats.h>
/*
/* int msg_stats_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -46,7 +46,7 @@
/* msg_stats_print - write MSG_STATS to stream */
int msg_stats_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int msg_stats_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
int ret;

View File

@ -7,7 +7,7 @@
/* #include <msg_stats.h>
/*
/* int msg_stats_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -53,7 +53,7 @@
/* msg_stats_scan - read MSG_STATS from stream */
int msg_stats_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int msg_stats_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
MSG_STATS *stats = (MSG_STATS *) ptr;

View File

@ -29,7 +29,7 @@
/* RCPT_BUF *rcpb;
/*
/* int rcpb_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -115,7 +115,7 @@ void rcpb_free(RCPT_BUF *rcpt)
/* rcpb_scan - receive recipient buffer */
int rcpb_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int rcpb_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
RCPT_BUF *rcpt = (RCPT_BUF *) ptr;

View File

@ -38,7 +38,7 @@ typedef struct {
extern RCPT_BUF *rcpb_create(void);
extern void rcpb_reset(RCPT_BUF *);
extern void rcpb_free(RCPT_BUF *);
extern int rcpb_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int rcpb_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
#define RECIPIENT_FROM_RCPT_BUF(buf) \
((buf)->rcpt.address = vstring_str((buf)->address), \

View File

@ -7,7 +7,7 @@
/* #include <rcpt_print.h>
/*
/* int rcpt_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -48,7 +48,7 @@
/* rcpt_print - write recipient to stream */
int rcpt_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int rcpt_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
RECIPIENT *rcpt = (RECIPIENT *) ptr;

View File

@ -25,7 +25,7 @@
/*
* External interface.
*/
extern int rcpt_print(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int rcpt_print(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
/* LICENSE
/* .ad

View File

@ -79,8 +79,8 @@ extern MILTER_MACROS *milter_macros_create(const char *, const char *,
const char *, const char *);
extern MILTER_MACROS *milter_macros_alloc(int);
extern void milter_macros_free(MILTER_MACROS *);
extern int milter_macros_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int milter_macros_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int milter_macros_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int milter_macros_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
#define MILTER_MACROS_ALLOC_ZERO 1 /* null pointer */
#define MILTER_MACROS_ALLOC_EMPTY 2 /* mystrdup(""); */

View File

@ -26,13 +26,13 @@
/* MILTER_MACROS *mp;
/*
/* int milter_macros_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
/*
/* int milter_macros_scan(scan_fn, fp, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *fp;
/* int flags;
/* void *ptr;
@ -130,7 +130,7 @@
/* milter_macros_print - write macros structure to stream */
int milter_macros_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int milter_macros_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
MILTER_MACROS *mp = (MILTER_MACROS *) ptr;
@ -155,7 +155,7 @@ int milter_macros_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
/* milter_macros_scan - receive macros structure from stream */
int milter_macros_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int milter_macros_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
MILTER_MACROS *mp = (MILTER_MACROS *) ptr;

View File

@ -686,6 +686,27 @@ static int server_sni_callback(SSL *ssl, int *alert, void *arg)
TLScontext->namaddr, sni);
return SSL_TLSEXT_ERR_NOACK;
}
/*
* With TLS 1.3, when the client's proposed key share is not supported by
* the server, the server may issue a HelloRetryRequest (HRR), and the
* client will then retry with a new key share on a curve supported by
* the server. This results in the SNI callback running twice for the
* same connection.
*
* When that happens, The client MUST send the essentially the same hello
* message, including the SNI name, and since we've already loaded our
* certificate chain, we don't need to do it again! Therefore, if we've
* already recorded the peer SNI name, just check that it has not
* changed, and return success.
*/
if (TLScontext->peer_sni) {
if (strcmp(sni, TLScontext->peer_sni) == 0)
return SSL_TLSEXT_ERR_OK;
msg_warn("TLS SNI changed from %s initially %s, %s after hello retry",
TLScontext->namaddr, TLScontext->peer_sni, sni);
return SSL_TLSEXT_ERR_NOACK;
}
do {
/* Don't silently skip maps opened with the wrong flags. */
pem = maps_file_find(tls_server_sni_maps, cp, 0);

View File

@ -79,9 +79,9 @@ typedef struct TLS_CLIENT_PARAMS {
extern TLS_CLIENT_PARAMS *tls_proxy_client_param_from_config(TLS_CLIENT_PARAMS *);
extern char *tls_proxy_client_param_to_string(VSTRING *, TLS_CLIENT_PARAMS *);
extern char *tls_proxy_client_param_with_names_to_string(VSTRING *, TLS_CLIENT_PARAMS *);
extern int tls_proxy_client_param_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_param_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern void tls_proxy_client_param_free(TLS_CLIENT_PARAMS *);
extern int tls_proxy_client_param_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_param_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
/*
* Functions that handle TLS_XXX_INIT_PROPS and TLS_XXX_START_PROPS. These
@ -114,25 +114,25 @@ extern VSTREAM *tls_proxy_open(const char *, int, VSTREAM *, const char *,
extern TLS_SESS_STATE *tls_proxy_context_receive(VSTREAM *);
extern void tls_proxy_context_free(TLS_SESS_STATE *);
extern int tls_proxy_context_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_context_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_context_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int tls_proxy_context_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_init_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_init_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_init_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_init_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
extern void tls_proxy_client_init_free(TLS_CLIENT_INIT_PROPS *);
extern char *tls_proxy_client_init_to_string(VSTRING *, TLS_CLIENT_INIT_PROPS *);
extern char *tls_proxy_client_init_with_names_to_string(VSTRING *, TLS_CLIENT_INIT_PROPS *);
extern int tls_proxy_client_start_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_start_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_start_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int tls_proxy_client_start_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
extern void tls_proxy_client_start_free(TLS_CLIENT_START_PROPS *);
extern int tls_proxy_server_init_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_server_init_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_server_init_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int tls_proxy_server_init_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
extern void tls_proxy_server_init_free(TLS_SERVER_INIT_PROPS *);
extern int tls_proxy_server_start_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_server_start_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int tls_proxy_server_start_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int tls_proxy_server_start_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
extern void tls_proxy_server_start_free(TLS_SERVER_START_PROPS *);

View File

@ -7,19 +7,19 @@
/* #include <tls_proxy.h>
/*
/* int tls_proxy_client_param_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
/*
/* int tls_proxy_client_init_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
/*
/* int tls_proxy_client_start_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -85,7 +85,7 @@
/* tls_proxy_client_param_print - send TLS_CLIENT_PARAMS over stream */
int tls_proxy_client_param_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int tls_proxy_client_param_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_CLIENT_PARAMS *params = (TLS_CLIENT_PARAMS *) ptr;
@ -134,7 +134,7 @@ int tls_proxy_client_param_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
/* tls_proxy_client_init_print - send TLS_CLIENT_INIT_PROPS over stream */
int tls_proxy_client_init_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int tls_proxy_client_init_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_CLIENT_INIT_PROPS *props = (TLS_CLIENT_INIT_PROPS *) ptr;
@ -182,7 +182,7 @@ int tls_proxy_client_init_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
/* tls_proxy_client_certs_print - send x509 certificates over stream */
static int tls_proxy_client_certs_print(ATTR_PRINT_MASTER_FN print_fn,
static int tls_proxy_client_certs_print(ATTR_PRINT_COMMON_FN print_fn,
VSTREAM *fp, int flags, void *ptr)
{
TLS_CERTS *tls_certs = (TLS_CERTS *) ptr;
@ -227,7 +227,7 @@ static int tls_proxy_client_certs_print(ATTR_PRINT_MASTER_FN print_fn,
/* tls_proxy_client_pkeys_print - send public keys over stream */
static int tls_proxy_client_pkeys_print(ATTR_PRINT_MASTER_FN print_fn,
static int tls_proxy_client_pkeys_print(ATTR_PRINT_COMMON_FN print_fn,
VSTREAM *fp, int flags, void *ptr)
{
TLS_PKEYS *tls_pkeys = (TLS_PKEYS *) ptr;
@ -272,7 +272,7 @@ static int tls_proxy_client_pkeys_print(ATTR_PRINT_MASTER_FN print_fn,
/* tls_proxy_client_tlsa_print - send TLS_TLSA over stream */
static int tls_proxy_client_tlsa_print(ATTR_PRINT_MASTER_FN print_fn,
static int tls_proxy_client_tlsa_print(ATTR_PRINT_COMMON_FN print_fn,
VSTREAM *fp, int flags, void *ptr)
{
TLS_TLSA *tls_tlsa = (TLS_TLSA *) ptr;
@ -310,7 +310,7 @@ static int tls_proxy_client_tlsa_print(ATTR_PRINT_MASTER_FN print_fn,
/* tls_proxy_client_dane_print - send TLS_DANE over stream */
static int tls_proxy_client_dane_print(ATTR_PRINT_MASTER_FN print_fn,
static int tls_proxy_client_dane_print(ATTR_PRINT_COMMON_FN print_fn,
VSTREAM *fp, int flags, void *ptr)
{
TLS_DANE *dane = (TLS_DANE *) ptr;
@ -346,7 +346,7 @@ static int tls_proxy_client_dane_print(ATTR_PRINT_MASTER_FN print_fn,
/* tls_proxy_client_start_print - send TLS_CLIENT_START_PROPS over stream */
int tls_proxy_client_start_print(ATTR_PRINT_MASTER_FN print_fn,
int tls_proxy_client_start_print(ATTR_PRINT_COMMON_FN print_fn,
VSTREAM *fp, int flags, void *ptr)
{
TLS_CLIENT_START_PROPS *props = (TLS_CLIENT_START_PROPS *) ptr;

View File

@ -7,7 +7,7 @@
/* #include <tls_proxy.h>
/*
/* int tls_proxy_client_param_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -16,7 +16,7 @@
/* TLS_CLIENT_PARAMS *params;
/*
/* int tls_proxy_client_init_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -25,7 +25,7 @@
/* TLS_CLIENT_INIT_PROPS *init_props;
/*
/* int tls_proxy_client_start_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -138,7 +138,7 @@ void tls_proxy_client_param_free(TLS_CLIENT_PARAMS *params)
/* tls_proxy_client_param_scan - receive TLS_CLIENT_PARAMS from stream */
int tls_proxy_client_param_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int tls_proxy_client_param_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_CLIENT_PARAMS *params
@ -238,7 +238,7 @@ void tls_proxy_client_init_free(TLS_CLIENT_INIT_PROPS *props)
/* tls_proxy_client_init_scan - receive TLS_CLIENT_INIT_PROPS from stream */
int tls_proxy_client_init_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int tls_proxy_client_init_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_CLIENT_INIT_PROPS *props
@ -382,7 +382,7 @@ void tls_proxy_client_start_free(TLS_CLIENT_START_PROPS *props)
/* tls_proxy_client_certs_scan - receive TLS_CERTS from stream */
static int tls_proxy_client_certs_scan(ATTR_SCAN_MASTER_FN scan_fn,
static int tls_proxy_client_certs_scan(ATTR_SCAN_COMMON_FN scan_fn,
VSTREAM *fp, int flags, void *ptr)
{
int ret;
@ -441,7 +441,7 @@ static int tls_proxy_client_certs_scan(ATTR_SCAN_MASTER_FN scan_fn,
/* tls_proxy_client_pkeys_scan - receive TLS_PKEYS from stream */
static int tls_proxy_client_pkeys_scan(ATTR_SCAN_MASTER_FN scan_fn,
static int tls_proxy_client_pkeys_scan(ATTR_SCAN_COMMON_FN scan_fn,
VSTREAM *fp, int flags, void *ptr)
{
int ret;
@ -500,7 +500,7 @@ static int tls_proxy_client_pkeys_scan(ATTR_SCAN_MASTER_FN scan_fn,
/* tls_proxy_client_tlsa_scan - receive TLS_TLSA from stream */
static int tls_proxy_client_tlsa_scan(ATTR_SCAN_MASTER_FN scan_fn,
static int tls_proxy_client_tlsa_scan(ATTR_SCAN_COMMON_FN scan_fn,
VSTREAM *fp, int flags, void *ptr)
{
int ret;
@ -549,7 +549,7 @@ static int tls_proxy_client_tlsa_scan(ATTR_SCAN_MASTER_FN scan_fn,
/* tls_proxy_client_dane_scan - receive TLS_DANE from stream */
static int tls_proxy_client_dane_scan(ATTR_SCAN_MASTER_FN scan_fn,
static int tls_proxy_client_dane_scan(ATTR_SCAN_COMMON_FN scan_fn,
VSTREAM *fp, int flags, void *ptr)
{
TLS_DANE *dane = 0;
@ -610,7 +610,7 @@ static int tls_proxy_client_dane_scan(ATTR_SCAN_MASTER_FN scan_fn,
/* tls_proxy_client_start_scan - receive TLS_CLIENT_START_PROPS from stream */
int tls_proxy_client_start_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int tls_proxy_client_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_CLIENT_START_PROPS *props

View File

@ -7,7 +7,7 @@
/* #include <tls_proxy.h>
/*
/* int tls_proxy_context_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -53,7 +53,7 @@
/* tls_proxy_context_print - send TLS session state over stream */
int tls_proxy_context_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int tls_proxy_context_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_SESS_STATE *tp = (TLS_SESS_STATE *) ptr;

View File

@ -7,7 +7,7 @@
/* #include <tls_proxy.h>
/*
/* int tls_proxy_context_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -66,7 +66,7 @@
/* tls_proxy_context_scan - receive TLS session state from stream */
int tls_proxy_context_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int tls_proxy_context_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_SESS_STATE *tls_context

View File

@ -7,13 +7,13 @@
/* #include <tls_proxy.h>
/*
/* int tls_proxy_server_init_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
/*
/* int tls_proxy_server_start_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -61,7 +61,7 @@
/* tls_proxy_server_init_print - send TLS_SERVER_INIT_PROPS over stream */
int tls_proxy_server_init_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int tls_proxy_server_init_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_SERVER_INIT_PROPS *props = (TLS_SERVER_INIT_PROPS *) ptr;
@ -114,7 +114,7 @@ int tls_proxy_server_init_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
/* tls_proxy_server_start_print - send TLS_SERVER_START_PROPS over stream */
int tls_proxy_server_start_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int tls_proxy_server_start_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_SERVER_START_PROPS *props = (TLS_SERVER_START_PROPS *) ptr;

View File

@ -7,7 +7,7 @@
/* #include <tls_proxy.h>
/*
/* int tls_proxy_server_init_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -16,7 +16,7 @@
/* TLS_SERVER_INIT_PROPS *init_props;
/*
/* int tls_proxy_server_start_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -83,7 +83,7 @@
/* tls_proxy_server_init_scan - receive TLS_SERVER_INIT_PROPS from stream */
int tls_proxy_server_init_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int tls_proxy_server_init_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_SERVER_INIT_PROPS *props
@ -186,7 +186,7 @@ void tls_proxy_server_init_free(TLS_SERVER_INIT_PROPS *props)
/* tls_proxy_server_start_scan - receive TLS_SERVER_START_PROPS from stream */
int tls_proxy_server_start_scan(ATTR_SCAN_MASTER_FN scan_fn, VSTREAM *fp,
int tls_proxy_server_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
TLS_SERVER_START_PROPS *props

View File

@ -26,8 +26,8 @@
#define ARGV_ATTR_VALUE "argv_value"
#define ARGV_ATTR_MAX 1024
extern int argv_attr_print(ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
extern int argv_attr_scan(ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
extern int argv_attr_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
extern int argv_attr_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
/* LICENSE
/* .ad

View File

@ -7,7 +7,7 @@
/* #include <argv_attr.h>
/*
/* int argv_attr_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* ATTR_PRINT_COMMON_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -49,7 +49,7 @@
/* argv_attr_print - write ARGV to stream */
int argv_attr_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int argv_attr_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
ARGV *argv = (ARGV *) ptr;

View File

@ -7,7 +7,7 @@
/* #include <argv_attr.h>
/*
/* int argv_attr_scan(scan_fn, stream, flags, ptr)
/* ATTR_SCAN_MASTER_FN scan_fn;
/* ATTR_SCAN_COMMON_FN scan_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
@ -56,7 +56,7 @@
/* argv_attr_scan - write ARGV to stream */
int argv_attr_scan(ATTR_PRINT_MASTER_FN scan_fn, VSTREAM *fp,
int argv_attr_scan(ATTR_PRINT_COMMON_FN scan_fn, VSTREAM *fp,
int flags, void *ptr)
{
ARGV *argv = 0;

View File

@ -28,10 +28,10 @@
/*
* Delegation for better data abstraction.
*/
typedef int (*ATTR_SCAN_MASTER_FN) (VSTREAM *, int,...);
typedef int (*ATTR_SCAN_SLAVE_FN) (ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
typedef int (*ATTR_PRINT_MASTER_FN) (VSTREAM *, int,...);
typedef int (*ATTR_PRINT_SLAVE_FN) (ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
typedef int (*ATTR_SCAN_COMMON_FN) (VSTREAM *, int,...);
typedef int (*ATTR_SCAN_CUSTOM_FN) (ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
typedef int (*ATTR_PRINT_COMMON_FN) (VSTREAM *, int,...);
typedef int (*ATTR_PRINT_CUSTOM_FN) (ATTR_PRINT_COMMON_FN, VSTREAM *, int, void *);
/*
* Attribute types. See attr_scan(3) for documentation.
@ -66,7 +66,7 @@ typedef int (*ATTR_PRINT_SLAVE_FN) (ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *
#define SEND_ATTR_NV(val) ATTR_TYPE_NV, CHECK_CPTR(ATTR, NVTABLE, (val))
#define SEND_ATTR_LONG(name, val) ATTR_TYPE_LONG, CHECK_CPTR(ATTR, char, (name)), CHECK_VAL(ATTR, long, (val))
#define SEND_ATTR_DATA(name, len, val) ATTR_TYPE_DATA, CHECK_CPTR(ATTR, char, (name)), CHECK_VAL(ATTR, ssize_t, (len)), CHECK_CPTR(ATTR, void, (val))
#define SEND_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, CHECK_VAL(ATTR, ATTR_PRINT_SLAVE_FN, (func)), CHECK_CPTR(ATTR, void, (val))
#define SEND_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, CHECK_VAL(ATTR, ATTR_PRINT_CUSTOM_FN, (func)), CHECK_CPTR(ATTR, void, (val))
#define RECV_ATTR_INT(name, val) ATTR_TYPE_INT, CHECK_CPTR(ATTR, char, (name)), CHECK_PTR(ATTR, int, (val))
#define RECV_ATTR_STR(name, val) ATTR_TYPE_STR, CHECK_CPTR(ATTR, char, (name)), CHECK_PTR(ATTR, VSTRING, (val))
@ -74,7 +74,7 @@ typedef int (*ATTR_PRINT_SLAVE_FN) (ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *
#define RECV_ATTR_NV(val) ATTR_TYPE_NV, CHECK_PTR(ATTR, NVTABLE, (val))
#define RECV_ATTR_LONG(name, val) ATTR_TYPE_LONG, CHECK_CPTR(ATTR, char, (name)), CHECK_PTR(ATTR, long, (val))
#define RECV_ATTR_DATA(name, val) ATTR_TYPE_DATA, CHECK_CPTR(ATTR, char, (name)), CHECK_PTR(ATTR, VSTRING, (val))
#define RECV_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, CHECK_VAL(ATTR, ATTR_SCAN_SLAVE_FN, (func)), CHECK_PTR(ATTR, void, (val))
#define RECV_ATTR_FUNC(func, val) ATTR_TYPE_FUNC, CHECK_VAL(ATTR, ATTR_SCAN_CUSTOM_FN, (func)), CHECK_PTR(ATTR, void, (val))
CHECK_VAL_HELPER_DCL(ATTR, ssize_t);
CHECK_VAL_HELPER_DCL(ATTR, long);
@ -89,8 +89,8 @@ CHECK_CPTR_HELPER_DCL(ATTR, void);
CHECK_CPTR_HELPER_DCL(ATTR, char);
CHECK_CPTR_HELPER_DCL(ATTR, NVTABLE);
CHECK_CPTR_HELPER_DCL(ATTR, HTABLE);
CHECK_VAL_HELPER_DCL(ATTR, ATTR_PRINT_SLAVE_FN);
CHECK_VAL_HELPER_DCL(ATTR, ATTR_SCAN_SLAVE_FN);
CHECK_VAL_HELPER_DCL(ATTR, ATTR_PRINT_CUSTOM_FN);
CHECK_VAL_HELPER_DCL(ATTR, ATTR_SCAN_CUSTOM_FN);
/*
* Flags that control processing. See attr_scan(3) for documentation.

View File

@ -53,7 +53,7 @@
/* .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)"
/* .IP "SEND_ATTR_FUNC(ATTR_PRINT_CUSTOM_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.
@ -119,7 +119,7 @@ int attr_vprint0(VSTREAM *fp, int flags, va_list ap)
HTABLE_INFO **ht;
ssize_t len_val;
static VSTRING *base64_buf;
ATTR_PRINT_SLAVE_FN print_fn;
ATTR_PRINT_CUSTOM_FN print_fn;
void *print_arg;
/*
@ -174,7 +174,7 @@ int attr_vprint0(VSTREAM *fp, int flags, va_list ap)
attr_name, (long) len_val);
break;
case ATTR_TYPE_FUNC:
print_fn = va_arg(ap, ATTR_PRINT_SLAVE_FN);
print_fn = va_arg(ap, ATTR_PRINT_CUSTOM_FN);
print_arg = va_arg(ap, void *);
print_fn(attr_print0, fp, flags | ATTR_FLAG_MORE, print_arg);
break;

View File

@ -53,7 +53,7 @@
/* .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)"
/* .IP "SEND_ATTR_FUNC(ATTR_PRINT_CUSTOM_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.
@ -153,7 +153,7 @@ int attr_vprint64(VSTREAM *fp, int flags, va_list ap)
HTABLE_INFO **ht_info_list;
HTABLE_INFO **ht;
ssize_t len_val;
ATTR_PRINT_SLAVE_FN print_fn;
ATTR_PRINT_CUSTOM_FN print_fn;
void *print_arg;
/*
@ -211,7 +211,7 @@ int attr_vprint64(VSTREAM *fp, int flags, va_list ap)
attr_name, (long) len_val);
break;
case ATTR_TYPE_FUNC:
print_fn = va_arg(ap, ATTR_PRINT_SLAVE_FN);
print_fn = va_arg(ap, ATTR_PRINT_CUSTOM_FN);
print_arg = va_arg(ap, void *);
print_fn(attr_print64, fp, flags | ATTR_FLAG_MORE, print_arg);
break;

View File

@ -53,7 +53,7 @@
/* .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)"
/* .IP "SEND_ATTR_FUNC(ATTR_PRINT_CUSTOM_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.
@ -120,7 +120,7 @@ int attr_vprint_plain(VSTREAM *fp, int flags, va_list ap)
HTABLE_INFO **ht;
static VSTRING *base64_buf;
ssize_t len_val;
ATTR_PRINT_SLAVE_FN print_fn;
ATTR_PRINT_CUSTOM_FN print_fn;
void *print_arg;
/*
@ -169,7 +169,7 @@ int attr_vprint_plain(VSTREAM *fp, int flags, va_list ap)
attr_name, (long) len_val);
break;
case ATTR_TYPE_FUNC:
print_fn = va_arg(ap, ATTR_PRINT_SLAVE_FN);
print_fn = va_arg(ap, ATTR_PRINT_CUSTOM_FN);
print_arg = va_arg(ap, void *);
print_fn(attr_print_plain, fp, flags | ATTR_FLAG_MORE, print_arg);
break;

View File

@ -102,7 +102,7 @@
/* This argument is followed by an attribute name and a VSTRING pointer.
/* .IP "RECV_ATTR_DATA(const char *name, VSTRING *vp)"
/* This argument is followed by an attribute name and a VSTRING pointer.
/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_SLAVE_FN, void *data)"
/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_CUSTOM_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.
@ -276,7 +276,7 @@ int attr_vscan0(VSTREAM *fp, int flags, va_list ap)
HTABLE *hash_table;
int ch;
int conversions;
ATTR_SCAN_SLAVE_FN scan_fn;
ATTR_SCAN_CUSTOM_FN scan_fn;
void *scan_arg;
/*
@ -416,7 +416,7 @@ int attr_vscan0(VSTREAM *fp, int flags, va_list ap)
return (-1);
break;
case ATTR_TYPE_FUNC:
scan_fn = va_arg(ap, ATTR_SCAN_SLAVE_FN);
scan_fn = va_arg(ap, ATTR_SCAN_CUSTOM_FN);
scan_arg = va_arg(ap, void *);
if (scan_fn(attr_scan0, fp, flags | ATTR_FLAG_MORE, scan_arg) < 0)
return (-1);

View File

@ -104,7 +104,7 @@
/* This argument is followed by an attribute name and a VSTRING pointer.
/* .IP "RECV_ATTR_DATA(const char *name, VSTRING *vp)"
/* This argument is followed by an attribute name and a VSTRING pointer.
/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_SLAVE_FN, void *data)"
/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_CUSTOM_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.
@ -279,7 +279,7 @@ int attr_vscan64(VSTREAM *fp, int flags, va_list ap)
HTABLE *hash_table;
int ch;
int conversions;
ATTR_SCAN_SLAVE_FN scan_fn;
ATTR_SCAN_CUSTOM_FN scan_fn;
void *scan_arg;
/*
@ -465,7 +465,7 @@ int attr_vscan64(VSTREAM *fp, int flags, va_list ap)
}
break;
case ATTR_TYPE_FUNC:
scan_fn = va_arg(ap, ATTR_SCAN_SLAVE_FN);
scan_fn = va_arg(ap, ATTR_SCAN_CUSTOM_FN);
scan_arg = va_arg(ap, void *);
if (scan_fn(attr_scan64, fp, flags | ATTR_FLAG_MORE, scan_arg) < 0)
return (-1);

View File

@ -102,7 +102,7 @@
/* This argument is followed by an attribute name and a VSTRING pointer.
/* .IP "RECV_ATTR_DATA(const char *name, VSTRING *vp)"
/* This argument is followed by an attribute name and a VSTRING pointer.
/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_SLAVE_FN, void *data)"
/* .IP "RECV_ATTR_FUNC(ATTR_SCAN_CUSTOM_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.
@ -292,7 +292,7 @@ int attr_vscan_plain(VSTREAM *fp, int flags, va_list ap)
HTABLE *hash_table;
int ch;
int conversions;
ATTR_SCAN_SLAVE_FN scan_fn;
ATTR_SCAN_CUSTOM_FN scan_fn;
void *scan_arg;
/*
@ -453,7 +453,7 @@ int attr_vscan_plain(VSTREAM *fp, int flags, va_list ap)
return (-1);
break;
case ATTR_TYPE_FUNC:
scan_fn = va_arg(ap, ATTR_SCAN_SLAVE_FN);
scan_fn = va_arg(ap, ATTR_SCAN_CUSTOM_FN);
scan_arg = va_arg(ap, void *);
if (scan_fn(attr_scan_plain, fp, flags | ATTR_FLAG_MORE, scan_arg) < 0)
return (-1);