diff --git a/servers/slapd/overlays/rwmconf.c b/servers/slapd/overlays/rwmconf.c index d612712f0e..a96bf8b450 100644 --- a/servers/slapd/overlays/rwmconf.c +++ b/servers/slapd/overlays/rwmconf.c @@ -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:; diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index c9a8126db5..bc79ae17b6 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -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 );