Mercurial > dovecot > core-2.2
changeset 9534:8760bc0b1c3a HEAD
eacces_error_get(): Check also if user had write permissions to the given file.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 27 Jun 2009 18:51:06 -0400 |
parents | 530bbade4e3f |
children | bbe4c24faf21 |
files | src/lib/eacces-error.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/eacces-error.c Fri Jun 26 16:11:59 2009 -0400 +++ b/src/lib/eacces-error.c Sat Jun 27 18:51:06 2009 -0400 @@ -135,6 +135,12 @@ test_access(path, R_OK, errmsg) < 0) { if (errno == EACCES) str_printfa(errmsg, " missing +r perm: %s", path); + } else if (!creating && test_access(path, W_OK, errmsg) < 0) { + /* this produces a wrong error if the operation didn't + actually need write permissions, but we don't know + it here.. */ + if (errno == EACCES) + str_printfa(errmsg, " missing +w perm: %s", path); } else str_printfa(errmsg, " UNIX perms seem ok, ACL problem?"); }