mirror of
https://github.com/rclone/rclone.git
synced 2026-10-28 06:18:39 -04:00
sftp: fix hash check for names starting with "-" with relative --sftp-path-override
With a relative path override such as `--sftp-path-override @.` (useful on chrooted hosting where the SSH shell starts in the directory that SFTP shows as "/"), a file in the root gets the shell path "-name". `quoteOrEscapeShellPath` does not escape "-", so the hash command became `md5sum -name`, which md5sum parses as an option. The hash then failed and the transfer was reported as "corrupted on transfer". Absolute shell paths always start with "/", so only relative overrides were affected. Prefix such paths with "./".
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f