Skip to content

Commit

Permalink
Fix bug in objectclass_matched()
Browse files Browse the repository at this point in the history
Reviewed-by: Iker Pedrosa <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
  • Loading branch information
ondrejv2 authored and alexey-tikhonov committed Nov 12, 2024
1 parent d5b6484 commit 56438ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/providers/ldap/sdap.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,13 @@ static bool objectclass_matched(struct sdap_attr_map *map,
len = strlen(objcl) + 1;
}

if (strncasecmp(map[SDAP_OC_GROUP].name, objcl, len) == 0) {
if (strncasecmp(map[0].name, objcl, len) == 0) {
return true;
}

if (map[SDAP_OC_GROUP_ALT].name != NULL
/* first element is always object class, and for groups also the
* second element (SDAP_OC_GROUP_ALT) in the array */
if (strcmp(map[SDAP_OC_GROUP_ALT].sys_name, SYSDB_GROUP_CLASS) == 0
&& map[SDAP_OC_GROUP_ALT].name != NULL
&& strncasecmp(map[SDAP_OC_GROUP_ALT].name, objcl, len) == 0) {
return true;
}
Expand Down

0 comments on commit 56438ec

Please sign in to comment.