dovecot-1.2: imap-acl: Handle obsolete 'c' and 'd' rights.

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 20 22:47:44 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/2579345e877f
changeset: 8755:2579345e877f
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 20 15:47:39 2009 -0500
description:
imap-acl: Handle obsolete 'c' and 'd' rights.
Patch by Sascha Wilde.

diffstat:

1 file changed, 20 insertions(+), 3 deletions(-)
src/plugins/imap-acl/imap-acl-plugin.c |   23 ++++++++++++++++++++---

diffs (40 lines):

diff -r ed352de284be -r 2579345e877f src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c	Fri Feb 20 15:38:42 2009 -0500
+++ b/src/plugins/imap-acl/imap-acl-plugin.c	Fri Feb 20 15:47:39 2009 -0500
@@ -305,6 +305,10 @@ imap_acl_letters_parse(const char *lette
 imap_acl_letters_parse(const char *letters, const char *const **rights_r,
 		       const char **error_r)
 {
+	static const char *acl_k = MAIL_ACL_CREATE;
+	static const char *acl_x = MAIL_ACL_DELETE;
+	static const char *acl_e = MAIL_ACL_EXPUNGE;
+	static const char *acl_t = MAIL_ACL_WRITE_DELETED;
 	ARRAY_TYPE(const_string) rights;
 	unsigned int i;
 
@@ -318,9 +322,22 @@ imap_acl_letters_parse(const char *lette
 			}
 		}
 		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, &acl_k, 1);
+				array_append(&rights, &acl_x, 1);
+				break;
+			case 'd':
+				array_append(&rights, &acl_e, 1);
+				array_append(&rights, &acl_t, 1);
+				break;
+			default:
+				*error_r = t_strdup_printf(
+					"Invalid ACL right: %c", *letters);
+				return -1;
+			}
 		}
 	}
 	(void)array_append_space(&rights);


More information about the dovecot-cvs mailing list