# HG changeset patch # User Robert Jones # Date 2011-08-24 09:42:41 # Node ID 8413916df8167ca71d82284056fdf171be0694af # Parent 7c03e3b1b858e078880abc872a36dd8d4d2f93c7 posix: check for executable bits on files identified by findexe function diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -256,7 +256,9 @@ def findexe(command): for path in os.environ.get('PATH', '').split(os.pathsep): executable = findexisting(os.path.join(path, command)) if executable is not None: - return executable + st = os.stat(executable) + if (st.st_mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)): + return executable return None def setsignalhandler():