mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-30 21:55:20 +00:00
snapshot-20010329
This commit is contained in:
committed by
Viktor Dukhovni
parent
c08f4e677f
commit
10b4bc7307
@@ -4973,6 +4973,16 @@ Apologies for any names omitted.
|
|||||||
with the introduction of the asynchronous bounce client.
|
with the introduction of the asynchronous bounce client.
|
||||||
Patrik Rak.
|
Patrik Rak.
|
||||||
|
|
||||||
|
20010313
|
||||||
|
|
||||||
|
Bugfix: the RFC 822 untokenizer quoted newlines inside
|
||||||
|
comments. File: global/tok822_parse.c.
|
||||||
|
|
||||||
|
20010316
|
||||||
|
|
||||||
|
Cleanup: removed an extraneous warning when a queue file
|
||||||
|
write error happened.
|
||||||
|
|
||||||
20010321
|
20010321
|
||||||
|
|
||||||
Workaround: LMTP connection caching never worked for
|
Workaround: LMTP connection caching never worked for
|
||||||
@@ -4982,14 +4992,42 @@ Apologies for any names omitted.
|
|||||||
20010322
|
20010322
|
||||||
|
|
||||||
Portability: Solaris <2.6 does not have srandom() and
|
Portability: Solaris <2.6 does not have srandom() and
|
||||||
random() in libc. File: util/rand_sleep.c. It does not
|
random() in libc. File: util/rand_sleep.c. It does not have
|
||||||
have to be cryptographically strong.
|
to be cryptographically strong.
|
||||||
|
|
||||||
Bugfix: the fast ETRN flush server could not handle [ipaddr]
|
Bugfix: the fast ETRN flush server could not handle [ipaddr]
|
||||||
or domain names with one-character hostname part. It should
|
or domain names with one-character hostname part. This
|
||||||
be OK now. File: flush/flush.c.
|
fix changes the destination to logfile name mapping, so
|
||||||
|
that you need to populate the new files with "sendmail -q".
|
||||||
|
The old files go away automatically. File: flush/flush.c.
|
||||||
|
|
||||||
20010327
|
20010327
|
||||||
|
|
||||||
Speed up mailq (sendmail -bp) display by flushing output
|
Speed up mailq (sendmail -bp) display by flushing output
|
||||||
after each file. File: showq/showq.c.
|
after each file. File: showq/showq.c.
|
||||||
|
|
||||||
|
Portability: missing string.h includes, %p wants (void *),
|
||||||
|
Lamont Jones, HP.
|
||||||
|
|
||||||
|
20010328
|
||||||
|
|
||||||
|
Bugfix: swapped logic caused cleanup to stall when the
|
||||||
|
queue file size exceeded the file size limit by less than
|
||||||
|
one the VSTREAM buffer size, so that the "file too big"
|
||||||
|
was detected after flushing the last queue file record.
|
||||||
|
File: cleanup/cleanup.c.
|
||||||
|
|
||||||
|
20010329
|
||||||
|
|
||||||
|
Portability: workaround for missing prototype problem in
|
||||||
|
dict_ldap.c. This module should move to the global directory,
|
||||||
|
because it depends on Postfix main.cf parameter information.
|
||||||
|
|
||||||
|
Workaround: after sending a trigger message over a socket,
|
||||||
|
do not immediately close the client side, but close it from
|
||||||
|
a background thread that waits until the server closes the
|
||||||
|
socket first. This avoids trouble with socket implementations
|
||||||
|
that destroy a socket when the client closes a socket
|
||||||
|
before the server has received the client's data. Files:
|
||||||
|
util/{inet,unix,stream}_trigger.c, util/events.c,
|
||||||
|
master/master_trigger.c, postkick/postkick.c.
|
||||||
|
@@ -251,6 +251,9 @@ and watch your syslog file for any error messages.
|
|||||||
|
|
||||||
% egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
% egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
||||||
|
|
||||||
|
Typical logfile names are: /var/log/maillog or /var/log/syslog.
|
||||||
|
See /etc/syslog.conf for actual logfile names.
|
||||||
|
|
||||||
When it is run for the first time, the Postfix startup shell script
|
When it is run for the first time, the Postfix startup shell script
|
||||||
will create a bunch of subdirectories below the Postfix spool
|
will create a bunch of subdirectories below the Postfix spool
|
||||||
directory.
|
directory.
|
||||||
@@ -294,6 +297,9 @@ and watch your syslog file for any error messages.
|
|||||||
|
|
||||||
% egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
% egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
||||||
|
|
||||||
|
Typical logfile names are: /var/log/maillog or /var/log/syslog.
|
||||||
|
See /etc/syslog.conf for actual logfile names.
|
||||||
|
|
||||||
When it is run for the first time, the Postfix startup shell script
|
When it is run for the first time, the Postfix startup shell script
|
||||||
will create a bunch of subdirectories below the Postfix spool
|
will create a bunch of subdirectories below the Postfix spool
|
||||||
directory.
|
directory.
|
||||||
@@ -329,6 +335,9 @@ and watch the syslog file for any complaints from the mail system.
|
|||||||
|
|
||||||
% egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
% egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
||||||
|
|
||||||
|
Typical logfile names are: /var/log/maillog or /var/log/syslog.
|
||||||
|
See /etc/syslog.conf for actual logfile names.
|
||||||
|
|
||||||
When it is run for the first time, the Postfix startup shell script
|
When it is run for the first time, the Postfix startup shell script
|
||||||
will create a bunch of subdirectories below the Postfix spool
|
will create a bunch of subdirectories below the Postfix spool
|
||||||
directory.
|
directory.
|
||||||
@@ -515,5 +524,11 @@ idea to run every night before the syslog files are rotated:
|
|||||||
# postfix check
|
# postfix check
|
||||||
# egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
# egrep '(reject|warning|error|fatal|panic):' /some/log/file
|
||||||
|
|
||||||
|
Typical logfile names are: /var/log/maillog or /var/log/syslog.
|
||||||
|
See /etc/syslog.conf for actual logfile names.
|
||||||
|
|
||||||
|
The first line (postfix check) causes Postfix to report file
|
||||||
|
permission/ownership discrepancies.
|
||||||
|
|
||||||
The second line looks for problem reports from the mail software,
|
The second line looks for problem reports from the mail software,
|
||||||
and reports how effective the anti-relay and anti-UCE blocks are.
|
and reports how effective the anti-relay and anti-UCE blocks are.
|
||||||
|
@@ -3,7 +3,8 @@
|
|||||||
We've written code to add a mysql map type. It utilizes the mysql
|
We've written code to add a mysql map type. It utilizes the mysql
|
||||||
client library, which can be obtained from:
|
client library, which can be obtained from:
|
||||||
|
|
||||||
http://www.tcx.se/download.html
|
http://www.mysql.com/downloads/
|
||||||
|
http://sourceforge.net/projects/mysql/
|
||||||
|
|
||||||
In order to build postfix with mysql map support, you will need to add
|
In order to build postfix with mysql map support, you will need to add
|
||||||
-DHAS_MYSQL and -I for the directory containing the mysql headers, and
|
-DHAS_MYSQL and -I for the directory containing the mysql headers, and
|
||||||
|
@@ -1,7 +1,28 @@
|
|||||||
Release 20010228 differs from snapshot 20010228 in that the virtual
|
Incompatible changes with snapshot-20010329
|
||||||
delivery agent and nqmgr queue manager are left out. That software
|
===========================================
|
||||||
will become part of the official release when it has not changed
|
|
||||||
in a while.
|
This release changes the names of the "fast ETRN" logfiles with
|
||||||
|
delayed mail per destination. These files are maintained by the
|
||||||
|
Postfix "fast flush" daemon. The old scheme failed with addresses
|
||||||
|
of the form user@[ip.address] and user@a.domain.name. In order to
|
||||||
|
populate the new "fast ETRN" logfiles, execute the command "sendmail
|
||||||
|
-q". The old "fast ETRN" logfiles go away by themselves (default:
|
||||||
|
after 7 days).
|
||||||
|
|
||||||
|
Major changes with snapshot-20010329
|
||||||
|
====================================
|
||||||
|
|
||||||
|
Better support for sites that run multiple Postfix instances on
|
||||||
|
one machine. Each instance can now be recognized by its logging
|
||||||
|
(default: "syslog_name = postfix"). File: global/mail_task.c.
|
||||||
|
|
||||||
|
Workaround for nqmgr panic due to a race condition that was introduced
|
||||||
|
with the asynchronous bounce client.
|
||||||
|
|
||||||
|
Workaround for hostile socket implementations that discard data
|
||||||
|
when a client closes a socket before the server reads the client
|
||||||
|
data. Postfix now closes the client socket in a background thread
|
||||||
|
that waits until the server closes the socket first.
|
||||||
|
|
||||||
Incompatible changes with snapshot-20010225
|
Incompatible changes with snapshot-20010225
|
||||||
===========================================
|
===========================================
|
||||||
|
@@ -111,7 +111,16 @@ In order to allow mail relaying by authenticated clients:
|
|||||||
permit_mynetworks permit_sasl_authenticated ...
|
permit_mynetworks permit_sasl_authenticated ...
|
||||||
|
|
||||||
In /usr/local/lib/sasl/smtpd.conf you need to specify how the server
|
In /usr/local/lib/sasl/smtpd.conf you need to specify how the server
|
||||||
should validate client passwords. For example:
|
should validate client passwords.
|
||||||
|
|
||||||
|
In order to authenticate against the UNIX password database, try:
|
||||||
|
|
||||||
|
/usr/local/lib/sasl/smtpd.conf:
|
||||||
|
pwcheck_method: pwcheck
|
||||||
|
|
||||||
|
The pwcheck daemon is contained in the cyrus-sasl source tarball.
|
||||||
|
|
||||||
|
In order to authenticate against SASL's own password database:
|
||||||
|
|
||||||
/usr/local/lib/sasl/smtpd.conf:
|
/usr/local/lib/sasl/smtpd.conf:
|
||||||
pwcheck_method: sasldb
|
pwcheck_method: sasldb
|
||||||
@@ -129,20 +138,11 @@ IMPORTANT: To get sasldb running, make sure that you set the SASL domain
|
|||||||
|
|
||||||
EXAMPLE: saslpasswd -c -u `postconf -h myhostname` exampleuser
|
EXAMPLE: saslpasswd -c -u `postconf -h myhostname` exampleuser
|
||||||
|
|
||||||
Instead of the SASL-specific password file you can configure the
|
To run software chrooted with SASL support is an interesting
|
||||||
Postfix SMTP server to validate client passwords against the UNIX
|
exercise. It probably is not worth the trouble.
|
||||||
shadow password file:
|
|
||||||
|
|
||||||
/usr/local/lib/sasl/smtpd.conf:
|
Testing SASL authentication in the Postfix SMTP server
|
||||||
pwcheck_method: shadow
|
======================================================
|
||||||
|
|
||||||
However this requires that Postfix has read access to the UNIX shadow
|
|
||||||
password file, which is normally readable only by root. Shadow
|
|
||||||
password support has been found to work for Solaris 2.7 and RedHat
|
|
||||||
6.1 but not with FreeBSD 3.4.
|
|
||||||
|
|
||||||
To run software chrooted with SASL support is an interesting exercise.
|
|
||||||
This is one of the many problems with the present SASL support.
|
|
||||||
|
|
||||||
To test the whole mess, connect to the SMTP server, and you should
|
To test the whole mess, connect to the SMTP server, and you should
|
||||||
be able to have a conversation like this:
|
be able to have a conversation like this:
|
||||||
|
@@ -361,8 +361,8 @@ relocated_maps =
|
|||||||
syslog_facility = mail
|
syslog_facility = mail
|
||||||
|
|
||||||
# The syslog_name parameter specifies the mail system name that is
|
# The syslog_name parameter specifies the mail system name that is
|
||||||
# prepended to the process name in syslog records headers, so that
|
# prepended to the process name in syslog records, so that "smtpd"
|
||||||
# "smtpd" becomes "postfix/smtpd".
|
# becomes, for example, "postfix/smtpd".
|
||||||
#
|
#
|
||||||
# Beware: a non-default syslog_name setting takes effect only
|
# Beware: a non-default syslog_name setting takes effect only
|
||||||
# after process initialization. Some initialization errors will be
|
# after process initialization. Some initialization errors will be
|
||||||
|
@@ -19,3 +19,5 @@ cd ${POSTFIX_DIR}
|
|||||||
|
|
||||||
mkdir etc
|
mkdir etc
|
||||||
cp /etc/services etc
|
cp /etc/services etc
|
||||||
|
mkdir -p usr/lib
|
||||||
|
cp /usr/lib/tztab usr/lib
|
||||||
|
@@ -109,8 +109,8 @@ is allowed in message headers.
|
|||||||
<dt>Syntax:
|
<dt>Syntax:
|
||||||
|
|
||||||
<dd>Specify a list of zero or more lookup tables. Whenever a header
|
<dd>Specify a list of zero or more lookup tables. Whenever a header
|
||||||
matches a table, a REJECT result means reject the message, and a
|
matches a table, a REJECT result means reject the message, and an
|
||||||
SKIP result means delete the header from the message.
|
IGNORE result means delete the header from the message.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
@@ -215,8 +215,8 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv)
|
|||||||
if (CLEANUP_OUT_OK(state) == 0 && type > 0) {
|
if (CLEANUP_OUT_OK(state) == 0 && type > 0) {
|
||||||
if ((state->errs & CLEANUP_STAT_CONT) == 0)
|
if ((state->errs & CLEANUP_STAT_CONT) == 0)
|
||||||
msg_warn("%s: skipping further client input", state->queue_id);
|
msg_warn("%s: skipping further client input", state->queue_id);
|
||||||
while ((type = rec_get(src, buf, 0)) > 0
|
while (type != REC_TYPE_END
|
||||||
&& type != REC_TYPE_END)
|
&& (type = rec_get(src, buf, 0)) > 0)
|
||||||
/* void */ ;
|
/* void */ ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,7 +62,6 @@ flush.o: ../../include/vbuf.h
|
|||||||
flush.o: ../../include/vstring.h
|
flush.o: ../../include/vstring.h
|
||||||
flush.o: ../../include/vstring_vstream.h
|
flush.o: ../../include/vstring_vstream.h
|
||||||
flush.o: ../../include/myflock.h
|
flush.o: ../../include/myflock.h
|
||||||
flush.o: ../../include/valid_hostname.h
|
|
||||||
flush.o: ../../include/htable.h
|
flush.o: ../../include/htable.h
|
||||||
flush.o: ../../include/dict.h
|
flush.o: ../../include/dict.h
|
||||||
flush.o: ../../include/argv.h
|
flush.o: ../../include/argv.h
|
||||||
|
@@ -331,7 +331,7 @@ void mail_params_init()
|
|||||||
VAR_OWNREQ_SPECIAL, DEF_OWNREQ_SPECIAL, &var_ownreq_special,
|
VAR_OWNREQ_SPECIAL, DEF_OWNREQ_SPECIAL, &var_ownreq_special,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
const char *cp;
|
const char *cp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extract syslog_facility early, so that from here on all errors are
|
* Extract syslog_facility early, so that from here on all errors are
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* Version of this program.
|
* Version of this program.
|
||||||
*/
|
*/
|
||||||
#define VAR_MAIL_VERSION "mail_version"
|
#define VAR_MAIL_VERSION "mail_version"
|
||||||
#define DEF_MAIL_VERSION "Snapshot-20010327"
|
#define DEF_MAIL_VERSION "Snapshot-20010329"
|
||||||
extern char *var_mail_version;
|
extern char *var_mail_version;
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
|
@@ -578,6 +578,10 @@ int main(int unused_argc, char **unused_argv)
|
|||||||
VSTRING *buf = vstring_alloc(100);
|
VSTRING *buf = vstring_alloc(100);
|
||||||
|
|
||||||
while (readlline(buf, VSTREAM_IN, (int *) 0, READLL_KEEPNL)) {
|
while (readlline(buf, VSTREAM_IN, (int *) 0, READLL_KEEPNL)) {
|
||||||
|
while (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\n') {
|
||||||
|
vstring_end(buf)[-1] = 0;
|
||||||
|
vstring_truncate(buf, VSTRING_LEN(buf) - 1);
|
||||||
|
}
|
||||||
if (!isatty(vstream_fileno(VSTREAM_IN)))
|
if (!isatty(vstream_fileno(VSTREAM_IN)))
|
||||||
vstream_printf(">>>%s<<<\n\n", vstring_str(buf));
|
vstream_printf(">>>%s<<<\n\n", vstring_str(buf));
|
||||||
list = tok822_parse(vstring_str(buf));
|
list = tok822_parse(vstring_str(buf));
|
||||||
|
@@ -11,3 +11,5 @@ wietse\ venema@porcupine.org
|
|||||||
wietse@[stuff
|
wietse@[stuff
|
||||||
wietse@["stuff]
|
wietse@["stuff]
|
||||||
named group: foo@bar, baz@barf;
|
named group: foo@bar, baz@barf;
|
||||||
|
wietse@foo (wietse
|
||||||
|
venema)
|
||||||
|
@@ -264,3 +264,27 @@ Externalized, newlines inserted:
|
|||||||
named group: foo@bar,
|
named group: foo@bar,
|
||||||
baz@barf;
|
baz@barf;
|
||||||
|
|
||||||
|
>>>wietse@foo (wietse
|
||||||
|
venema)<<<
|
||||||
|
|
||||||
|
Parse tree:
|
||||||
|
address
|
||||||
|
atom "wietse"
|
||||||
|
OP "@"
|
||||||
|
atom "foo"
|
||||||
|
comment
|
||||||
|
text "wietse
|
||||||
|
venema"
|
||||||
|
|
||||||
|
Internalized:
|
||||||
|
wietse@foo (wietse
|
||||||
|
venema)
|
||||||
|
|
||||||
|
Externalized, no newlines inserted:
|
||||||
|
wietse@foo (wietse
|
||||||
|
venema)
|
||||||
|
|
||||||
|
Externalized, newlines inserted:
|
||||||
|
wietse@foo (wietse
|
||||||
|
venema)
|
||||||
|
|
||||||
|
@@ -61,6 +61,7 @@ postkick.o: ../../include/vstream.h
|
|||||||
postkick.o: ../../include/vbuf.h
|
postkick.o: ../../include/vbuf.h
|
||||||
postkick.o: ../../include/msg_vstream.h
|
postkick.o: ../../include/msg_vstream.h
|
||||||
postkick.o: ../../include/safe.h
|
postkick.o: ../../include/safe.h
|
||||||
|
postkick.o: ../../include/events.h
|
||||||
postkick.o: ../../include/mail_proto.h
|
postkick.o: ../../include/mail_proto.h
|
||||||
postkick.o: ../../include/iostuff.h
|
postkick.o: ../../include/iostuff.h
|
||||||
postkick.o: ../../include/mail_params.h
|
postkick.o: ../../include/mail_params.h
|
||||||
|
@@ -160,12 +160,12 @@ int main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Kick the service.
|
* Kick the service.
|
||||||
*/
|
*/
|
||||||
if (mail_trigger(class, service, request, strlen(request) + 1) < 0) {
|
if (mail_trigger(class, service, request, strlen(request)) < 0) {
|
||||||
msg_warn("Cannot contact class %s service %s - perhaps the mail system is down",
|
msg_warn("Cannot contact class %s service %s - perhaps the mail system is down",
|
||||||
class, service);
|
class, service);
|
||||||
exit(1);
|
exit(1);
|
||||||
} else {
|
} else {
|
||||||
event_loop(-1);
|
event_drain();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -781,6 +781,7 @@ int main(int argc, char **argv)
|
|||||||
message_data = mymalloc(message_length);
|
message_data = mymalloc(message_length);
|
||||||
memset(message_data, 'X', message_length);
|
memset(message_data, 'X', message_length);
|
||||||
for (i = 80; i < message_length; i += 80) {
|
for (i = 80; i < message_length; i += 80) {
|
||||||
|
message_data[i - 80] = "0123456789"[(i/80) % 10];
|
||||||
message_data[i - 2] = '\r';
|
message_data[i - 2] = '\r';
|
||||||
message_data[i - 1] = '\n';
|
message_data[i - 1] = '\n';
|
||||||
}
|
}
|
||||||
|
@@ -646,6 +646,8 @@ inet_trigger.o: sys_defs.h
|
|||||||
inet_trigger.o: msg.h
|
inet_trigger.o: msg.h
|
||||||
inet_trigger.o: connect.h
|
inet_trigger.o: connect.h
|
||||||
inet_trigger.o: iostuff.h
|
inet_trigger.o: iostuff.h
|
||||||
|
inet_trigger.o: mymalloc.h
|
||||||
|
inet_trigger.o: events.h
|
||||||
inet_trigger.o: trigger.h
|
inet_trigger.o: trigger.h
|
||||||
inet_util.o: inet_util.c
|
inet_util.o: inet_util.c
|
||||||
inet_util.o: sys_defs.h
|
inet_util.o: sys_defs.h
|
||||||
@@ -834,6 +836,7 @@ safe_open.o: vstring.h
|
|||||||
safe_open.o: safe_open.h
|
safe_open.o: safe_open.h
|
||||||
sane_accept.o: sane_accept.c
|
sane_accept.o: sane_accept.c
|
||||||
sane_accept.o: sys_defs.h
|
sane_accept.o: sys_defs.h
|
||||||
|
sane_accept.o: msg.h
|
||||||
sane_accept.o: sane_accept.h
|
sane_accept.o: sane_accept.h
|
||||||
sane_link.o: sane_link.c
|
sane_link.o: sane_link.c
|
||||||
sane_link.o: sys_defs.h
|
sane_link.o: sys_defs.h
|
||||||
@@ -925,6 +928,8 @@ stream_trigger.o: sys_defs.h
|
|||||||
stream_trigger.o: msg.h
|
stream_trigger.o: msg.h
|
||||||
stream_trigger.o: connect.h
|
stream_trigger.o: connect.h
|
||||||
stream_trigger.o: iostuff.h
|
stream_trigger.o: iostuff.h
|
||||||
|
stream_trigger.o: mymalloc.h
|
||||||
|
stream_trigger.o: events.h
|
||||||
stream_trigger.o: trigger.h
|
stream_trigger.o: trigger.h
|
||||||
sys_compat.o: sys_compat.c
|
sys_compat.o: sys_compat.c
|
||||||
sys_compat.o: sys_defs.h
|
sys_compat.o: sys_defs.h
|
||||||
@@ -976,6 +981,8 @@ unix_trigger.o: sys_defs.h
|
|||||||
unix_trigger.o: msg.h
|
unix_trigger.o: msg.h
|
||||||
unix_trigger.o: connect.h
|
unix_trigger.o: connect.h
|
||||||
unix_trigger.o: iostuff.h
|
unix_trigger.o: iostuff.h
|
||||||
|
unix_trigger.o: mymalloc.h
|
||||||
|
unix_trigger.o: events.h
|
||||||
unix_trigger.o: trigger.h
|
unix_trigger.o: trigger.h
|
||||||
unsafe.o: unsafe.c
|
unsafe.o: unsafe.c
|
||||||
unsafe.o: sys_defs.h
|
unsafe.o: sys_defs.h
|
||||||
|
@@ -104,6 +104,10 @@
|
|||||||
#include "dict.h"
|
#include "dict.h"
|
||||||
#include "dict_ldap.h"
|
#include "dict_ldap.h"
|
||||||
|
|
||||||
|
/* AAARGH!! */
|
||||||
|
|
||||||
|
#include "../global/mail_conf.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Structure containing all the configuration parameters for a given
|
* Structure containing all the configuration parameters for a given
|
||||||
* LDAP source, plus its connection handle.
|
* LDAP source, plus its connection handle.
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
/*
|
/*
|
||||||
/* void event_disable_readwrite(fd)
|
/* void event_disable_readwrite(fd)
|
||||||
/* int fd;
|
/* int fd;
|
||||||
|
/*
|
||||||
|
/* void event_drain()
|
||||||
/* DESCRIPTION
|
/* DESCRIPTION
|
||||||
/* This module delivers I/O and timer events.
|
/* This module delivers I/O and timer events.
|
||||||
/* Multiple I/O streams and timers can be monitored simultaneously.
|
/* Multiple I/O streams and timers can be monitored simultaneously.
|
||||||
@@ -98,6 +100,10 @@
|
|||||||
/* event_disable_readwrite() disables further I/O events on the specified
|
/* event_disable_readwrite() disables further I/O events on the specified
|
||||||
/* I/O channel. The application is allowed to cancel non-existing
|
/* I/O channel. The application is allowed to cancel non-existing
|
||||||
/* I/O event requests.
|
/* I/O event requests.
|
||||||
|
/*
|
||||||
|
/* event_drain() repeatedly calls event_loop() until no more timer
|
||||||
|
/* events or I/O events are pending. This routine must not be called
|
||||||
|
/* from an event_whatever() callback routine.
|
||||||
/* DIAGNOSTICS
|
/* DIAGNOSTICS
|
||||||
/* Panics: interface violations. Fatal errors: out of memory,
|
/* Panics: interface violations. Fatal errors: out of memory,
|
||||||
/* system call failure. Warnings: the number of available
|
/* system call failure. Warnings: the number of available
|
||||||
@@ -242,6 +248,21 @@ time_t event_time(void)
|
|||||||
return (event_present);
|
return (event_present);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* event_drain - loop until all pending events are done */
|
||||||
|
|
||||||
|
void event_drain(void)
|
||||||
|
{
|
||||||
|
fd_set zero_mask;
|
||||||
|
|
||||||
|
if (EVENT_INIT_NEEDED())
|
||||||
|
return;
|
||||||
|
|
||||||
|
FD_ZERO(&zero_mask);
|
||||||
|
while (event_timer_head.pred != event_timer_head.succ
|
||||||
|
|| memcmp(&zero_mask, &event_xmask, sizeof(zero_mask)) != 0)
|
||||||
|
event_loop(-1);
|
||||||
|
}
|
||||||
|
|
||||||
/* event_enable_read - enable read events */
|
/* event_enable_read - enable read events */
|
||||||
|
|
||||||
void event_enable_read(int fd, EVENT_NOTIFY_RDWR callback, char *context)
|
void event_enable_read(int fd, EVENT_NOTIFY_RDWR callback, char *context)
|
||||||
|
@@ -29,6 +29,7 @@ extern void event_disable_readwrite(int);
|
|||||||
extern time_t event_request_timer(EVENT_NOTIFY_TIME, char *, int);
|
extern time_t event_request_timer(EVENT_NOTIFY_TIME, char *, int);
|
||||||
extern int event_cancel_timer(EVENT_NOTIFY_TIME, char *);
|
extern int event_cancel_timer(EVENT_NOTIFY_TIME, char *);
|
||||||
extern void event_loop(int);
|
extern void event_loop(int);
|
||||||
|
extern void event_drain(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Event codes.
|
* Event codes.
|
||||||
|
@@ -16,9 +16,9 @@
|
|||||||
/* a brief connection to it and by writing the contents of the
|
/* a brief connection to it and by writing the contents of the
|
||||||
/* named buffer.
|
/* named buffer.
|
||||||
/*
|
/*
|
||||||
/* The connection is closed by a background thread. Some kernels
|
/* The connection is closed by a background thread. Some kernels
|
||||||
/* cannot handle client-side disconnect before the server has
|
/* cannot handle client-side disconnect before the server has
|
||||||
/* received the message.
|
/* received the message.
|
||||||
/*
|
/*
|
||||||
/* Arguments:
|
/* Arguments:
|
||||||
/* .IP service
|
/* .IP service
|
||||||
@@ -80,6 +80,7 @@ static void inet_trigger_event(int event, char *context)
|
|||||||
if (event == EVENT_TIME)
|
if (event == EVENT_TIME)
|
||||||
msg_warn("%s: read timeout for service %s", myname, ip->service);
|
msg_warn("%s: read timeout for service %s", myname, ip->service);
|
||||||
event_disable_readwrite(ip->fd);
|
event_disable_readwrite(ip->fd);
|
||||||
|
event_cancel_timer(inet_trigger_event, context);
|
||||||
if (close(ip->fd) < 0)
|
if (close(ip->fd) < 0)
|
||||||
msg_warn("%s: close %s: %m", myname, ip->service);
|
msg_warn("%s: close %s: %m", myname, ip->service);
|
||||||
myfree(ip->service);
|
myfree(ip->service);
|
||||||
@@ -113,7 +114,8 @@ int inet_trigger(const char *service, const char *buf, int len, int timeout)
|
|||||||
/*
|
/*
|
||||||
* Write the request...
|
* Write the request...
|
||||||
*/
|
*/
|
||||||
if (write_buf(fd, buf, len, timeout) < 0)
|
if (write_buf(fd, buf, len, timeout) < 0
|
||||||
|
|| write_buf(fd, "", 1, timeout) < 0)
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_warn("%s: write to %s: %m", myname, service);
|
msg_warn("%s: write to %s: %m", myname, service);
|
||||||
|
|
||||||
@@ -121,7 +123,7 @@ int inet_trigger(const char *service, const char *buf, int len, int timeout)
|
|||||||
* Wakeup when the peer disconnects, or when we lose patience.
|
* Wakeup when the peer disconnects, or when we lose patience.
|
||||||
*/
|
*/
|
||||||
if (timeout > 0)
|
if (timeout > 0)
|
||||||
event_request_timer(inet_trigger_event, (char *) ip, timeout);
|
event_request_timer(inet_trigger_event, (char *) ip, timeout + 100);
|
||||||
event_enable_read(fd, inet_trigger_event, (char *) ip);
|
event_enable_read(fd, inet_trigger_event, (char *) ip);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@@ -77,6 +77,7 @@ static void stream_trigger_event(int event, char *context)
|
|||||||
if (event == EVENT_TIME)
|
if (event == EVENT_TIME)
|
||||||
msg_warn("%s: read timeout for service %s", myname, sp->service);
|
msg_warn("%s: read timeout for service %s", myname, sp->service);
|
||||||
event_disable_readwrite(sp->fd);
|
event_disable_readwrite(sp->fd);
|
||||||
|
event_cancel_timer(stream_trigger_event, context);
|
||||||
if (close(sp->fd) < 0)
|
if (close(sp->fd) < 0)
|
||||||
msg_warn("%s: close %s: %m", myname, sp->service);
|
msg_warn("%s: close %s: %m", myname, sp->service);
|
||||||
myfree(sp->service);
|
myfree(sp->service);
|
||||||
@@ -113,7 +114,8 @@ int stream_trigger(const char *service, const char *buf, int len, int timeou
|
|||||||
/*
|
/*
|
||||||
* Write the request...
|
* Write the request...
|
||||||
*/
|
*/
|
||||||
if (write_buf(fd, buf, len, timeout) < 0)
|
if (write_buf(fd, buf, len, timeout) < 0
|
||||||
|
|| write_buf(fd, "", 1, timeout) < 0)
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_warn("%s: write to %s: %m", myname, service);
|
msg_warn("%s: write to %s: %m", myname, service);
|
||||||
|
|
||||||
@@ -121,7 +123,7 @@ int stream_trigger(const char *service, const char *buf, int len, int timeou
|
|||||||
* Wakeup when the peer disconnects, or when we lose patience.
|
* Wakeup when the peer disconnects, or when we lose patience.
|
||||||
*/
|
*/
|
||||||
if (timeout > 0)
|
if (timeout > 0)
|
||||||
event_request_timer(stream_trigger_event, (char *) sp, timeout);
|
event_request_timer(stream_trigger_event, (char *) sp, timeout + 100);
|
||||||
event_enable_read(fd, stream_trigger_event, (char *) sp);
|
event_enable_read(fd, stream_trigger_event, (char *) sp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@@ -401,6 +401,10 @@ extern int initgroups(const char *, int);
|
|||||||
|
|
||||||
#if defined(IRIX5)
|
#if defined(IRIX5)
|
||||||
#define MISSING_USLEEP
|
#define MISSING_USLEEP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(IRIX6)
|
||||||
|
#define HAS_POSIX_REGEXP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -78,6 +78,7 @@ static void unix_trigger_event(int event, char *context)
|
|||||||
if (event == EVENT_TIME)
|
if (event == EVENT_TIME)
|
||||||
msg_warn("%s: read timeout for service %s", myname, up->service);
|
msg_warn("%s: read timeout for service %s", myname, up->service);
|
||||||
event_disable_readwrite(up->fd);
|
event_disable_readwrite(up->fd);
|
||||||
|
event_cancel_timer(unix_trigger_event, context);
|
||||||
if (close(up->fd) < 0)
|
if (close(up->fd) < 0)
|
||||||
msg_warn("%s: close %s: %m", myname, up->service);
|
msg_warn("%s: close %s: %m", myname, up->service);
|
||||||
myfree(up->service);
|
myfree(up->service);
|
||||||
@@ -114,7 +115,8 @@ int unix_trigger(const char *service, const char *buf, int len, int timeout)
|
|||||||
/*
|
/*
|
||||||
* Write the request...
|
* Write the request...
|
||||||
*/
|
*/
|
||||||
if (write_buf(fd, buf, len, timeout) < 0)
|
if (write_buf(fd, buf, len, timeout) < 0
|
||||||
|
|| write_buf(fd, "", 1, timeout) < 0)
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_warn("%s: write to %s: %m", myname, service);
|
msg_warn("%s: write to %s: %m", myname, service);
|
||||||
|
|
||||||
@@ -122,7 +124,7 @@ int unix_trigger(const char *service, const char *buf, int len, int timeout)
|
|||||||
* Wakeup when the peer disconnects, or when we lose patience.
|
* Wakeup when the peer disconnects, or when we lose patience.
|
||||||
*/
|
*/
|
||||||
if (timeout > 0)
|
if (timeout > 0)
|
||||||
event_request_timer(unix_trigger_event, (char *) up, timeout);
|
event_request_timer(unix_trigger_event, (char *) up, timeout + 100);
|
||||||
event_enable_read(fd, unix_trigger_event, (char *) up);
|
event_enable_read(fd, unix_trigger_event, (char *) up);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user