Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

venv: do not prepend a truncated shebang interpreter #2203

Merged
merged 2 commits into from Sep 16, 2021
Merged

venv: do not prepend a truncated shebang interpreter #2203

merged 2 commits into from Sep 16, 2021

Commits on Sep 10, 2021

  1. venv: do not prepend a truncated shebang interpreter

    When a user invokes a `tox` call with `TOX_LIMITED_SHEBANG` set, any
    shebang-based scripts will have their interpreter's extracted and
    explicitly executed. An issue with the initial implementation is that if
    the configured interpreter is truncated to a path of another executable,
    the wrong executable can be invoked instead (see also [1][2]). To
    prevent this, an extra byte is read to ensure the length of the
    extracted interpreter is within the configured limit (MAXINTERP);
    otherwise the call will know the interpreter has been truncated and will
    fallback onto the original argument list.
    
    [1]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/binfmt_script.c?id=8099b047ecc431518b9bb6bdbba3549bbecdc343
    [2]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/binfmt_script.c?id=b5372fe5dc84235dbe04998efdede3c4daa866a9
    
    Signed-off-by: James Knight <james.d.knight@live.com>
    jdknight committed Sep 10, 2021
    Copy the full SHA
    0124736 View commit details
    Browse the repository at this point in the history
  2. cleanup shebang-related comments/documentation

    Signed-off-by: James Knight <james.d.knight@live.com>
    jdknight committed Sep 10, 2021
    Copy the full SHA
    a95f08f View commit details
    Browse the repository at this point in the history