-
-
Notifications
You must be signed in to change notification settings - Fork 860
Open
Labels
bugSomething isn't workingSomething isn't working
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration issue.
- This issue is not already reported on Github (I've searched it).
Bug description
If a file is renamed to a filename that already exists, the existing file is overwritten.
Steps to reproduce
- upload a file 250919081509_Scans.csv with contents "version1".
- upload a file 250919081509_Scans.tmp with contents "version2".
- rename 250919081509_Scans.tmp to 250919081509_Scans.csv (with no flags configured)
- observe that the contents of 250919081509_Scans.csv is now "version2".
Expected behavior
According the specifications, https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13:
If flags does not include SSH_FXP_RENAME_OVERWRITE, and there already exists a file with the name specified by newpath, the server MUST respond with SSH_FX_FILE_ALREADY_EXISTS.
I've compared this behaviour with another SFTP server (https://www.rebex.net/tiny-sftp-server/, and that returns "SftpStatusError: Already exists. (code 4).
SFTPGo version
2.6.6 6825db7
Data provider
sqlite
Installation method
Other
Configuration
I've made no customisations ("rename_mode": 0)
Relevant log output
{"level":"info","time":"2025-09-19T08:17:47.236","sender":"Rename","local_addr":"192.168.1.100:2022","remote_addr":"192.168.1.166:59790","username":"aswh","file_path":"/Users/johannesroest/sftpgo/aswh/250919081509_Scans.tmp","target_path":"/Users/johannesroest/sftpgo/aswh/250919081509_Scans.csv","filemode":"","uid":-1,"gid":-1,"access_time":"","modification_time":"","size":-1,"elapsed":0,"ssh_command":"","connection_id":"SFTP_296927a2436c73a94a267088a2b11a51f57757749cd6eaaf46ab1f5487b1bedb_1","protocol":"SFTP"}
What are you using SFTPGo for?
Medium business
Additional info
Installed with 'brew' on macOS. I use SFTPGO for development purposes.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working