Many smbd forked processes are not resetting am_parent to NULL

Ralph Böhme rb at
Wed Apr 15 03:28:11 MDT 2015

Hi folks,

exit_server_common() checks the am_parent global and does a few things
differently depending whether am_parent is NULL or not.

What are the supposed semantics? If I'm not mislead am_parent should
be non NULL in the main smbd process and NULL in any forked child, be
it a forked sesssion smbd process or some other forked subsystem.

The thing is, only smbd sessions childs reset am_parent to NULL as
does the scavenger child, other subsystems like the printing subsystem
seem to miss this step.

Shouldn't we basically set am_parent to NULL in anything that forks
from the main smbd?

I'm currently looking at adding some cleanup code to
exit_server_common() that is supposed to execute some code only in the
am_parent != NULL case in the main smbd process. At the moment the
code gets executed too from the printing subsystem. :)

Happy to provide a patch that fixes this if I'm right about this.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen,

More information about the samba-technical mailing list