Skip to content
Snippets Groups Projects
Commit f4af343b authored by Jürg Billeter's avatar Jürg Billeter
Browse files

sandbox/sandbox.py: Do not follow symlinks in _has_command()

This is required to ensure symlinks are not resolved on the host.
parent a7c17169
No related branches found
No related tags found
Loading
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment