fix: check for scp early to avoid shell ouput
This commit is contained in:
parent
54e2ec2374
commit
80a3878295
@ -20,6 +20,11 @@ log() {
|
||||
|
||||
log info "Received SSH_ORIGINAL_COMMAND: $SSH_ORIGINAL_COMMAND"
|
||||
|
||||
if [[ "${SSH_ORIGINAL_COMMAND:-}" == "scp -t $ALLOWED_PATH" ]]; then
|
||||
eval "$SSH_ORIGINAL_COMMAND"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Ensure the variable is set
|
||||
if [[ -z "${SSH_ORIGINAL_COMMAND:-}" ]]; then
|
||||
log error "No SSH_ORIGINAL_COMMAND provided."
|
||||
@ -88,8 +93,7 @@ status)
|
||||
podman images
|
||||
;;
|
||||
scp)
|
||||
log info "Accepting scp upload to $ALLOWED_PATH"
|
||||
[[ "${args}" == "-t $ALLOWED_PATH" ]] && eval "$SSH_ORIGINAL_COMMAND" || log error "Invalid scp upload path: $args"
|
||||
log error "Invalid scp upload path: $args"
|
||||
;;
|
||||
*)
|
||||
log error "Unknown command: $command"
|
||||
|
Loading…
x
Reference in New Issue
Block a user