PowerShell / PowerShell/Win32-OpenSSH

SFTP rename file to the same name deletes the file

Open
#1,849 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Troubleshooting steps

  • open sftp session to the server
  • traverse into the right folder
  • rename the file to the same name like 'rename A.txt A.txt'

"OpenSSH for Windows" version
7.7.2.2

Server OperatingSystem
Windows Server 2019 Standard

Client OperatingSystem
Windows Server 2019 Standard

What is failing
Rename fails and deletes the file at the same time

Expected output

Actual output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names no source file or test. Reproduce the issue with an SFTP session on the stated Windows versions using rename A.txt A.txt, then trace the rename handling and add coverage for the same-name case. Done means the command no longer deletes the existing file.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.