[PATCH] fix cid 1350009

Michael Adam obnox at samba.org
Wed Feb 10 12:07:48 UTC 2016

On 2016-02-10 at 12:53 +0200, Uri Simchoni wrote:
> On 02/10/2016 12:03 PM, Michael Adam wrote:
> >On 2016-02-10 at 09:46 +0200, Uri Simchoni wrote:
> >>It's better, but having carefully looked at it now, I think you also want to
> >>set speed to 0 on all failure paths, or report failure to caller and let it
> >>intelligently deal with it.
> >Well, I also thought about it.
> >Currently the pattern is: only set speed on success.
> >Otherwise leave speed untouched. In the current caller
> >this means that the default is used.
> >
> >Of course we could propagate the error, but it seemed
> >the most simple this way.
> >
> >What specific problem do you see with the current way?
> >
> >Thanks - Michael
> >
> a. It's not always the default - it's the last interface's result (it's in a
> loop)

Oh, true!
The if_speed variable is in the wrong scope.
I'd say fixing this is a separate patch though.

> b. I'd say that if the name is too long, don't use that interface. Speed:=0
> is one way of doing it.

But somehow the interface got there, so maybe it has its purpose?
I also think this change of treatment of error is the topic
of another patch that broadly changes the error treatment in this
function, as you suggested.

Could we get this CID fix in now and do further improvements
(directly) afterwards? I'd be willing to argue to do the
speed = 0 in this special case.

Thanks - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160210/15f1771d/signature.sig>

More information about the samba-technical mailing list