]> git.sur5r.net Git - openldap/commitdiff
set LDAPURLDesc lud_scope to LDAP_SCOPE_DEFAULT if set to LDAP_SCOPE_BASE, so no...
authorPierangelo Masarati <ando@openldap.org>
Sat, 1 Jan 2005 16:12:09 +0000 (16:12 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 1 Jan 2005 16:12:09 +0000 (16:12 +0000)
servers/slapd/back-meta/map.c
servers/slapd/back-meta/suffixmassage.c

index a76c5f0f856f92ddc1418dbaa69fd2937966ff12..949961b7b78ab2a15665b1168a9bf173922048a2 100644 (file)
@@ -523,6 +523,7 @@ ldap_back_filter_map_rewrite(
        case REWRITE_REGEXEC_OK:
                if ( !BER_BVISNULL( fstr ) ) {
                        fstr->bv_len = strlen( fstr->bv_val );
+
                } else {
                        *fstr = ftmp;
                }
@@ -579,6 +580,14 @@ ldap_back_referral_result_rewrite(
                        continue;
                }
 
+               /* FIXME: URLs like "ldap:///dc=suffix" if passed
+                * thru ldap_url_parse() and ldap_url_desc2str()
+                * get rewritten as "ldap:///dc=suffix??base";
+                * we don't want this to occur... */
+               if ( ludp->lud_scope == LDAP_SCOPE_BASE ) {
+                       ludp->lud_scope = LDAP_SCOPE_DEFAULT;
+               }
+
                ber_str2bv( ludp->lud_dn, 0, 0, &olddn );
                
                rc = ldap_back_dn_massage( dc, &olddn, &dn );
@@ -608,7 +617,8 @@ ldap_back_referral_result_rewrite(
                                newurl = ldap_url_desc2str( ludp );
                                if ( newurl == NULL ) {
                                        /* FIXME: leave attr untouched
-                                        * even if ldap_url_desc2str failed... */
+                                        * even if ldap_url_desc2str failed...
+                                        */
                                        break;
                                }
 
index 05e4ca21834fcb76777008b4e0090e82a2b89f04..4879b8fdd05a1248e93849de898032c9dd9b7d76 100644 (file)
@@ -68,8 +68,10 @@ ldap_back_dn_massage(
 {
        int rc = 0;
 
-       switch (rewrite_session( dc->rwmap->rwm_rw, dc->ctx, (dn->bv_len ? dn->bv_val : ""), dc->conn, 
-                               &res->bv_val )) {
+       switch ( rewrite_session( dc->rwmap->rwm_rw, dc->ctx,
+                               ( dn->bv_len ? dn->bv_val : "" ),
+                               dc->conn, &res->bv_val ) )
+       {
        case REWRITE_REGEXEC_OK:
                if ( res->bv_val != NULL ) {
                        res->bv_len = strlen( res->bv_val );