]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
eacces_error_get(): Check also if user had write permissions to the given file.
authorTimo Sirainen <tss@iki.fi>
Sat, 27 Jun 2009 22:51:06 +0000 (18:51 -0400)
committerTimo Sirainen <tss@iki.fi>
Sat, 27 Jun 2009 22:51:06 +0000 (18:51 -0400)
--HG--
branch : HEAD

src/lib/eacces-error.c

index dd65ddc0934fb0a6619f52bbd7d854fba48e5835..49863b6f34a10f60f20cc2ff8cbad78c2fb1471e 100644 (file)
@@ -135,6 +135,12 @@ eacces_error_get_full(const char *func, const char *path, bool creating)
                           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?");
        }