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

Jeremy Allison jra at samba.org
Fri May 24 02:42:32 UTC 2019


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
root.

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

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

Jeremy.



More information about the samba-technical mailing list