sendmail -qtime ignored
sendmail -v yes (sends delivery report via email)
sendmail.cf no (uses table-driven address rewriting)
+session caching yes (SMTP shared multi-session; LMTP non-shared single-session)
size option yes, server and client
smarthost yes (specify relayhost in main.cf)
spf yes (delegated policy script)
seconds (default: 600s), as well as upon process exit.
File: scache/scache.c.
+20040722
+
+ Workaround: LINUX 2.4 has trouble with mixed data and file
+ descriptor traffic on UNIX-domain stream sockets.
+ Specifically, it cannot handle data write (read) followed
+ by file descriptor send (receive): the receiver hangs in
+ recvmsg(). Workaround is to insert an intervening read
+ (write) operation. Presumably, LINUX 2.4 is confusing the
+ data and file descriptor. Lucky Ralf Hildebrandt. Files:
+ util/sys_defs.h, global/scache_clnt,c, scache/scache.c.
+
+20040723
+
+ Bug? Safety? spawn(8) did not reject a user with the -1
+ UID value, so the command was running as root. Files:
+ util/spawn_command.c, src/util/spawn.c.
+
+ User interface: parameter smtp_connection_cache_domains
+ renamed to smtp_connection_cache_destinations. Destinations
+ listed here must be specified without [] or :port. File:
+ smtp/smtp_connect.c.
+
+ Bugfix: "421 Timeout exceeded" wasn't guarded by setjmp().
+ Victor Duchovni, Morgan Stanley. File: smtpd/smtpd.c.
+
Open problems:
Low: update events.c so that 1-second timer requests do
and change the patchlevel and the release date. Patches are never
issued for snapshot releases.
+Incompatible changes with snapshot Postfix-2.2-20040723
+=======================================================
+
+Session caching is enabled with smtp_session_cache_destinations,
+and requires "bare" domain names without "[]" or TCP port. This
+eliminates a syntax conflict between host:port and maptype:mapname,
+and simplifies the user interface, at the cost of a minor loss of
+control over what sessions are cached.
+
Major changes with snapshot Postfix-2.2-20040721
================================================
The session cache manager now logs cache hit and miss statistics
every $session_cache_status_update_time seconds (default: 600s).
It reports the hit and miss rates for lookups by domain, as well
-as for lookups by network address.
+as for lookups by network address.
+
+Hit rates for cache lookups by domain will tell you how useful
+session caching is.
+
+Cache lookups by network address will always fail, unless you're
+sending mail to different domains that share the same MX host.
Incompatible changes with snapshot Postfix-2.2-20040720
=======================================================
*** You need to execute "postfix stop" when upgrading from Postfix
*** version 2.0 or earlier. Execute "postfix start" when done.
-Session caching is enabled with the new smtp_connection_cache_domains
+Session caching is enabled with the new smtp_connection_cache_destinations
parameter. Specify a list of destinations or lookup tables:
-- a domain name (the right-hand side of an email address),
+- if mail is sent without relay host: a domain (the right-hand side
+of an email address),
-- a relay host (including optional [] and/or non-default TCP port),
-using the exact same spelling as in main.cf or in the transport map,
+- if mail is sent via a relay host, the relay host (without [],
+and without non-default TCP port) that is specified in main.cf or
+in the transport map,
- a /file/name with domains and/or relay hosts,
The following optimizes deliveries to hosts that your machine relays
mail to:
- smtp_connection_cache_domains = $relay_domains $relayhost
+ smtp_connection_cache_destinations = $relay_domains $relayhost
A setting that tries to optimize deliveries to problem sites:
- smtp_connection_cache_domains = hotmail.com...
+ smtp_connection_cache_destinations = hotmail.com...
Cached SMTP sessions are allowed to remain unused for only a limited
amount of time (smtp_connection_cache_time_limit, default: 2
</DD>
-<DT><b><a name="smtp_connection_cache_domains">smtp_connection_cache_domains</a>
+<DT><b><a name="smtp_connection_cache_destinations">smtp_connection_cache_destinations</a>
(default: empty)</b></DT><DD>
<p> The SMTP destinations for which SMTP connection caching is
<ul>
-<li> a domain name (the right-hand side of an email address),
+<li> if mail is sent without a relay host: a domain name (the
+right-hand side of an email address, without the optional []),
-<li> a relay host (including optional [] and/or non-default TCP
-port), using the exact same spelling as in main.cf or in the
-transport map,
+<li> if mail is sent via a relay host: a relay host (without the
+optional [] or non-default TCP port), as specified in main.cf or
+in the transport map,
<li> a /file/name with domains and/or relay hosts,
<b>scache</b> [generic Postfix daemon options]
<b>DESCRIPTION</b>
- The scache server maintains the Postfix session cache.
- This information can be used by, for example, the Postfix
- SMTP client.
+ The <b>scache</b> server maintains a shared multi-session cache.
+ This information can be used by, for example, Postfix SMTP
+ clients or other Postfix delivery agents.
The session cache is organized into logical destination
names, physical endpoint names, and sessions.
Save the specified file descriptor and session
property data under the specified endpoint name.
The endpoint properties are used by the client to
- re-activate a passivated session object. queue ID
- is queued for the specified destination.
+ re-activate a passivated session object.
<b>find_endp</b> <i>endpoint</i>
- Look up cached properties and a cached file
+ Look up cached properties and a cached file
descriptor for the specified endpoint.
<b>save_dest</b> <i>ttl destination destination</i><b>_</b><i>properties endpoint</i>
- Save the binding between a logical destination and
- an endpoint under the destination name, together
- with destination specific session properties. The
- destination properties are used by the client to
+ Save the binding between a logical destination and
+ an endpoint under the destination name, together
+ with destination specific session properties. The
+ destination properties are used by the client to
re-activate a passivated session object.
<b>find_dest</b> <i>destination</i>
- Look up cached destination properties, cached end-
- point properties, and a cached file descriptor for
+ Look up cached destination properties, cached end-
+ point properties, and a cached file descriptor for
the specified logical destination.
<b>SECURITY</b>
- The session cache server is not security-sensitive. It
- does not talk to the network, and it does not talk to
- local users. The scache server can run chrooted at fixed
+ The session cache server is not security-sensitive. It
+ does not talk to the network, and it does not talk to
+ local users. The scache server can run chrooted at fixed
low privilege.
The session cache server is not a trusted process. It must
- not be used to store information that is security sensi-
+ not be used to store information that is security sensi-
tive.
<b>DIAGNOSTICS</b>
protocol specific handshake.
<b>CONFIGURATION PARAMETERS</b>
- Changes to <b>main.cf</b> are picked up automatically as
+ Changes to <b>main.cf</b> are picked up automatically as
<a href="scache.8.html">scache(8)</a> processes run for only a limited amount of time.
Use the command "<b>postfix reload</b>" to speed up a change.
- The text below provides only a parameter summary. See
+ The text below provides only a parameter summary. See
<a href="postconf.5.html">postconf(5)</a> for more details including examples.
<b>RESOURCE CONTROLS</b>
<b><a href="postconf.5.html#session_cache_ttl_limit">session_cache_ttl_limit</a> (2s)</b>
- The maximal time-to-live value that the session
+ The maximal time-to-live value that the session
cache server allows.
<b>session_cache_status_update_time (600s)</b>
- How frequently the <a href="scache.8.html">scache(8)</a> server logs usage
- statistics with session cache hit and miss rates
- for logical destinations and for physical end-
+ How frequently the <a href="scache.8.html">scache(8)</a> server logs usage
+ statistics with session cache hit and miss rates
+ for logical destinations and for physical end-
points.
<b>MISCELLANEOUS CONTROLS</b>
<b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
- The default location of the Postfix main.cf and
+ The default location of the Postfix main.cf and
master.cf configuration files.
<b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
- How much time a Postfix daemon process may take to
- handle a request before it is terminated by a
+ How much time a Postfix daemon process may take to
+ handle a request before it is terminated by a
built-in watchdog timer.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon pro-
+ The process ID of a Postfix command or daemon pro-
cess.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the pro-
+ The mail system name that is prepended to the pro-
cess name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
syslogd(8), system logging
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>HISTORY</b>
Available in Postfix version 2.2 and later:
- <b><a href="postconf.5.html#smtp_connection_cache_domains">smtp_connection_cache_domains</a> (empty)</b>
+ <b><a href="postconf.5.html#smtp_connection_cache_destinations">smtp_connection_cache_destinations</a> (empty)</b>
The SMTP destinations for which SMTP connection
caching is enabled.
.PP
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
The default time unit is s (seconds).
-.SH smtp_connection_cache_domains (default: empty)
+.SH smtp_connection_cache_destinations (default: empty)
The SMTP destinations for which SMTP connection caching is
enabled. With SMTP connection caching, a connection is not closed
immediately after completion of a mail transaction. Instead, the
Specify a comma or white space separated list of destinations
or pseudo-destinations:
.IP \(bu
-a domain name (the right-hand side of an email address),
+if mail is sent without a relay host: a domain name (the
+right-hand side of an email address, without the optional []),
.IP \(bu
-a relay host (including optional [] and/or non-default TCP
-port), using the exact same spelling as in main.cf or in the
-transport map,
+if mail is sent via a relay host: a relay host (without the
+optional [] or non-default TCP port), as specified in main.cf or
+in the transport map,
.IP \(bu
a /file/name with domains and/or relay hosts,
.IP \(bu
.SH DESCRIPTION
.ad
.fi
-The scache server maintains the Postfix session cache. This
-information can be used by, for example, the Postfix SMTP client.
+The \fBscache\fR server maintains a shared multi-session
+cache. This information can be used by, for example, Postfix
+SMTP clients or other Postfix delivery agents.
The session cache is organized into logical destination
names, physical endpoint names, and sessions.
under the specified endpoint name. The endpoint properties
are used by the client to re-activate a passivated session
object.
-queue ID is queued for the specified destination.
.IP "\fBfind_endp\fI endpoint\fR"
Look up cached properties and a cached file descriptor for the
specified endpoint.
for receiving the server response.
.PP
Available in Postfix version 2.2 and later:
-.IP "\fBsmtp_connection_cache_domains (empty)\fR"
+.IP "\fBsmtp_connection_cache_destinations (empty)\fR"
The SMTP destinations for which SMTP connection caching is
enabled.
.IP "\fBsmtp_connection_cache_reuse_limit (10)\fR"
s;\bsmtp_connection_cache_reuse_limit\b;<a href="postconf.5.html#smtp_connection_cache_reuse_limit">$&</a>;g;
s;\bsmtp_connection_cache_time_limit\b;<a href="postconf.5.html#smtp_connection_cache_time_limit">$&</a>;g;
- s;\bsmtp_connection_cache_domains\b;<a href="postconf.5.html#smtp_connection_cache_domains">$&</a>;g;
+ s;\bsmtp_connection_cache_destinations\b;<a href="postconf.5.html#smtp_connection_cache_destinations">$&</a>;g;
s;\bsmtp_data_done_timeout\b;<a href="postconf.5.html#smtp_data_done_timeout">$&</a>;g;
s;\bsmtp_data_init_timeout\b;<a href="postconf.5.html#smtp_data_init_timeout">$&</a>;g;
an SMTP session is reused before it is closed.
</p>
-%PARAM smtp_connection_cache_domains
+%PARAM smtp_connection_cache_destinations
<p> The SMTP destinations for which SMTP connection caching is
enabled. With SMTP connection caching, a connection is not closed
<ul>
-<li> a domain name (the right-hand side of an email address),
+<li> if mail is sent without a relay host: a domain name (the
+right-hand side of an email address, without the optional []),
-<li> a relay host (including optional [] and/or non-default TCP
-port), using the exact same spelling as in main.cf or in the
-transport map,
+<li> if mail is sent via a relay host: a relay host (without the
+optional [] or non-default TCP port), as specified in main.cf or
+in the transport map,
<li> a /file/name with domains and/or relay hosts,
#define DEF_SMTP_REUSE_LIMIT 10
extern int var_smtp_reuse_limit;
-#define VAR_SMTP_CACHE_DEST "smtp_connection_cache_domains"
+#define VAR_SMTP_CACHE_DEST "smtp_connection_cache_destinations"
#define DEF_SMTP_CACHE_DEST ""
extern char *var_smtp_cache_dest;
#define MAIL_ATTR_SASL_METHOD "sasl_method"
#define MAIL_ATTR_SASL_USERNAME "sasl_username"
#define MAIL_ATTR_SASL_SENDER "sasl_sender"
+#define MAIL_ATTR_DUMMY "dummy"
#define MAIL_ATTR_TTL "ttl"
#define MAIL_ATTR_LABEL "label"
* Patches change the patchlevel and the release date. Snapshots change the
* release date only.
*/
-#define MAIL_RELEASE_DATE "20040721"
+#define MAIL_RELEASE_DATE "20040723"
#define MAIL_VERSION_NUMBER "2.2"
#define VAR_MAIL_VERSION "mail_version"
typedef struct {
SCACHE scache[1]; /* super-class */
CLNT_STREAM *clnt_stream; /* client endpoint */
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ VSTRING *dummy; /* dummy buffer */
+#endif
} SCACHE_CLNT;
#define STR(x) vstring_str(x)
ATTR_TYPE_STR, MAIL_ATTR_PROP, endp_prop,
ATTR_TYPE_END) != 0
|| vstream_fflush(stream)
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ || attr_scan(stream, ATTR_FLAG_STRICT,
+ ATTR_TYPE_STR, MAIL_ATTR_DUMMY, sp->dummy,
+ ATTR_TYPE_END) != 1
+#endif
|| LOCAL_SEND_FD(vstream_fileno(stream), fd) < 0
|| attr_scan(stream, ATTR_FLAG_STRICT,
ATTR_TYPE_NUM, MAIL_ATTR_STATUS, &status,
ATTR_TYPE_STR, MAIL_ATTR_PROP, endp_prop,
ATTR_TYPE_END) != 2
|| (status == 0
- && (fd = LOCAL_RECV_FD(vstream_fileno(stream))) < 0)) {
+ && (
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ attr_print(stream, ATTR_FLAG_NONE,
+ ATTR_TYPE_STR, MAIL_ATTR_DUMMY, "",
+ ATTR_TYPE_END) != 0
+ || vstream_fflush(stream) != 0
+ || read_wait(vstream_fileno(stream),
+ stream->timeout) < 0 || /* XXX */
+#endif
+ (fd = LOCAL_RECV_FD(vstream_fileno(stream))) < 0))) {
if (msg_verbose || (errno != EPIPE && errno != ENOENT))
msg_warn("problem talking to service %s: %m",
VSTREAM_PATH(stream));
ATTR_TYPE_STR, MAIL_ATTR_PROP, endp_prop,
ATTR_TYPE_END) != 3
|| (status == 0
- && (fd = LOCAL_RECV_FD(vstream_fileno(stream))) < 0)) {
+ && (
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ attr_print(stream, ATTR_FLAG_NONE,
+ ATTR_TYPE_STR, MAIL_ATTR_DUMMY, "",
+ ATTR_TYPE_END) != 0
+ || vstream_fflush(stream) != 0
+ || read_wait(vstream_fileno(stream),
+ stream->timeout) < 0 || /* XXX */
+#endif
+ (fd = LOCAL_RECV_FD(vstream_fileno(stream))) < 0))) {
if (msg_verbose || (errno != EPIPE && errno != ENOENT))
msg_warn("problem talking to service %s: %m",
VSTREAM_PATH(stream));
SCACHE_CLNT *sp = (SCACHE_CLNT *) scache;
clnt_stream_free(sp->clnt_stream);
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ vstring_free(sp->dummy);
+#endif
myfree((char *) sp);
}
sp->clnt_stream = clnt_stream_create(MAIL_CLASS_PRIVATE, server,
idle_limit, ttl_limit);
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ sp->dummy = vstring_alloc(1);
+#endif
return (sp->scache);
}
scache.o: ../../include/iostuff.h
scache.o: ../../include/htable.h
scache.o: ../../include/ring.h
+scache.o: ../../include/events.h
scache.o: ../../include/mail_params.h
scache.o: ../../include/mail_proto.h
scache.o: ../../include/vstream.h
/* SYNOPSIS
/* \fBscache\fR [generic Postfix daemon options]
/* DESCRIPTION
-/* The scache server maintains the Postfix session cache. This
-/* information can be used by, for example, the Postfix SMTP client.
+/* The \fBscache\fR server maintains a shared multi-session
+/* cache. This information can be used by, for example, Postfix
+/* SMTP clients or other Postfix delivery agents.
/*
/* The session cache is organized into logical destination
/* names, physical endpoint names, and sessions.
/* under the specified endpoint name. The endpoint properties
/* are used by the client to re-activate a passivated session
/* object.
-/* queue ID is queued for the specified destination.
/* .IP "\fBfind_endp\fI endpoint\fR"
/* Look up cached properties and a cached file descriptor for the
/* specified endpoint.
static VSTRING *scache_endp_label;
static VSTRING *scache_endp_prop;
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+static VSTRING *scache_dummy;
+
+#endif
+
/*
* Session cache instance.
*/
ATTR_TYPE_NUM, MAIL_ATTR_STATUS, SCACHE_STAT_BAD,
ATTR_TYPE_END);
return;
- } else if ((fd = LOCAL_RECV_FD(vstream_fileno(client_stream))) < 0) {
+ } else if (
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ attr_print(client_stream, ATTR_FLAG_NONE,
+ ATTR_TYPE_STR, MAIL_ATTR_DUMMY, "",
+ ATTR_TYPE_END) != 0
+ || vstream_fflush(client_stream) != 0
+ || read_wait(vstream_fileno(client_stream),
+ client_stream->timeout) < 0 /* XXX */
+ ||
+#endif
+ (fd = LOCAL_RECV_FD(vstream_fileno(client_stream))) < 0) {
msg_warn("%s: unable to receive file descriptor", myname);
attr_print(client_stream, ATTR_FLAG_NONE,
ATTR_TYPE_NUM, MAIL_ATTR_STATUS, SCACHE_STAT_FAIL,
ATTR_TYPE_STR, MAIL_ATTR_PROP, STR(scache_endp_prop),
ATTR_TYPE_END);
if (vstream_fflush(client_stream) != 0
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ || attr_scan(client_stream, ATTR_FLAG_STRICT,
+ ATTR_TYPE_STR, MAIL_ATTR_DUMMY, scache_dummy,
+ ATTR_TYPE_END) != 1
+#endif
|| LOCAL_SEND_FD(vstream_fileno(client_stream), fd) < 0)
msg_warn("%s: cannot send file descriptor: %m", myname);
if (close(fd) < 0)
ATTR_TYPE_STR, MAIL_ATTR_PROP, STR(scache_endp_prop),
ATTR_TYPE_END);
if (vstream_fflush(client_stream) != 0
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ || attr_scan(client_stream, ATTR_FLAG_STRICT,
+ ATTR_TYPE_STR, MAIL_ATTR_DUMMY, scache_dummy,
+ ATTR_TYPE_END) != 1
+#endif
|| LOCAL_SEND_FD(vstream_fileno(client_stream), fd) < 0)
msg_warn("%s: cannot send file descriptor: %m", myname);
if (close(fd) < 0)
scache_dest_prop = vstring_alloc(10);
scache_endp_label = vstring_alloc(10);
scache_endp_prop = vstring_alloc(10);
+#ifdef CANT_WRITE_BEFORE_SENDING_FD
+ scache_dummy = vstring_alloc(10);
+#endif
/*
* Disable the max_use limit. We still terminate when no client is
/* for receiving the server response.
/* .PP
/* Available in Postfix version 2.2 and later:
-/* .IP "\fBsmtp_connection_cache_domains (empty)\fR"
+/* .IP "\fBsmtp_connection_cache_destinations (empty)\fR"
/* The SMTP destinations for which SMTP connection caching is
/* enabled.
/* .IP "\fBsmtp_connection_cache_reuse_limit (10)\fR"
SMTP_SESSION *session;
int lookup_mx;
unsigned domain_best_pref;
- int sess_flags;
+ int sess_flags = SMTP_SESS_FLAG_NONE;
/*
* First try to deliver to the indicated destination, then try to deliver
msg_panic("null destination: \"%s\"", request->nexthop);
argv_split_append(sites, var_fallback_relay, ", \t\r\n");
- /*
- * Enable session caching by next-hop destination.
- */
- if (sites->argv[0]
- && smtp_cache_dest
- && string_list_match(smtp_cache_dest, sites->argv[0]))
- sess_flags = SMTP_SESS_FLAG_CACHE;
- else
- sess_flags = SMTP_SESS_FLAG_NONE;
-
/*
* Don't give up after a hard host lookup error until we have tried the
* fallback relay servers.
* XXX Replace sites->argv by (lookup_mx, domain, port) triples so we
* don't have to make clumsy ad-hoc copies and keep track of who
* free()s the memory.
+ *
+ * XXX smtp_session_cache_destinations specifies domain names without
+ * :port, because : is already used for maptype:mapname. Because of
+ * this limitation we use the bare domain without the optional [] or
+ * non-default TCP port.
*/
- if (cpp == sites->argv && (sess_flags & SMTP_SESS_FLAG_CACHE) != 0)
+ if (cpp == sites->argv
+ && smtp_cache_dest
+ && string_list_match(smtp_cache_dest, domain)) {
+ sess_flags |= SMTP_SESS_FLAG_CACHE;
SET_NEXTHOP_STATE(state, lookup_mx, domain, port);
+ }
/*
* Don't try any backup host if mail loops to myself. That would just
*
* Cache the first good session under the next-hop destination name.
* Cache all good sessions under their physical endpoint.
+ *
+ * Don't query the session cache for primary MX hosts. We already did
+ * that in smtp_reuse_session(), and if any were found in the cache,
+ * they were already deleted from the address list.
*/
for (addr = addr_list; SMTP_RCPT_LEFT(state) > 0 && addr; addr = next) {
next = addr->next;
case SMTP_ERR_TIME:
state->reason = "timeout";
- smtpd_chat_reply(state, "421 %s Error: timeout exceeded",
- var_myhostname);
+ if (vstream_setjmp(state->client) == 0)
+ smtpd_chat_reply(state, "421 %s Error: timeout exceeded",
+ var_myhostname);
break;
case SMTP_ERR_EOF:
msg_fatal("request to use privileged group id %ld", (long) attr->gid);
if (attr->gid == var_owner_gid)
msg_fatal("request to use mail system owner group id %ld", (long) attr->gid);
+ if (attr->uid == (uid_t) (-1))
+ msg_fatal("user must not have user ID -1");
+ if (attr->gid == (gid_t) (-1))
+ msg_fatal("user must not have group ID -1");
/*
* Give the poor tester a clue of what is going on.
/* Each of these specifies I/O redirection of one of the standard file
/* descriptors for the command.
/* .IP "SPAWN_CMD_UID (int)"
-/* The user ID to execute the command as.
+/* The user ID to execute the command as. The value -1 is reserved
+/* and cannot be specified.
/* .IP "SPAWN_CMD_GID (int)"
-/* The group ID to execute the command as.
+/* The group ID to execute the command as. The value -1 is reserved
+/* and cannot be specified.
/* .IP "SPAWN_CMD_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.
args->stderr_fd = va_arg(ap, int);
break;
case SPAWN_CMD_UID:
- args->uid = va_arg(ap, int); /* in case uid_t is short */
+ args->uid = va_arg(ap, uid_t);
+ if (args->uid == (uid_t) (-1))
+ msg_panic("spawn_command: request with reserved user ID: -1");
break;
case SPAWN_CMD_GID:
- args->gid = va_arg(ap, int); /* in case gid_t is short */
+ args->gid = va_arg(ap, gid_t);
+ if (args->gid == (gid_t) (-1))
+ msg_panic("spawn_command: request with reserved group ID: -1");
break;
case SPAWN_CMD_TIME_LIMIT:
args->time_limit = va_arg(ap, int);
#define SOCKADDR_SIZE socklen_t
#define SOCKOPT_SIZE socklen_t
#endif
+#define CANT_WRITE_BEFORE_SENDING_FD
#endif
#ifdef LINUX1