Commit 81f37c2f authored by Jim MacArthur's avatar Jim MacArthur
Browse files

sandbox.py: Use _root in _has_command

This will need more attention when we bring in another virtual
directory backend, however, we've said it is acceptable for the
sandbox itself to access the underlying directory, and this is
the best fix in the meantime.
parent 24ab0a38
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -316,11 +316,11 @@ class Sandbox():
    def _has_command(self, command, env=None):
        if os.path.isabs(command):
            return os.path.exists(os.path.join(
                self.get_directory(), command.lstrip(os.sep)))
                self._root, command.lstrip(os.sep)))

        for path in env.get('PATH').split(':'):
            if os.path.exists(os.path.join(
                    self.get_directory(), path.lstrip(os.sep), command)):
                    self._root, path.lstrip(os.sep), command)):
                return True

        return False