Skip to content

ssh_wrap doesn't properly escape remote commands #923

@keysmashes

Description

@keysmashes

When you run a command like ssh user@host COMMAND..., SSH doesn't do any particular escaping of COMMAND (https://unix.stackexchange.com/q/397400/226269). If you run echo foo \> bar, you will see the output foo > bar, but if you run ssh user@host echo foo \> bar, you'll end up writing foo to a file called bar on the remote.

This affects configurations which use the submit_host setting: if an argument contains a character with special meaning like >, e.g. in an LSF resource request like -Rselect[mem>4000], the argument will get mangled and the job won't be submitted properly.

As a workaround, you can .shellescape everything you use as a native argument in submit.yml.erb, but that means the app will no longer work properly in configurations that aren't using submit_host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions