make sure objectClass is not filtered out by 'rwm-map attribute *' (ITS#5647)

This commit is contained in:
Pierangelo Masarati 2008-08-09 10:49:20 +00:00
parent 69d8588ab4
commit bb4268a646
2 changed files with 10 additions and 6 deletions

View File

@ -71,6 +71,13 @@ rwm_map_config(
return 1; 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 ( strcmp( argv[2], "*" ) == 0 ) {
if ( argc < 4 || strcmp( argv[3], "*" ) == 0 ) { if ( argc < 4 || strcmp( argv[3], "*" ) == 0 ) {
map->drop_missing = ( argc < 4 ); map->drop_missing = ( argc < 4 );
@ -225,11 +232,6 @@ rwm_map_config(
rwm_mapping_cmp, rwm_mapping_dup ); rwm_mapping_cmp, rwm_mapping_dup );
success_return:; success_return:;
if ( !is_oc && map->map == NULL ) {
/* only init if required */
rc = rwm_map_init( map, &mapping ) != LDAP_SUCCESS;
}
return rc; return rc;
error_return:; error_return:;

View File

@ -81,7 +81,9 @@ rwm_map_init( struct ldapmap *lm, struct ldapmapping **m )
return LDAP_NO_MEMORY; 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 ); rc = slap_str2ad( "objectClass", &mapping[0].m_src_ad, &text );
if ( rc != LDAP_SUCCESS ) { if ( rc != LDAP_SUCCESS ) {
ch_free( mapping ); ch_free( mapping );