Bug 48666 - KeyError in remove-old-homedirs listener
KeyError in remove-old-homedirs listener
Status: CLOSED WONTFIX
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-13 13:26 CET by Daniel Tröder
Modified: 2023-06-12 15:39 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
troeder: Patch_Available+


Attachments
append "uid=*" to LDAP filter (527 bytes, patch)
2019-02-13 13:27 CET, Daniel Tröder
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-02-13 13:26:26 CET
The listener "remove-old-homedirs" from the "ucs-school-old-homedirs" package crashes with
  KeyError: 'uid'
when a group is deleted.
Its LDAP filter is '(objectClass=ucsschoolType)'.

OC ucsschoolType is inherited by OCs ucsschoolAdministratorGroup and ucsschoolImportGroup.

So this happens:

01.08.18 11:13:56.169  LISTENER    ( PROCESS ) : updating 'cn=admins-tx71qen12zw,cn=ouadmins,cn=groups,dc=uni,dc=dtr' command d
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/remove-old-homedirs.py", line 143, in handler
    uid = old["uid"][0]
KeyError: 'uid'
Comment 1 Daniel Tröder univentionstaff 2019-02-13 13:27:35 CET
Created attachment 9835 [details]
append "uid=*" to LDAP filter
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2019-02-13 13:37:58 CET
(In reply to Daniel Tröder from comment #1)
> Created attachment 9835 [details]
> append "uid=*" to LDAP filter

Sure that this will work?
At least if the object has been modified and does no longer match the specified LDAP filter, the listener will NOT trigger the listener module.
Comment 3 Daniel Tröder univentionstaff 2019-02-13 14:45:47 CET
(In reply to Sönke Schwardt-Krummrich from comment #2)
> (In reply to Daniel Tröder from comment #1)
> > Created attachment 9835 [details]
> > append "uid=*" to LDAP filter
> 
> Sure that this will work?
Sorry - forgot to mention that I have not tested this.

> At least if the object has been modified and does no longer match the
> specified LDAP filter, the listener will NOT trigger the listener module.
'uid' is mandatory for user accounts, but groups don't have it. That should fit the requirement.
Comment 4 Jan-Luca Kiok univentionstaff 2023-06-12 15:32:07 CEST
This issue has been filed against UCS@school 4.3 or earlier.

UCS 4.3 is out of maintenance and UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.