[PATCH] lib/ldb minor fixes

Andrew Bartlett abartlet at samba.org
Fri Nov 14 12:33:26 MST 2014


On Fri, 2014-11-14 at 04:16 +0100, Kamen Mazdrashki wrote:
> Hi Andrew,
> 
> On Fri, Nov 14, 2014 at 2:35 AM, Kamen Mazdrashki <kamenim at samba.org> wrote:
> 
> >
> >
> > On Thu, Nov 13, 2014 at 5:43 AM, Andrew Bartlett <abartlet at samba.org>
> > wrote:
> >
> >>
> >> I still don't like the check for a == NULL at:
> >>
> >> https://github.com/kamenim/samba/commit/2966a44cd900f597aed232c963693ab85bd33f4b#diff-d7e2445ee96f1098ad238e62cf47cb92R323
> >>
> >> The reason I don't like it is that this function is designed not to
> >> fail, and if we start checking here, for a condition that can't happen,
> >> then we will start checking everywhere, as folks work to make it
> >> consistent.
> >>
> >
> >
> > Well, I have changed it to fall explicitely in case 'name == null' :). See:
> >
> > https://github.com/kamenim/samba/commit/194658167d65f0f96e7150b1f5e5652175830999#diff-a410d07b1af338be3b0b3d1c3d62622aR131
> >
> > I didn't know "no fail" is the intended design as half of the calls to
> > this function
> > actually check the return value.
> > I will change then
> >
> > https://github.com/kamenim/samba/commit/194658167d65f0f96e7150b1f5e5652175830999#diff-a410d07b1af338be3b0b3d1c3d62622aR131
> > to always succeed and remove the check that bothers you. It is not needed
> > indeed.
> >
> 
> I have updated the branch (PR): https://github.com/kamenim/samba/pull/4
> 
> Reworked commits are:
> https://github.com/kamenim/samba/commit/dd677c73377eae6d3f317c97e7adccfcf85cbaa8
> https://github.com/kamenim/samba/commit/888a764d3045bca86a8143fe3f0d2135628fb149

Thanks.  I've been trying to figure out why I didn't quite feel right
about this patch.  Belts and braces are an OK strategy, and can avoid
crashes after an unchecked allocation failure elsewhere, but shouldn't
we be checking for name == NULL in the python LDB bindings?

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list