[PATCH] s3:notifyd: Handle sigup in notifyd to reparse smb.conf

Shyam Rathi shyam.rathi at nutanix.com
Fri May 24 21:04:56 UTC 2019

Hi Jeremy,
Please find the attached update patch. I’ve addressed both review comments.


From: Jeremy Allison <jra at samba.org>
Reply-To: Jeremy Allison <jra at samba.org>
Date: Thursday, May 23, 2019 at 7:42 PM
To: Shyam Rathi <shyam.rathi at nutanix.com>
Cc: "samba-technical at lists.samba.org" <samba-technical at lists.samba.org>
Subject: Re: [PATCH] s3:notifyd: Handle sigup in notifyd to reparse smb.conf

On Fri, May 24, 2019 at 12:18:36AM +0000, Shyam Rathi via samba-technical wrote:
Thanks for the review Jeremy. Responses inline below.
+       DEBUG(2,("notifyd: Reloading services after SIGHUP\n"));
	Please use either the DBG_WARNING or DBG_NOTICE macros
	to ensure consistency in new debug info levels.
		---- I'll make the change.

Thanks !

+       become_root();
+       reload_services(NULL, NULL, false);
+       unbecome_root();
Does notifyd need become_root()/unbecome_root()
pairs ? Isn't it always invoked when smbd is root
and stays as such ?
		---- The sighup handler for parent smbd calls
			"change_to_root_user()" before calling
			reload_services(). For many other binaries,
			either reload_services() or (un)become_root
			is called first. I mainly kept the same
			behavior. I'm not fully sure about its purpose
			at this place.

None of the notifyd code ever changes credentials,
so when it runs as root it'll stay that way.

smbd has to change_to_root_user() inside the signal
handler as it often changes credentials to the current
attached user, so might not be currently running as

I don't think you have the same problem inside notifyd
so you can drop the become_root()/unbecome_root() I

Test it once you've made the change to make sure :-).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-notifyd-Handle-sigup-in-notifyd-to-reparse-smb.co.patch
Type: application/octet-stream
Size: 2511 bytes
Desc: 0001-s3-notifyd-Handle-sigup-in-notifyd-to-reparse-smb.co.patch
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190524/5829e698/0001-s3-notifyd-Handle-sigup-in-notifyd-to-reparse-smb.co.obj>

More information about the samba-technical mailing list