From 826d9b7a1dec011e4777b334af5f4dc4feebb64b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 27 Jun 2009 18:51:06 -0400 Subject: [PATCH] eacces_error_get(): Check also if user had write permissions to the given file. --HG-- branch : HEAD --- src/lib/eacces-error.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/eacces-error.c b/src/lib/eacces-error.c index dd65ddc093..49863b6f34 100644 --- a/src/lib/eacces-error.c +++ b/src/lib/eacces-error.c @@ -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?"); } -- 2.47.3