Univention Bugzilla – Bug 45921
fix quoting in global acls
Last modified: 2018-04-26 12:42:00 CEST
+++ This bug was initially created as a clone of Bug #41138 +++ +++ This bug was initially created as a clone of Bug #41022 +++ -------------------- Changing the mailPrimaryAddress of a shared folder if a group contains a space: 19.12.17 14:18:31.905 LISTENER ( PROCESS ) : dovecot-shared-folder-ox: Moved mail home (of mail: 'fol4mneu@ox-test-gmbh.intranet') from '/var/spool/dovecot/private/ox-test-gmbh.intranet/fol4m' to '/var/spool/dovecot/private/ox-test-gmbh.intranet/fol4mneu'. Traceback (most recent call last): File "/usr/lib/univention-directory-listener/system/dovecot-shared-folder-ox.py", line 203, in handler dl.mod_shared_folder(old, new) File "/usr/lib/pymodules/python2.7/univention/mail/dovecot_shared_folder.py", line 227, in mod_shared_folder self.remove_global_acls(old) File "/usr/lib/pymodules/python2.7/univention/mail/dovecot_shared_folder.py", line 526, in remove_global_acls self.global_acls.remove_acls(old_mailbox) File "/usr/lib/pymodules/python2.7/univention/mail/dovecot_shared_folder.py", line 92, in remove_acls self._read() File "/usr/lib/pymodules/python2.7/univention/mail/dovecot_shared_folder.py", line 117, in _read self._acls.append(DovecotFolderAclEntry(*line.split())) TypeError: __init__() takes exactly 4 arguments (5 given) 19.12.17 14:18:31.906 LISTENER ( WARN ) : handler: dovecot-shared-folder-ox (failed) ------------------------------------- The identifier in the ACL file must be quoted, for example: shared/priv6m@uni.dtr "group=DC Slave Hosts" lrws
The identifiers in the ACLs in the global ACL file have to be quoted, if they contain spaces. commit 4108486d8a3082c382d4034f2303912c521981bc Bug #45921: fix quoting of identifier in global ACL file commit 5eac889a5452d9066c54f6dc19c83e46d4799e95 Bug #45921: changelog commit 12ab2302153da4b02a5b3334aad40e511d3a1b46 Bug #45921: advisory Package: univention-mail-dovecot Version: 3.0.1-5A~4.2.0.201712211105 Branch: ucs_4.2-0 Scope: errata4.2-3
The code change doesn't consider if there is a double quote (") in a value.
(In reply to Florian Best from comment #2) > The code change doesn't consider if there is a double quote (") in a value. The first regex matches only if the <id> starts and ends with a double quote. <folder> and <acl> may not contain whitespace. Updated regular expression to prevent problems if the .* in <folder> matches too many characters: -glocal_acl_pattern1 = re.compile(r'(?P<folder>.+) "(?P<id>.+)" (?P<acl>\w+)') -glocal_acl_pattern2 = re.compile(r'(?P<folder>.+) (?P<id>.+) (?P<acl>\w+)') +glocal_acl_pattern1 = re.compile(r'(?P<folder>[^ ]+) "(?P<id>.+)" (?P<acl>\w+)') +glocal_acl_pattern2 = re.compile(r'(?P<folder>[^ ]+) (?P<id>.+) (?P<acl>\w+)') Tested with new and old/uncorrected ACLs. Both are correct after next folder modification. Package: univention-mail-dovecot Version: 3.0.1-6A~4.2.0.201712211551 Branch: ucs_4.2-0 Scope: errata4.2-3 → VERIFIED
<http://errata.software-univention.de/ucs/4.2/255.html>