mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
ldap_modify: delete of last attribute value should delete attribute (ITS#229)
This commit is contained in:
parent
54689c9326
commit
726d603a25
2 changed files with 22 additions and 0 deletions
|
|
@ -355,6 +355,17 @@ bdb2i_delete_values(
|
|||
a->a_vals[k - 1] = a->a_vals[k];
|
||||
}
|
||||
a->a_vals[k - 1] = NULL;
|
||||
|
||||
/* delete the entire attribute, if no values remain */
|
||||
if ( a->a_vals[0] == NULL) {
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"removing entire attribute %s\n",
|
||||
mod->mod_type, 0, 0 );
|
||||
if ( attr_delete( &e->e_attrs, mod->mod_type ) ) {
|
||||
return LDAP_NO_SUCH_ATTRIBUTE;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -367,6 +367,17 @@ delete_values(
|
|||
a->a_vals[k - 1] = a->a_vals[k];
|
||||
}
|
||||
a->a_vals[k - 1] = NULL;
|
||||
|
||||
/* delete the entire attribute, if no values remain */
|
||||
if ( a->a_vals[0] == NULL) {
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"removing entire attribute %s\n",
|
||||
mod->mod_type, 0, 0 );
|
||||
if ( attr_delete( &e->e_attrs, mod->mod_type ) ) {
|
||||
return LDAP_NO_SUCH_ATTRIBUTE;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue