[dovecot-cvs] dovecot/src/plugins/acl acl-mailbox-list.c, 1.6, 1.7 acl-mailbox.c, 1.6, 1.7 acl-storage.c, 1.7, 1.8

tss at dovecot.org tss at dovecot.org
Sun May 13 20:11:04 EEST 2007


Update of /var/lib/cvs/dovecot/src/plugins/acl
In directory talvi:/tmp/cvs-serv20721/plugins/acl

Modified Files:
	acl-mailbox-list.c acl-mailbox.c acl-storage.c 
Log Message:
Error handling rewrite.



Index: acl-mailbox-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/acl/acl-mailbox-list.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- acl-mailbox-list.c	11 Apr 2007 19:33:37 -0000	1.6
+++ acl-mailbox-list.c	13 May 2007 17:11:01 -0000	1.7
@@ -286,11 +286,11 @@
 		if (ret < 0)
 			return -1;
 		if (can_see) {
-			mailbox_list_set_error(list,
-					       MAILBOX_LIST_ERR_NO_PERMISSION);
+			mailbox_list_set_error(list, MAIL_ERROR_PERM,
+					       MAIL_ERRSTR_NO_PERMISSION);
 		} else {
-			mailbox_list_set_error(list, t_strdup_printf(
-				MAILBOX_LIST_ERR_MAILBOX_NOT_FOUND, name));
+			mailbox_list_set_error(list, MAIL_ERROR_NOTFOUND,
+				T_MAIL_ERR_MAILBOX_NOT_FOUND(name));
 		}
 		return -1;
 	}
@@ -313,11 +313,11 @@
 		if (ret < 0)
 			return -1;
 		if (can_see) {
-			mailbox_list_set_error(list,
-					       MAILBOX_LIST_ERR_NO_PERMISSION);
+			mailbox_list_set_error(list, MAIL_ERROR_PERM,
+					       MAIL_ERRSTR_NO_PERMISSION);
 		} else {
-			mailbox_list_set_error(list, t_strdup_printf(
-				MAILBOX_LIST_ERR_MAILBOX_NOT_FOUND, oldname));
+			mailbox_list_set_error(list, MAIL_ERROR_NOTFOUND,
+				T_MAIL_ERR_MAILBOX_NOT_FOUND(oldname));
 		}
 		return 0;
 	}
@@ -334,8 +334,8 @@
 			/* Note that if the mailbox didn't have LOOKUP
 			   permission, this not reveals to user the mailbox's
 			   existence. Can't help it. */
-			mailbox_list_set_error(list,
-					       MAILBOX_LIST_ERR_NO_PERMISSION);
+			mailbox_list_set_error(list, MAIL_ERROR_PERM,
+					       MAIL_ERRSTR_NO_PERMISSION);
 		}
 		return -1;
 	}

Index: acl-mailbox.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/acl/acl-mailbox.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- acl-mailbox.c	11 Apr 2007 11:02:31 -0000	1.6
+++ acl-mailbox.c	13 May 2007 17:11:01 -0000	1.7
@@ -48,7 +48,8 @@
 		return -1;
 	}
 
-	mail_storage_set_error(box->storage, MAILBOX_LIST_ERR_NO_PERMISSION);
+	mail_storage_set_error(box->storage, MAIL_ERROR_PERM,
+			       MAIL_ERRSTR_NO_PERMISSION);
 	return 0;
 }
 

Index: acl-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/acl/acl-storage.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- acl-storage.c	11 Apr 2007 19:33:37 -0000	1.7
+++ acl-storage.c	13 May 2007 17:11:01 -0000	1.8
@@ -110,11 +110,11 @@
 		if (ret < 0)
 			return NULL;
 		if (can_see) {
-			mail_storage_set_error(storage,
-					       MAILBOX_LIST_ERR_NO_PERMISSION);
+			mail_storage_set_error(storage, MAIL_ERROR_PERM,
+					       MAIL_ERRSTR_NO_PERMISSION);
 		} else {
-			mail_storage_set_error(storage,
-				MAILBOX_LIST_ERR_MAILBOX_NOT_FOUND, name);
+			mail_storage_set_error(storage, MAIL_ERROR_NOTFOUND,
+				T_MAIL_ERR_MAILBOX_NOT_FOUND(name));
 		}
 		return NULL;
 	}
@@ -145,8 +145,8 @@
 			/* Note that if the mailbox didn't have LOOKUP
 			   permission, this not reveals to user the mailbox's
 			   existence. Can't help it. */
-			mail_storage_set_error(storage,
-					       MAILBOX_LIST_ERR_NO_PERMISSION);
+			mail_storage_set_error(storage, MAIL_ERROR_PERM,
+					       MAIL_ERRSTR_NO_PERMISSION);
 		}
 		return -1;
 	}



More information about the dovecot-cvs mailing list