Hi Timo,
Hi *,

I just recognized that the new imap-acl plugin in dovecot 1.2 does not
know the obsolete rights 'd' and 'c' when setting.  According to RFC
4314 section 2.1.1.:

    If a client includes the "d" right in a rights list, then it MUST be
    treated as if the client had included every member of the "delete"
    right.

and

    If a client includes the "c" right in a rights list, then it MUST be
    treated as if the client had included every member of the "create"
    right.

Unfortunatly there are actually clients which depend on this behavior.

I attached a rather rough[0] patch which implements this.

cheers
sascha

[0] I don't like the use of static indexes witch imap_acl_letter_map but
    currently I wasn't able to decide on a more elegant solution.
-- 
Sascha Wilde                                          OpenPGP key: 4BB86568
http://www.intevation.de/~wilde/                  http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück; AG Osnabrück, HR B 18998
Geschäftsführer:   Frank Koormann,  Bernhard Reiter,  Dr. Jan-Oliver Wagner

changeset:   8724:58e9edcb4311
branch:      HEAD
tag:         tip
user:        Sascha Wilde <wi...@intevation.de>
date:        Fri Feb 06 12:16:10 2009 +0100
files:       src/plugins/imap-acl/imap-acl-plugin.c
description:
imap-acl: Added handling of virtual rights `d' and `c'.


diff -r df8bcff0ee01 -r 58e9edcb4311 src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c	Thu Feb 05 11:17:35 2009 +0100
+++ b/src/plugins/imap-acl/imap-acl-plugin.c	Fri Feb 06 12:16:10 2009 +0100
@@ -314,9 +314,26 @@
 			}
 		}
 		if (imap_acl_letter_map[i].name == NULL) {
-			*error_r = t_strdup_printf("Invalid ACL right: %c",
-						   *letters);
-			return -1;
+			/* Handling of obsolete rights as virtual
+			 * rights according to RFC 4314 */
+			switch (*letters) {
+			case 'c':
+				array_append(&rights,
+					     &imap_acl_letter_map[8].name, 1); /* k */
+				array_append(&rights, 
+					     &imap_acl_letter_map[9].name, 1); /* x */
+				break;
+			case 'd':
+				array_append(&rights,
+					     &imap_acl_letter_map[7].name, 1); /* e */
+				array_append(&rights, 
+					     &imap_acl_letter_map[4].name, 1); /* t */
+				break;
+			default:
+				*error_r = t_strdup_printf("Invalid ACL right: %c",
+							   *letters);
+				return -1;
+			}
 		}
 	}
 	(void)array_append_space(&rights);

Attachment: pgpzGlIeoX6tb.pgp
Description: PGP signature

Reply via email to