Re: Advice Required - for avoiding conflict betwen qmail-smtpd, rblsmtpd loaded as shared objects in tcpserver
Manvendra Bhangui <[email protected]> Sun, 2 Apr 2017 10:18:31 +0530
| Newsgroups | gmane.mail.qmail.general |
|---|---|
| Message-ID | <CAOqj+1NAJS3os9LgoBf1RBpUkCwEOm_orgG80xxvwOxayTASqw@mail.gmail.com> |
On 1 April 2017 at 22:36, Charles Cazabon <[email protected]> wrote: > Manvendra Bhangui <[email protected]> wrote: >> In recent past I worked on an idea that I had to eliminate the frequent >> fork() / exec() calls made by tcpserver for incoming emails > > Er, why? I do have a situation where I open around 23 control files in the qmail-smtpd process. I want to move this to the main() of the tcpserver process and avoid loading it again and again. > tcpserver does this by design. Part of the reason for that is separation of > privelege; no child process, which handles a single connection, can interfere > with the operation of any other connection, even if the exec'd program is a > buggy mess of security holes. In other words, it's a security feature. > Yes. This is the biggest reason in favour of the existing tcpserver design. > It's also extremely efficient; the process is tiny and a fork/exec is cheap on > reasonable operating systems and even vaguely-modern hardware. Do you > actually have data showing that this minimal overhead is a bottleneck in your > situation? If not, why are you trying to eliminate it? > No I do not have any data. It is definitely not a bottleneck. It's just that the idea of loading the control files just once does look good. The right thing to do is load it only once, if it can be done without compromising the integrity of tcpserver. Hence the question on dlopen(). Is there a way one can keep the symbols private?. I mean if I load qmail_smtpd.so for a function named qmail_smtp(), can I restrict the symbols loaded only to the functions loaded from qmail_smtpd.so?