Bug 54561 - u-group-membership-cache returns None instead of empty list
u-group-membership-cache returns None instead of empty list
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-8-errata
Assigned To: Julia Bremer
Dirk Wiesenthal
:
Depends on:
Blocks: 54572
  Show dependency treegraph
 
Reported: 2022-03-16 16:52 CET by Erik Damrose
Modified: 2022-10-11 16:30 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022030421000264
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Damrose univentionstaff 2022-03-16 16:52:20 CET
univention-group-membership-cache returns unexpected values if a cache entry has no values.

A library using the cache expected that an empty list is returned if an entry has no value - the usual use case is to iterate over the returned values. I would also expect that an empty list is returned.

I would also expect that cache.get() returns [], not None. Although one could argue that a user of the cache has to check if the return value is None.

Traceback from customer environment, with installed office365 app.

"/usr/lib/pymodules/python2.7/univention/office365/udm_helper.py", line 146, in group_in_azure
    alias_users = set(map(unicode.lower, univentionOffice365ADConnectionAlias.get(self.adconnection_alias)))
TypeError: argument 2 to map() must support iteration

The issue exists in UCS 4 + 5
Comment 1 Christina Scheinig univentionstaff 2022-03-18 10:25:40 CET
The replication does not work, if the group sysnc is activated and this error occurs. I would like to increase the pain.
Comment 2 Julia Bremer univentionstaff 2022-03-21 18:43:45 CET
Package: univention-group-membership-cache
Version: 1.0.0-11A~4.4.0.202203211826
Branch: ucs_4.4-0
Scope: errata4.4-8

1ccfc420e7 Bug #54561: advisory
8ec42b09ce Bug #54561: Return an empty list instead of None if key doesn't exist in cache

In single value caches, None is still returned, but in multi-value cases an empty list is returned. This fixes the observed error in the microsoft365 connector.
Comment 3 Dirk Wiesenthal univentionstaff 2022-03-23 10:20:16 CET
Tests: OK
YAML: OK
Manual tests: OK, multi value and single value work as one would expect

VERIFIED