Skip to content

Fix backslash escapes for -o ssh_command#342

Open
jbellerb wants to merge 1 commit into
libfuse:masterfrom
jbellerb:push-yuvlrownurol
Open

Fix backslash escapes for -o ssh_command#342
jbellerb wants to merge 1 commit into
libfuse:masterfrom
jbellerb:push-yuvlrownurol

Conversation

@jbellerb
Copy link
Copy Markdown

The option previously supported escaping spaces with backslash, but this was broken at some point. Spaces are correctly skipped, but the backslashes are never removed. As a result, it is impossible to use commands with arguments that include spaces.

Note that escaping requires a double backslash. The first backslash is always removed by fuse_opt_parse's own escape handling.

The option previously supported escaping spaces with backslash, but
this was broken at some point. Spaces are correctly skipped, but the
backslashes are never removed. As a result, it is impossible to use
commands with arguments that include spaces.

Note that escaping requires a double backslash. The first backslash is
always removed by `fuse_opt_parse`'s own escape handling.
@abhinavagarwal07
Copy link
Copy Markdown
Collaborator

LGTM

Could you add a regression test in test/test_sshfs.py? Roughly: run sshfs with -f -o sshfs_debug -o ssh_command='/nonexistent/wrap\\ per arg\\ with\\ space' against a dummy user@host:/ target, capture stderr, and assert the executing … line contains <…/wrap per> and <arg with space> as single tokens with no surviving backslashes. The bogus ssh_command makes exec fail fast, so it doesn't need passwordless localhost. Doubling the backslashes matters — fuse_opt_parse eats one layer before tokenize_on_space sees the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants