]> git.sur5r.net Git - openldap/commitdiff
refine last commit (let "proxied" attrs be registered in between the request and...
authorPierangelo Masarati <ando@openldap.org>
Fri, 26 Aug 2005 14:43:15 +0000 (14:43 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 26 Aug 2005 14:43:15 +0000 (14:43 +0000)
servers/slapd/ad.c

index cc9a8fd8898ad5bd139e53a70234af50c043a71b..79f58db4047e85883062f8f28485694b49556c12 100644 (file)
@@ -178,7 +178,7 @@ int slap_bv2ad(
        desc.ad_cname = *bv;
        name = bv->bv_val;
        options = strchr( name, ';' );
-       if ( options != NULL && ( options - name ) < bv->bv_len ) {
+       if ( options != NULL && (unsigned) ( options - name ) < bv->bv_len ) {
                /* don't go past the end of the berval! */
                desc.ad_cname.bv_len = options - name;
        } else {
@@ -250,7 +250,7 @@ int slap_bv2ad(
 
                                rc = strncasecmp( opt, tags[i].bv_val,
                                        (unsigned) optlen < tags[i].bv_len
-                                               ? optlen : tags[i].bv_len );
+                                               ? (unsigned) optlen : tags[i].bv_len );
 
                                if( rc == 0 && (unsigned)optlen == tags[i].bv_len ) {
                                        /* duplicate (ignore) */
@@ -388,7 +388,7 @@ done:;
                                        if( lp != desc.ad_tags.bv_val ) {
                                                *cp++ = ';';
                                                j = (lp
-                                                    ? lp - desc.ad_tags.bv_val - 1
+                                                    ? (unsigned) (lp - desc.ad_tags.bv_val - 1)
                                                     : strlen( desc.ad_tags.bv_val ));
                                                cp = lutil_strncopy(cp, desc.ad_tags.bv_val, j);
                                        }
@@ -664,15 +664,12 @@ int ad_inlist(
                        }
 
                } else {
-                       /* short-circuit this search next time around */
-                       if (!slap_schema.si_at_undefined->sat_ad) {
-                               const char *text;
-                               slap_bv2undef_ad(&attrs->an_name,
-                                       &attrs->an_desc, &text, 0);
-                       } else {
-                               attrs->an_desc =
-                                       slap_schema.si_at_undefined->sat_ad;
-                       }
+                       const char      *text;
+
+                       /* give it a chance of being retrieved by a proxy... */
+                       (void)slap_bv2undef_ad( &attrs->an_name,
+                               &attrs->an_desc, &text,
+                               SLAP_AD_PROXIED|SLAP_AD_NOINSERT );
                }
        }