From a9a8c1b65b1b95fd1d03daa4b03db44016dc2bc3 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 --- llvm/lib/System/Unix/Path.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index e55d9edcf2c8..ce0e49127e09 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/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 ); }