[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Missing error codes in slapd/backglue.c:glue_back_search() (ITS#1675)

> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of
> h.b.furuseth@usit.uio.no
> If scope != LDAP_SCOPE_BASE and a timelimit or sizelimit is exceeded,
> rc is returned uninitialized and something (gs.err?) should be set to
> LDAP_<TIME/SIZE>LIMIT_EXCEEDED.  Or maybe it should only be set to
> *LIMIT_EXCEEDED if there is not a "stronger" error there already.
> Though it only pays attention to the _last_ result code in any case;
> that seems strange.

Error handling is definitely a bit of guess work. The goal was to never
return a fatal error code as long as any one of the backends returns a
valid result. However, the LIMIT errors definitely need to be set, thanks
for pointing that out.

> Also, rc is returned uninitialized if scope != LDAP_SCOPE_BASE and
> there is no backend with a be->be_search routine.
> BTW, after fixing this, you'll get rid of a gcc 'variable might
> be used uninitialized' warning if you replace the switch with an
> `if (scope == LDAP_SCOPE_BASE) ... else ...' statement.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support