dovecot-1.2: Fixes to handling +w permission errors and use it m...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Jan 16 21:21:33 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/97a350198a4f
changeset: 8643:97a350198a4f
user: Timo Sirainen <tss at iki.fi>
date: Fri Jan 16 14:21:25 2009 -0500
description:
Fixes to handling +w permission errors and use it more often.
diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
src/lib-storage/index/mbox/mbox-storage.c | 6 +++---
src/lib-storage/mail-error.c | 10 +++++-----
diffs (48 lines):
diff -r dd53d40a2f09 -r 97a350198a4f src/lib-storage/index/mbox/mbox-storage.c
--- a/src/lib-storage/index/mbox/mbox-storage.c Fri Jan 16 12:45:06 2009 -0500
+++ b/src/lib-storage/index/mbox/mbox-storage.c Fri Jan 16 14:21:25 2009 -0500
@@ -266,7 +266,7 @@ static const char *create_root_dir(struc
path = t_strconcat(home, "/mail", NULL);
if (mkdir_parents(path, CREATE_MODE) < 0 && errno != EEXIST) {
- *error_r = t_strdup_printf("mkdir(%s) failed: %m", path);
+ *error_r = mail_error_create_eacces_msg("mkdir", path);
return NULL;
}
@@ -362,8 +362,8 @@ mbox_get_list_settings(struct mailbox_li
return -1;
} else if (mkdir_parents(list_set->root_dir, CREATE_MODE) < 0 &&
errno != EEXIST) {
- *error_r = t_strdup_printf("mkdir(%s) failed: %m",
- list_set->root_dir);
+ *error_r = mail_error_create_eacces_msg("mkdir",
+ list_set->root_dir);
return -1;
}
}
diff -r dd53d40a2f09 -r 97a350198a4f src/lib-storage/mail-error.c
--- a/src/lib-storage/mail-error.c Fri Jan 16 12:45:06 2009 -0500
+++ b/src/lib-storage/mail-error.c Fri Jan 16 14:21:25 2009 -0500
@@ -77,16 +77,16 @@ mail_error_eacces_msg_full(const char *f
str_printfa(errmsg, " missing +x perm: %s", dir);
else
str_printfa(errmsg, " access(%s, x) failed: %m", dir);
+ } else if (creating && access(dir, W_OK) < 0) {
+ if (errno == EACCES)
+ str_printfa(errmsg, " missing +w perm: %s", dir);
+ else
+ str_printfa(errmsg, " access(%s, w) failed: %m", dir);
} else if (prev_path == path && access(path, R_OK) < 0) {
if (errno == EACCES)
str_printfa(errmsg, " missing +r perm: %s", path);
else
str_printfa(errmsg, " access(%s, r) failed: %m", path);
- } else if (creating && access(dir, W_OK) < 0) {
- if (errno == EACCES)
- str_printfa(errmsg, " missing +w perm: %s", dir);
- else
- str_printfa(errmsg, " access(%s, w) failed: %m", dir);
} else
str_printfa(errmsg, " UNIX perms seem ok, ACL problem?");
}
More information about the dovecot-cvs
mailing list