From 11854af05fa3feb3529f4096b2702ac2e5d483d1 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Wed, 20 Apr 2005 15:33:22 +0000 Subject: [PATCH] Do not mark directories as `executable', we only want program files Patch by Markus Oberhumer. llvm-svn: 21377 --- lib/System/Unix/Path.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index e55d9edcf2c..ce0e49127e0 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 ); }