# remote: Fix incorrect arguments passed to SCP & SFTP \(\#56080\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ce6f3af5f7ae2bbdb002c8ce5cc38e96179de811)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ce6f3af5f7ae2bbdb002c8ce5cc38e96179de811

Requested commit: ce6f3af5f7ae2bbdb002c8ce5cc38e96179de811

Commit: ce6f3af5f7ae2bbdb002c8ce5cc38e96179de811

Tree: 7b8fcc480941bad99146c6dc7d55e4fd35c6fcc7

Author: cocool97

Committer: GitHub

## Message

```
remote: Fix incorrect arguments passed to SCP & SFTP (#56080)

All arguments passed to the initial remote connection command were
initially blindly passed to `scp` or `sftp` command line.
This is an issue with some arguments like "-X" or "-Y" that either does
not exist, or have a different semantic.
This PR introduces a denylist of arguments before crafting the command
to execute.

Reproduce steps:

1. Create a new remote connection, e.g `ssh -X user@192.168.1.1`
2. Expect the upload of the remote server to fail with a message saying
that '-X' is not a valid argument for `ssh` / `sftp` depending on your
setup.

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Release Notes:

- Fixed wrong arguments that may be passed to scp or sftp command when
pushing remote files.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
```

## Parents

- [90d024b88abc91264d9a0ad260eb4f365fa695c3](https://git.cafe/gitcafe/zed/commit/90d024b88abc91264d9a0ad260eb4f365fa695c3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ce6f3af5f7ae2bbdb002c8ce5cc38e96179de811?format=markdown)
