Bug 51601 - Adapt or remove 'load and save' code from office365-user.py listener
Adapt or remove 'load and save' code from office365-user.py listener
Status: NEW
Product: UCS
Classification: Unclassified
Component: Office 365
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Mail maintainers
Mail maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-02 15:13 CEST by Erik Damrose
Modified: 2020-09-16 16:13 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?: 3: A User would likely not purchase the product
User Pain: 0.086
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020070121000775
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 2020-07-02 15:13:58 CEST
The office365-user.py listener has code to save a krb5key to  json and to reload it when a user is removed / added (or moved). I do not see the current usecase for that code path. We should test if it can be safely removed, or at least improved to catch the decode error: When /var/lib/univention-office365/office365-user_old_dn does contain invalid data, the listener fails to modify the user, instead of falling back to the standard behavior.

Traceback from listener.log:
30.06.20 23:09:30.315  LISTENER    ( PROCESS ) : updating 'uid=testuser,ou=users,dc=my,dc=intranet' command a
30.06.20 23:09:30.399  LISTENER    ( ERROR   ) : o365(D): office365-user.handler:349  office365-user.handler() command: 'a' dn: 'uid=testuser,ou=users,dc=my,dc=intranet'
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/office365-user.py", line 357, in handler
    old = load_old(old)
  File "/usr/lib/univention-directory-listener/system/office365-user.py", line 185, in load_old
    old = json.load(fp)
  File "/usr/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Comment 1 Christina Scheinig univentionstaff 2020-07-03 16:11:19 CEST
So the workaround moving /var/lib/univention-office365/office365-user_old_dn away, solved the customer problem.