nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] closefds() _before_ fork?


From: Ken Hornstein
Subject: Re: [nmh-workers] closefds() _before_ fork?
Date: Mon, 22 Apr 2019 21:08:23 -0400

>David Levine <address@hidden> writes:
>> Ken wrote:
>>> I suggest we simply remove closefds() completely.
>
>> Great idea!
>
>Makes sense from here.  You could back-fill use of CLOEXEC anywhere
>it seemed important.

Alright, done.

In the "weird things I discovered while doing this" ... I saw in slocal
that when mail is delivered to a process via a pipe, right after fork()
and right before exec(), it uses dup2() to duplicate the file descriptor
pointing to the input message down to 0 (expected), opens /dev/null and
redirects standard output and standard error to it (expected), but ALSO
uses dup2() to make an additional copy of the input file descriptor to
descriptor 3 (!). Does anyone know why?  It looks like it has always
done this.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]