Bug 53414 - KeyError: 'univentionSharePath' in samba-shares when removing group-shares
KeyError: 'univentionSharePath' in samba-shares when removing group-shares
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Florian Best
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-07 16:21 CEST by Tobias Wenzel
Modified: 2021-06-30 18:54 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Wenzel univentionstaff 2021-06-07 16:21:27 CEST
When deleting classshares, I get a traceback in var/log/univention/listener.log

Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 283, in handler
    ['samba-tool', 'ntacl', 'get', '--as-sddl', new['univentionSharePath'][0]],
KeyError: 'univentionSharePath'


l.279:
if 'univentionShareSambaBaseDirAppendACL' in new or 'univentionShareSambaBaseDirAppendACL' in old:



So far univentionShareSambaBaseDirAppendACL is only used in uas to set nt acls on group-shares.
Comment 1 Florian Best univentionstaff 2021-06-17 08:37:51 CEST
Still present with UCS@school 5.0:

17.06.21 08:20:18.743  LISTENER    ( PROCESS ) : updating 'cn=testou2252-z3i7rgc3oo,cn=shares,ou=testou2252,dc=autotest201,dc=local' command d                                                                                                
17.06.21 08:20:18.773  LISTENER    ( PROCESS ) : Writing /etc/exports with 10 lines
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 260, in handler
    share_path = new['univentionSharePath'][0].decode('UTF-8')
KeyError: 'univentionSharePath'
17.06.21 08:20:18.785  LISTENER    ( WARN    ) : at least one delete handler failed
Comment 2 Florian Best univentionstaff 2021-06-21 12:41:20 CEST
Fixed by simply ignoring to set NTACL's on shares which are removed (indicated by `not new`):

univention-samba4.yaml
7cd1eccfb9fc | Bug #53414: prevent listener traceback when removing samba share with NT ACLs

univention-samba4 (9.0.6-3)
7cd1eccfb9fc | Bug #53414: prevent listener traceback when removing samba share with NT ACLs

univention-samba.yaml
7cd1eccfb9fc | Bug #53414: prevent listener traceback when removing samba share with NT ACLs

univention-samba (14.0.4-4)
7cd1eccfb9fc | Bug #53414: prevent listener traceback when removing samba share with NT ACLs
Comment 3 Arvid Requate univentionstaff 2021-06-22 12:29:20 CEST
Verified:
* Jenkins Tests
* Code review
* Advisory