[PATCH] Add messaging_init_client() function

Andreas Schneider asn at samba.org
Mon Nov 14 11:16:43 UTC 2016

On Monday, 14 November 2016 11:51:59 CET Volker Lendecke wrote:
> On Mon, Nov 14, 2016 at 11:42:01AM +0100, Andreas Schneider wrote:
> > The attached patchset adds a messaging_init_client() to correctly address
> > issues when we try to setup messaging in a client tool like rpcclient or
> > net.
> > 
> > It also cleans them up a bit.
> > 
> > Review and push much appreciated!
> In general I like those changes, just returning a pointer is
> definitely not enough.
> However -- is returning NT_STATUS_OK really the right thing for the
> client_init function when it did not work? Shouldn't we lift the error
> handling a bit up? NT_STATUS_OK tells the caller everything was fine,
> and I would expect crashes later on trying to dereference the
> messaging context pointer.

Check the code, the messaging context can be NULL in the client code!

I recently did a change which broke running rpcclient running as user in 


This change fix it so, if we cannot access the locking direction we do not 
fail and continue to work. If we can access the directory, so we are root we 
will fail if something goes wrong beyond the directory access!

We can also just have messaging_init() return NTSTATUS and in case of 



Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org

More information about the samba-technical mailing list