[PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

Samba - samba-technical mailing list
Hi,

Here's a quick patch that checks srv_send_smb return code and exits
early if it fails.

Please review and push.

Thanks,


--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

0001-s3-smbd-exit-early-if-srv_send_smb-fails.patch (989 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

Samba - samba-technical mailing list
On Wed, Mar 15, 2017 at 11:43:01AM +0100, Aurélien Aptel via samba-technical wrote:
> Hi,
>
> Here's a quick patch that checks srv_send_smb return code and exits
> early if it fails.
>
> Please review and push.

LGTM. Reviewed-by: Jeremy Allison <[hidden email]>

Can I get a second Team reviewer ?


> From e22941286d1eaa5d68c3fb394800fe9667bed4eb Mon Sep 17 00:00:00 2001
> From: Aurelien Aptel <[hidden email]>
> Date: Wed, 15 Mar 2017 11:34:20 +0100
> Subject: [PATCH] s3:smbd: exit early if srv_send_smb fails
>
> coverity fix.
>
> Signed-off-by: Aurelien Aptel <[hidden email]>
> ---
>  source3/smbd/reply.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
> index 22941ec..0979e6e 100644
> --- a/source3/smbd/reply.c
> +++ b/source3/smbd/reply.c
> @@ -779,7 +779,9 @@ void reply_special(struct smbXsrv_connection *xconn, char *inbuf, size_t inbuf_s
>   DEBUG(5,("init msg_type=0x%x msg_flags=0x%x\n",
>      msg_type, msg_flags));
>  
> - srv_send_smb(xconn, outbuf, false, 0, false, NULL);
> + if (!srv_send_smb(xconn, outbuf, false, 0, false, NULL)) {
> + exit_server_cleanly("reply_special: srv_send_smb failed.");
> + }
>  
>   if (CVAL(outbuf, 0) != 0x82) {
>   exit_server_cleanly("invalid netbios session");
> --
> 2.10.2
>

> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

Samba - samba-technical mailing list
On Wed, Mar 15, 2017 at 10:09:31AM -0700, Jeremy Allison via samba-technical wrote:

> On Wed, Mar 15, 2017 at 11:43:01AM +0100, Aurélien Aptel via samba-technical wrote:
> > Hi,
> >
> > Here's a quick patch that checks srv_send_smb return code and exits
> > early if it fails.
> >
> > Please review and push.
>
> LGTM. Reviewed-by: Jeremy Allison <[hidden email]>
>
> Can I get a second Team reviewer ?

+1

Can you push?

-slow

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

Samba - samba-technical mailing list
On Wed, Mar 15, 2017 at 06:27:56PM +0100, Ralph Böhme via samba-technical wrote:

> On Wed, Mar 15, 2017 at 10:09:31AM -0700, Jeremy Allison via samba-technical wrote:
> > On Wed, Mar 15, 2017 at 11:43:01AM +0100, Aurélien Aptel via samba-technical wrote:
> > > Hi,
> > >
> > > Here's a quick patch that checks srv_send_smb return code and exits
> > > early if it fails.
> > >
> > > Please review and push.
> >
> > LGTM. Reviewed-by: Jeremy Allison <[hidden email]>
> >
> > Can I get a second Team reviewer ?
>
> +1
>
> Can you push?

Sure - can you send me your modified version of my locking
optimization fix and I'll push them together (for some
reason I didn't see your push come through) ?

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

Samba - samba-technical mailing list
On Wed, Mar 15, 2017 at 10:34:03AM -0700, Jeremy Allison wrote:

> On Wed, Mar 15, 2017 at 06:27:56PM +0100, Ralph Böhme via samba-technical wrote:
> > On Wed, Mar 15, 2017 at 10:09:31AM -0700, Jeremy Allison via samba-technical wrote:
> > > On Wed, Mar 15, 2017 at 11:43:01AM +0100, Aurélien Aptel via samba-technical wrote:
> > > > Hi,
> > > >
> > > > Here's a quick patch that checks srv_send_smb return code and exits
> > > > early if it fails.
> > > >
> > > > Please review and push.
> > >
> > > LGTM. Reviewed-by: Jeremy Allison <[hidden email]>
> > >
> > > Can I get a second Team reviewer ?
> >
> > +1
> >
> > Can you push?
>
> Sure - can you send me your modified version of my locking
> optimization fix and I'll push them together (for some
> reason I didn't see your push come through) ?

yeah, was queue, then never scheduled, then failed. Currently running and needs
just a few more minutes, so I'd say lets leave it running.

Cheerio!
-slow