From 8177bf8904be3906781e66e41980d01dc7ce1bbe 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21377 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 ); } -- 2.34.1