From: Luke Howard Date: Tue, 19 Jul 2005 09:37:36 +0000 (+0000) Subject: Always set sml_desc when converting from LDAPMods X-Git-Tag: OPENLDAP_AC_BP~333 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c8ef1e18615b846b9a6679f6e68b4d6ee6a81a96;p=openldap Always set sml_desc when converting from LDAPMods --- diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 503234385a..5453dee727 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -3450,13 +3450,6 @@ int slapi_acl_check_mods(Slapi_PBlock *pb, Slapi_Entry *e, LDAPMod **mods, char return LDAP_OTHER; } - for ( mp = ml; mp != NULL; mp = mp->sml_next ) { - rc = slap_bv2ad( &mp->sml_type, &mp->sml_desc, (const char **)errbuf ); - if ( rc != LDAP_SUCCESS ) { - break; - } - } - if ( rc == LDAP_SUCCESS ) { rc = acl_check_modlist( op, e, ml ) ? LDAP_SUCCESS : LDAP_INSUFFICIENT_ACCESS; } @@ -3563,13 +3556,18 @@ Modifications *slapi_int_ldapmods2modifications (LDAPMod **mods) int i; char **p; struct berval **bvp; + const char *text; + AttributeDescription *ad = NULL; + + if ( slap_str2ad( (*modp)->mod_type, &ad, &text ) != LDAP_SUCCESS ) + continue; mod = (Modifications *) ch_malloc( sizeof(Modifications) ); mod->sml_op = (*modp)->mod_op & (~LDAP_MOD_BVALUES); mod->sml_flags = 0; mod->sml_type.bv_val = (*modp)->mod_type; mod->sml_type.bv_len = strlen( mod->sml_type.bv_val ); - mod->sml_desc = NULL; + mod->sml_desc = ad; mod->sml_next = NULL; if ( (*modp)->mod_op & LDAP_MOD_BVALUES ) {