]> git.sur5r.net Git - openldap/commitdiff
make sure objectClass is not filtered out by 'rwm-map attribute *' (ITS#5647)
authorPierangelo Masarati <ando@openldap.org>
Sat, 9 Aug 2008 10:49:20 +0000 (10:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 9 Aug 2008 10:49:20 +0000 (10:49 +0000)
servers/slapd/overlays/rwmconf.c
servers/slapd/overlays/rwmmap.c

index d612712f0e7f0f87ee0e9151db30f90307fb4758..a96bf8b4507cfad4dc35096390be363d604bfbfb 100644 (file)
@@ -71,6 +71,13 @@ rwm_map_config(
                return 1;
        }
 
+       if ( !is_oc && map->map == NULL ) {
+               /* only init if required */
+               if ( rwm_map_init( map, &mapping ) != LDAP_SUCCESS ) {
+                       return 1;
+               }
+       }
+
        if ( strcmp( argv[2], "*" ) == 0 ) {
                if ( argc < 4 || strcmp( argv[3], "*" ) == 0 ) {
                        map->drop_missing = ( argc < 4 );
@@ -225,11 +232,6 @@ rwm_map_config(
                                rwm_mapping_cmp, rwm_mapping_dup );
 
 success_return:;
-       if ( !is_oc && map->map == NULL ) {
-               /* only init if required */
-               rc = rwm_map_init( map, &mapping ) != LDAP_SUCCESS;
-       }
-
        return rc;
 
 error_return:;
index c9a8126db5514282427aa67c7fa250d0f9dc99e1..bc79ae17b64fdb1379577f8039d6948610ec4ba5 100644 (file)
@@ -81,7 +81,9 @@ rwm_map_init( struct ldapmap *lm, struct ldapmapping **m )
                return LDAP_NO_MEMORY;
        }
 
-       /* FIXME: I don't think this is needed any more... */
+       /* NOTE: this is needed to make sure that
+        *      rwm-map attribute *
+        * does not  filter out all attributes including objectClass */
        rc = slap_str2ad( "objectClass", &mapping[0].m_src_ad, &text );
        if ( rc != LDAP_SUCCESS ) {
                ch_free( mapping );