aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/System/Unix/Path.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index e55d9edcf2..ce0e49127e 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -311,6 +311,10 @@ Path::writable() const {
bool
Path::executable() const {
+ struct stat st;
+ int r = stat(path.c_str(), &st);
+ if (r != 0 || !S_ISREG(st.st_mode))
+ return false;
return 0 == access(path.c_str(), R_OK | X_OK );
}