X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Funique.c;h=37a08a8b5fea835570f48d1b67e4ceca8adfdece;hb=10566c8be384c6435476ec54e842382841cb84b6;hp=c6bb780d7645a4f0132b7014636f6ce06641ffde;hpb=71f1a1c3205e4a34a1289f01fdcd7f12f1be42b6;p=openldap diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index c6bb780d76..37a08a8b5f 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2004-2015 The OpenLDAP Foundation. + * Copyright 2004-2017 The OpenLDAP Foundation. * Portions Copyright 2004,2006-2007 Symas Corporation. * All rights reserved. * @@ -746,7 +746,7 @@ unique_cf_uri( ConfigArgs *c ) rc = 0; break; - case SLAP_CONFIG_ADD: /* fallthrough */ + case SLAP_CONFIG_ADD: /* fallthru */ case LDAP_MOD_ADD: if ( legacy ) { snprintf( c->cr_msg, sizeof( c->cr_msg ), @@ -1170,6 +1170,11 @@ unique_modify( Debug(LDAP_DEBUG_TRACE, "==> unique_modify <%s>\n", op->o_req_dn.bv_val, 0, 0); + if ( !op->orm_modlist ) { + Debug(LDAP_DEBUG_TRACE, "unique_modify: got empty modify op\n", 0, 0, 0); + return rc; + } + /* skip the checks if the operation has manageDsaIt control in it * (for replication) */ if ( op->o_managedsait > SLAP_CONTROL_IGNORED @@ -1203,22 +1208,14 @@ unique_modify( && !dnIsSuffix( &op->o_req_ndn, &uri->ndn )) continue; - if ( !(m = op->orm_modlist) ) { - op->o_bd->bd_info = (BackendInfo *) on->on_info; - send_ldap_error(op, rs, LDAP_INVALID_SYNTAX, - "unique_modify() got null op.orm_modlist"); - rc = rs->sr_err; - break; - - } else - for ( ; m; m = m->sml_next) - if ( (m->sml_op & LDAP_MOD_OP) - != LDAP_MOD_DELETE ) - ks += count_filter_len - ( domain, - uri, - m->sml_desc, - m->sml_values); + for ( m = op->orm_modlist; m; m = m->sml_next) + if ( (m->sml_op & LDAP_MOD_OP) + != LDAP_MOD_DELETE ) + ks += count_filter_len + ( domain, + uri, + m->sml_desc, + m->sml_values); /* skip this domain-uri if it isn't involved */ if ( !ks ) continue;