]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/rwmmap.c
trim listed modules
[openldap] / servers / slapd / overlays / rwmmap.c
index ed30211df1fdd972c7786cb7a3284abca19aaf75..c05032a36aa3cd18d30f1fd79c309c4c2834ec2e 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2006 The OpenLDAP Foundation.
+ * Copyright 1999-2007 The OpenLDAP Foundation.
  * Portions Copyright 1999-2003 Howard Chu.
  * Portions Copyright 2000-2003 Pierangelo Masarati.
  * All rights reserved.
@@ -142,6 +142,13 @@ rwm_map( struct ldapmap *map, struct berval *s, struct berval *bv, int remap )
 {
        struct ldapmapping *mapping;
 
+       /* map->map may be NULL when mapping is configured,
+        * but map->remap can't */
+       if ( map->remap == NULL ) {
+               *bv = *s;
+               return;
+       }
+
        BER_BVZERO( bv );
        ( void )rwm_mapping( map, s, &mapping, remap );
        if ( mapping != NULL ) {
@@ -479,7 +486,7 @@ rwm_int_filter_map_rewrite(
                return LDAP_OTHER;
        }
 
-       switch ( f->f_choice ) {
+       switch ( f->f_choice & SLAPD_FILTER_MASK ) {
        case LDAP_FILTER_EQUALITY:
                ad = f->f_av_desc;
                if ( map_attr_value( dc, &ad, &atmp,
@@ -688,7 +695,7 @@ rwm_int_filter_map_rewrite(
                break;
        }
 
-       case 0:
+       case -1:
 computed:;
                filter_free_x( op, f );
                f->f_choice = SLAPD_FILTER_COMPUTED;