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

RE: Small patch to slapd/backend.c



Nice catch. I think we can fix this more simply by skipping this test and
just using a zero for the noSubs argument to select_backend(). The noSubs
flag really only applies in the case of a search operation that can return
more than one match for the given DN. For backend_group and
backend_attribute
that can never be the case. I'll patch this.

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

> -----Original Message-----
> From: owner-openldap-devel@OpenLDAP.org
> [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Ganesan R
> Sent: Sunday, March 17, 2002 11:00 PM
> To: openldap-devel@OpenLDAP.org
> Subject: Small patch to slapd/backend.c
>
>
>
> Hi,
>
> OpenLDAP 2.0 allowed backend_attribute() to be called without be being
> set. The slapd "glue" code broke this is 2.1. The following small patch
> fixes the problem.
>
> --------------------------------------------------------------------------
> diff -u -r1.150 backend.c
> --- servers/slapd/backend.c     2002/02/12 03:50:40     1.150
> +++ servers/slapd/backend.c     2002/03/18 06:36:11
> @@ -1054,11 +1055,12 @@
>         BerVarray *vals
>  )
>  {
> +       int glueflags = ( be ? (be->be_glueflags &
> SLAP_BFLAG_GLUE_INSTANCE) : 0 );
> +
>         if ( target == NULL || !dn_match( &target->e_nname, edn ) ) {
>                 /* we won't attempt to send it to a different backend */
>
> -               be = select_backend( edn, 0,
> -                       (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE));
> +               be = select_backend( edn, 0, glueflags );
>
>                 if (be == NULL) {
>                         return LDAP_NO_SUCH_OBJECT;
> ------------------------------------------------------------------
> ------------
>
> Ganesan