[PATCH] Fix bug 13465

Ralph Böhme slow at samba.org
Wed Jul 11 13:04:27 UTC 2018


On Wed, Jul 11, 2018 at 02:35:58PM +0200, Ralph Böhme wrote:
>On Wed, Jul 11, 2018 at 08:24:16AM +0200, Ralph Böhme wrote:
>>Looking...
>
>gna, the problem is starting any tool from the build directory *as 
>root* fails if the install directory doesn not exits, eg
>
># bin/smbd -b | grep LOCKDIR   LOCKDIR: /opt/samba/var/lock
># mv /opt/samba /opt/samba.bak # bin/smbd -b | grep LOCKDIR Unable to 
>initialize messaging context. # exit
>
>But it works as a normal user where a failing messaging init is not treated as a
>fatal error:
>
>$ bin/smbd -b Unable to initialize messaging context.   LOCKDIR: 
>/opt/samba/var/lock
>
>Guess we should only call client_messaging_context() in 
>popt_common_credentials_callback(), but not in popt_common_callback(). 
>This ensures all tools that use that use POPT_COMMON_SAMBA get an 
>automatic messaging context when needed in popt for the 
>lp_load_client() call.
>
>popt_common_callback() will only call client_messaging_context() if 
>(another new function) popt_common_set_init_messaging() has been 
>called by the tool before calling poptGetContext().
>
>So any tool that doesn't use POPT_COMMON_SAMBA but uses 
>lp_load_something > lp_load_initial_only would just call 
>popt_common_set_init_messaging() before poptGetContext().

otoh, some tools like testparm don't need a msg_ctx themselves, it' just that
loadparm implicitly needs it with include=registry.

So maybe in order to give tools control over this, so they can decide how to
treat a failing client_messaging_context() we should just leave it up to the
tools to call client_messaging_context() and not call it in
popt_common_callback() at all. Only in popt_common_credentials_callback() as
needs it for lp_load_client().

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46



More information about the samba-technical mailing list