[PATCH] Display status of encryption and signing in smbstatus
Jeremy Allison
jra at samba.org
Thu Jan 21 18:15:41 UTC 2016
On Thu, Jan 21, 2016 at 07:10:52PM +0100, Ralph Boehme wrote:
> On Thu, Jan 21, 2016 at 05:38:55PM +0100, Ralph Boehme wrote:
> > On Thu, Jan 21, 2016 at 08:33:13AM -0800, Jeremy Allison wrote:
> > > On Thu, Jan 21, 2016 at 05:14:32PM +0100, Ralph Boehme wrote:
> > > > ...and crashed in autobuild. Working on it...
> > >
> > > Related ? Looking at req->encrypted is certainly
> > > the correct thing here as ENCRYPTION_REQUIRED(conn)
> > > is a static config, and req->encrypted is per-packet.
> >
> > no, no. It crashed at logoff when session->global is alredy gone away
> > when I call smb1srv_update_crypto_flags(). Iirc there was a reason I
> > put the flag updating behind the packet processing. No idea why this
> > didn't crash on me in manual testing.
> >
> > Running a local make test now with an upated version, seems make test
> > finally got usable on my devel machine.
>
> hooray! make test passed the first time ever on my machine.
>
> The following change is needed for the last patch in the set to fix
> the crash:
>
> --- a/source3/smbd/process.c
> +++ b/source3/smbd/process.c
> @@ -1695,9 +1695,6 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
> }
> }
>
> - smb_messages[type].fn(req);
> - conn = req->conn;
> -
> /*
> * Update encryption and signing state tracking flags that are
> * used by smbstatus to display signing and encryption status.
> @@ -1719,7 +1716,7 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
> }
>
> if (update_tcon_global) {
> - status = smbXsrv_tcon_update(conn->tcon);
> + status = smbXsrv_tcon_update(req->conn->tcon);
> if (!NT_STATUS_IS_OK(status)) {
> reply_nterror(req, NT_STATUS_UNSUCCESSFUL);
> return conn;
> @@ -1727,7 +1724,9 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
> }
> }
>
> - return conn;
> + smb_messages[type].fn(req);
> +
> + return req->conn;
> }
>
> Ie update the flags before calling the message handler.
>
> Would you like me to re-post a complete patchset or can I just push
> with this change squashed?
Yes, that looks good to me - it matches what we
do in the SMB2 case also. Please squash + push.
More information about the samba-technical
mailing list