Re: smtpd: trim down on filter processes

2020-12-27 Thread Todd C . Miller
On Sun, 27 Dec 2020 18:41:22 +0100, Martijn van Duren wrote: > Because filters use system(3) after forking we get 2 processes for every > filter: one for waiting for system(3) to return and one running the actual > filter. > > Since the extra smtpd process does absolutely nothing we can just as ea

Re: smtpd: trim down on filter processes

2020-12-27 Thread Martijn van Duren
On Sun, 2020-12-27 at 11:18 -0700, Theo de Raadt wrote: > fork_filter_process() does not feel like the right name for > the function anymore. > Why not? Right now we do fork and call system system in the child. With my diff we move to fork -> exec The fork part is most definitely still there. Or

Re: smtpd: trim down on filter processes

2020-12-27 Thread Theo de Raadt
fork_filter_process() does not feel like the right name for the function anymore. Take note the exit value of the process (as seen by wait elsewhere) will be subtly differe after this conversion from system() to execve(). Upon failure, rather than being 127, it is now 1. Martijn van Duren wrote:

smtpd: trim down on filter processes

2020-12-27 Thread Martijn van Duren
Because filters use system(3) after forking we get 2 processes for every filter: one for waiting for system(3) to return and one running the actual filter. Since the extra smtpd process does absolutely nothing we can just as easily copy over what system(3) does internally for execve and call the s