diff src/lib/eacces-error.c @ 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 e22e36a61fdd
children b373de4973cd
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?");
 	}