Skip to content

config2setopts: always set the security options for SCP/SFTP - #22839

Closed
bagder wants to merge 5 commits into
masterfrom
bagder/ssh-opts-unconditional
Closed

bagder wants to merge 5 commits into
masterfrom
bagder/ssh-opts-unconditional

Conversation

@bagder

@bagder bagder commented Sep 5, 2026

Copy link
Copy Markdown
Member

No description provided.

@bagder
bagder force-pushed the bagder/ssh-opts-unconditional branch 2 times, most recently from dafdf24 to 4a9c0bb Compare September 5, 2026 20:31
@bagder

This comment was marked as resolved.

@bagder
bagder force-pushed the bagder/ssh-opts-unconditional branch from 25d0e1b to 12a0936 Compare September 5, 2026 21:56
@github-actions github-actions Bot added the tests label Sep 5, 2026
@bagder
bagder requested a lite review from Copilot September 5, 2026 21:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

ssh_setopts() gating and known-hosts fallback path handling currently introduce incorrect/non-portable behavior and cause SSH options to be emitted for non-SSH transfers.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates curl’s config2setopts SSH option handling to ensure SCP/SFTP security-related options (notably known-hosts handling) are always configured, and adjusts an existing --libcurl test fixture to tolerate newly emitted SSH options.

Changes:

  • Modified ssh_setopts() invocation/signature and its known-hosts fallback behavior in src/config2setopts.c.
  • Updated tests/data/test1679 to strip CURLOPT_SSH_KNOWNHOSTS from generated --libcurl output.
File summaries
File Description
src/config2setopts.c Alters when/how SSH-related libcurl options (known-hosts and hostkey settings) are applied during option setup.
tests/data/test1679 Updates --libcurl output normalization by stripping CURLOPT_SSH_KNOWNHOSTS.
Review details

Suppressed comments (1)

src/config2setopts.c:1046

  • protocol_setopts() was updated to call ssh_setopts(config, curl) without passing use_proto. If ssh_setopts is gated on use_proto (as it should be), this call site needs to pass it through so SSH options are only set for SCP/SFTP transfers.

  result = ssh_setopts(config, curl);
  if(setopt_bad(result))
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/config2setopts.c
Comment thread src/config2setopts.c
Comment thread tests/data/test1679
@bagder bagder closed this in 6ae9bef Sep 6, 2026
@bagder
bagder deleted the bagder/ssh-opts-unconditional branch September 6, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants