From decf0fc37a4c11e85452a9850c46c95c2887cc1f Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Mon, 16 Dec 2013 08:38:43 -0700 Subject: [PATCH] Ticket #47631 objectclass may, must lists skip rest of objectclass once first is found in sup https://fedorahosted.org/389/ticket/47631 Reviewed by: ??? Branch: master Fix Description: Once a match is found, reset the found flag to 0 so that we will keep looking for the next match. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no --- ldap/servers/slapd/schema.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c index ef85be3..414e7f0 100644 --- a/ldap/servers/slapd/schema.c +++ b/ldap/servers/slapd/schema.c @@ -4333,7 +4333,8 @@ parse_objclass_str ( const char *input, struct objclass **oc, char *errorbuf, OrigAllowedAttrsArray = (char **) slapi_ch_malloc (1 * sizeof(char *)) ; OrigAllowedAttrsArray[0] = NULL; if (psup_oc->oc_required && objClass->oc_at_oids_must) { - for (i = 0, found_it = 0; objClass->oc_at_oids_must[i]; i++) { + for (i = 0; objClass->oc_at_oids_must[i]; i++) { + found_it = 0; for (j = 0; psup_oc->oc_required[j]; j++) { if (strcasecmp (psup_oc->oc_required[j], objClass->oc_at_oids_must[i]) == 0) { found_it = 1; @@ -4350,7 +4351,8 @@ parse_objclass_str ( const char *input, struct objclass **oc, char *errorbuf, OrigRequiredAttrsArray = charray_dup(objClass->oc_at_oids_must); } if (psup_oc->oc_allowed && objClass->oc_at_oids_may) { - for (i = 0, found_it = 0; objClass->oc_at_oids_may[i]; i++) { + for (i = 0; objClass->oc_at_oids_may[i]; i++) { + found_it = 0; for (j = 0; psup_oc->oc_allowed[j]; j++) { if (strcasecmp (psup_oc->oc_allowed[j], objClass->oc_at_oids_may[i]) == 0) { found_it = 1; -- 1.7.1