summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-01-28 21:38:54 +0000
committerJürg Billeter <j@bitron.ch>2019-02-11 05:12:25 +0000
commitf95e222e49e7dd6f05634e209a03856960332374 (patch)
tree3761ffe0ae9e7ef78fa53c989df68fbe79d2afc3
parent99e1be4580244193149d1f123f6d948b0e0604a9 (diff)
downloadbuildstream-f95e222e49e7dd6f05634e209a03856960332374.tar.gz
sandbox/sandbox.py: Do not follow symlinks in _has_command()
This is required to ensure symlinks are not resolved on the host.
-rw-r--r--buildstream/sandbox/sandbox.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/sandbox/sandbox.py b/buildstream/sandbox/sandbox.py
index cb6f43314..2159c0fef 100644
--- a/buildstream/sandbox/sandbox.py
+++ b/buildstream/sandbox/sandbox.py
@@ -525,11 +525,11 @@ class Sandbox():
# (bool): Whether a command exists inside the sandbox.
def _has_command(self, command, env=None):
if os.path.isabs(command):
- return os.path.exists(os.path.join(
+ return os.path.lexists(os.path.join(
self._root, command.lstrip(os.sep)))
for path in env.get('PATH').split(':'):
- if os.path.exists(os.path.join(
+ if os.path.lexists(os.path.join(
self._root, path.lstrip(os.sep), command)):
return True