Qmail
[Top] [All Lists]

Re: Is saferead not really safe on Solaris 8?

To: qmail@list.cr.yp.to
Subject: Re: Is saferead not really safe on Solaris 8?
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
Date: Fri, 24 Nov 2006 21:55:56 +0100 (CET)
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-qmail@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list qmail@list.cr.yp.to
In-reply-to: <20061124185905.GA577@odin.dempsky.org>
Mailing-list: contact qmail-help@list.cr.yp.to; run by ezmlm
References: <20061124.191156.02469879.hanche@math.ntnu.no> <20061124185905.GA577@odin.dempsky.org>
+ "Matthew R. Dempsky" <mrd@alkemio.org>:

| On Fri, Nov 24, 2006 at 07:11:56PM +0100, Harald Hanche-Olsen wrote:
| > Surely, if select() said there is data, then read() cannot hang?
| 
| Not entirely true: select() can only say the readability/writability
| of fds at time of call.  If some other process reads the data before
| qmail-smtpd, then qmail-smtpd could hang.

Good point, but I am pretty sure that doesn't happen here.

| Are you using any 3rd-party wrapper programs that are invoked between
| tcpserver and qmail-smtpd?  That's my only guess beyond an OS bug.

Well, only if you consider me a 3rd party 8-)

Here is the end of /service/smtpd/run:

exec \
  env - PATH=$PATH \
  tcpserver -R -v -c 50 -x /etc/tcprules/smtp.cdb -u $qmaild -g $nofiles \
        0 smtp \
  loggit \
  rblsmtpd -b -r rbl-plus.mail-abuse.org:"$bouncemsg" \
  qmail-smtpd 2>&1

In here, loggit is a program I have written.  It runs the named
program in a child process, which inherits file descriptor 0.  It
copies data on file descriptor 1 to its own stdout, while copying any
SMTP error messages to stderr for multilog to see.  More to the point,
the parent closes the original file descriptor 0, so that is not a
likely source of the problem.  (Also, it has been running without any
problem since I last edited the source file, which is dated
1998-09-08.)  Neither is rblsmtpd, I think.

- Harald

<Prev in Thread] Current Thread [Next in Thread>