Univention Bugzilla – Bug 51601
Adapt or remove 'load and save' code from office365-user.py listener
Last modified: 2020-09-16 16:13:54 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
So the workaround moving /var/lib/univention-office365/office365-user_old_dn away, solved the customer problem.