fix(riot): secure control master

This commit is contained in:
xiongdian.me 2024-04-16 21:31:04 +08:00
parent 36fd85121b
commit 500c3bdfe5

View File

@ -85,7 +85,11 @@ parse_remote() {
USERNAME="" # optional USERNAME="" # optional
SSH_OPTIONS="" # optional SSH_OPTIONS="" # optional
if [[ "$RIOT_TRUST_CLIENT" == "1" ]]; then if [[ "$RIOT_TRUST_CLIENT" == "1" ]]; then
SSH_OPTIONS='-o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes' SSH_OPTIONS='-o PermitLocalCommand=yes'
if [[ "$(get_os_type)" != "msys" ]]; then
mkdir -p ~/.ssh/master-socket
SSH_OPTIONS="$SSH_OPTIONS -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C"
fi
fi fi
# handle input # handle input
local remote="$1" local remote="$1"