September 2, 2019 5:55 PM, [email protected] wrote: > September 2, 2019 5:23 PM, "Martijn van Duren" > <[email protected]> wrote: > >> Gilles should probably elaborate, but the way things are now is that >> system(3) is used to start the filters, allowing us to run any arbitrary >> (set of) command(s) as a filter. >> >> Since the filters now in ports are non-interactive commands I proposed >> to move them to /usr/local/libexec/smtpd, which gilles@ is a proponent >> of. This however means that all filters need to be specified by a full >> path, which is not something I would promote. >> >> Hence the proposition of this diff. > > I don't feel comfortable adding that path to PATH, even if we're going > to call system() right behind. > > Why not detect if the command starts with '/' and prepend libexec directory > if that's not the case ? >
I also want to rework the command line before it's passed to system() so we exec and save some unnecessary processes which are only waiting for a child to exit its infinite loop. To do that, we are going to copy the command anyways so checking if command starts with a / and prepending the absolute path is going to be easy.
