[PATCH] Fix bug 13465

Ralph Böhme slow at samba.org
Wed Jul 11 12:35:58 UTC 2018

On Wed, Jul 11, 2018 at 08:24:16AM +0200, Ralph Böhme wrote:

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 

I'm currently busy working on other stuff so I might not be able to implement 
this before next week.


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