[Samba] smbsrv_reply_printwrite not returning a response causing the print job to be truncated to 124 bytes

Mateusz Mikołajczyk mikolajczyk.mateusz at gmail.com
Thu Apr 29 16:44:18 UTC 2021


ok, I'll add that in a second - I'm creating a virtual machine with debian
but without samba from the repository.

also, I'm quite confused. Are you implying that source3 is actually used by
upstream samba ? (i.e. by version >= 4.0.0) I thought that it was just left
because it's code for samba v. 3 (i.e. < 4.0.0) ? means that I was looking
in the wrong place after all ?

kindest regards and I'll make sure to post about the test result :)

czw., 29 kwi 2021 o 18:32 Jeremy Allison <jra at samba.org> napisał(a):

> On Thu, Apr 29, 2021 at 12:42:50PM +0200, Mateusz Mikołajczyk via samba
> wrote:
> >I haven't received last email but I can see your text appearing on the web
> >archive of the mailing list - I hope I'm replying in a correct way :)
> >
> >I'm using the binaries from debian buster - the exact version
> >is 4.9.5+dfsg-5+deb10u1+rpi1 but I've also compiled latest stable release:
> >4.14.3. from what I could tell on github, last changes to this function
> >were made ~15 years ago
> >
> >I've seen this issue has appeared already on the mailing list and I wrote
> >to the authors of the tickets and one of them responded that the last
> >version of samba that was working (that he checked) with this printing
> >protocol was 3.0.3. I have then looked inside the 3.0.3 source and the
> >function that implements this there is called reply_printwrite and at the
> >very beginning of the function I can see those two zeroes (one of them is
> >presumably 16 bit):
> >
> >int outsize = set_message(outbuf,0,0,True);
>
> Looks like reply_printwrite() is missing setting the reply buffer.
>
> Can you try adding the following patch ?
>
> $ git diff
> diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
> index dcda32e8cc1..f7b0fe72f13 100644
> --- a/source3/smbd/reply.c
> +++ b/source3/smbd/reply.c
> @@ -7059,6 +7059,8 @@ void reply_printwrite(struct smb_request *req)
>
>          DEBUG(3, ("printwrite %s num=%d\n", fsp_fnum_dbg(fsp),
> numtowrite));
>
> +       reply_outbuf(req, 0, 0);
> +
>          END_PROFILE(SMBsplwr);
>          return;
>   }
>
> I'm guessing this will fix it. If so it should be an easy
> patch to get upstream.
>


-- 
pozdrawiam serdecznie,
Mateusz Mikołajczyk, a.k.a. toudi


More information about the samba mailing list