[PATCH] Fix cut and paste error using the wrong structure type.

Jeremy Allison jra at samba.org
Tue Oct 18 23:39:50 UTC 2016


On Tue, Oct 18, 2016 at 04:29:16PM -0700, Jeremy Allison wrote:
> On Tue, Oct 18, 2016 at 04:25:26PM +0200, Volker Lendecke wrote:
> > 
> > From 9b759b98d129f868616402714472eb84cdbdc535 Mon Sep 17 00:00:00 2001
> > From: Volker Lendecke <vl at samba.org>
> > Date: Thu, 13 Oct 2016 16:20:12 +0200
> > Subject: [PATCH 8/8] libsmb: "cli" is not needed in
> >  cli_smb2_shadow_copy_data_fnum_state
> > 
> > We only have a single subreq
> > 
> > Signed-off-by: Volker Lendecke <vl at samba.org>
> > ---
> >  source3/libsmb/cli_smb2_fnum.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
> > index cf00f60..ad57cf7 100644
> > --- a/source3/libsmb/cli_smb2_fnum.c
> > +++ b/source3/libsmb/cli_smb2_fnum.c
> > @@ -3303,7 +3303,6 @@ NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written)
> >  ***************************************************************/
> >  
> >  struct cli_smb2_shadow_copy_data_fnum_state {
> > -	struct cli_state *cli;
> >  	uint16_t fnum;
> >  	struct smb2_hnd *ph;
> >  	DATA_BLOB out_input_buffer;
> > @@ -3334,7 +3333,6 @@ static struct tevent_req *cli_smb2_shadow_copy_data_fnum_send(
> >  		return tevent_req_post(req, ev);
> >  	}
> >  
> > -	state->cli = cli;
> >  	state->fnum = fnum;
> >  
> >  	status = map_fnum_to_smb2_handle(cli, fnum, &state->ph);
> > -- 
> > 2.1.4
> 
> This patch causes:
> 
> make test TESTS=samba3.blackbox.smbclient_s3.plain
> 
> to fail with
> 
> UNEXPECTED(failure): samba3.blackbox.smbclient_s3.plain (nt4_dc).creating a :stream at root of share(nt4_dc)
> 
> still investigating. I've pushed the others
> (except for the one blocked by the gcc bug).

Found it. Underlying issue is a cut-and-paste error
meaning cli_smb2_shadow_copy_data_fnum_send() was
using a state structure type of:

 struct cli_smb2_close_fnum_state

instead of

 struct cli_smb2_shadow_copy_data_fnum_state

We just got unlucky it compiled at all (most
structure elements were in common :-).

I've created a bug for this - we'll need it
back ported:

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12383

Fix attached - please review and push if
happy !

Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-libsmb-Fix-cut-and-paste-error-using-the-wrong-st.patch
Type: text/x-diff
Size: 940 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161018/ba1e8f5f/0001-s3-libsmb-Fix-cut-and-paste-error-using-the-wrong-st.diff>


More information about the samba-technical mailing list