Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117787198
D2653.1775253557.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D2653.1775253557.diff
View Options
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -408,7 +408,7 @@
current_acls = self.imap.lam(self.folder_utf7(folder))
for current_acl in current_acls.keys():
- if current_acl == identifier:
+ if current_acl == identifier.lower():
_acl = current_acls[current_acl]
break
@@ -418,12 +418,17 @@
acl = ''.join(list(set(_acl)))
try:
- self.imap.sam(self.folder_utf7(folder), identifier, acl)
+ _folder = self.folder_utf7(folder)
+ log.debug(
+ _("IMAP SAM command with calculated ACL rights %s for %s on folder %s") % \
+ (acl, identifier, _folder), level=8
+ )
+ self.imap.sam(_folder, identifier, acl)
except Exception as errmsg:
log.error(
_("Could not set ACL for %s on folder %s: %r") % (
identifier,
- folder,
+ _folder,
errmsg
)
)
@@ -892,9 +897,11 @@
if update is True and isinstance(acls, list) and len(acls) == 0:
acls = self.list_acls(folder)
for subject in acls:
+ subject = subject.lower()
log.debug(
- _("Removing ACL rights %s for subject %s on folder " + \
- "%s") % (acls[subject], subject, folder), level=8)
+ _("Special case: Update with ACLs %s " + \
+ "for subject %s on folder %s") % \
+ (acls[subject], subject, folder), level=6)
self.set_acl(folder, subject, '')
return
@@ -906,7 +913,7 @@
for acl in acls:
exec("acl = %s" % (acl))
- subject = acl[0]
+ subject = acl[0].lower()
rights = acl[1]
if len(acl) == 3:
epoch = acl[2]
@@ -917,8 +924,9 @@
if update is True:
if old_acls is None:
old_acls = self.list_acls(folder)
- for old_subject in old_acls:
- old_acls[old_subject] = old_acls[old_subject]
+ # Removing, does not make sense
+ # for old_subject in old_acls:
+ # old_acls[old_subject] = old_acls[old_subject]
if subject in old_acls:
old_acls[subject] = None
@@ -926,7 +934,7 @@
if epoch > (int)(time.time()):
log.debug(
_("Setting ACL rights %s for subject %s on folder " + \
- "%s") % (rights, subject, folder), level=8)
+ "%s") % (rights, subject, folder), level=6)
self.set_acl(
folder,
@@ -936,8 +944,8 @@
else:
log.debug(
- _("Removing ACL rights %s for subject %s on folder " + \
- "%s") % (rights, subject, folder), level=8)
+ _("Removing %s ACL rights for subject %s on folder " + \
+ "%s") % (rights, subject, folder), level=6)
self.set_acl(
folder,
@@ -950,8 +958,8 @@
for subject in old_acls:
if old_acls[subject] is not None:
log.debug(
- _("Removing ACL rights %s for subject %s on folder " + \
- "%s") % (old_acls[subject], subject, folder), level=8)
+ _("Update mode: Unset %s ACLs for subject %s on folder " + \
+ "%s") % (old_acls[subject], subject, folder), level=6)
self.set_acl(folder, subject, '')
pass
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 9:59 PM (3 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18826868
Default Alt Text
D2653.1775253557.diff (3 KB)
Attached To
Mode
D2653: Attempt to fix issues with acl setting when acl subject has upper case letters in LDAP.
Attached
Detach File
Event Timeline