parent
5a6d233924
commit
6b158f33a3
1 changed files with 7 additions and 1 deletions
|
@ -135,7 +135,13 @@ func (c *conn) execCommand(ctx context.Context, out io.Writer, command string) (
|
||||||
return fmt.Errorf("send output failed: %w", err)
|
return fmt.Errorf("send output failed: %w", err)
|
||||||
}
|
}
|
||||||
case "echo":
|
case "echo":
|
||||||
// special cases for rclone command detection
|
// Special cases for legacy rclone command detection.
|
||||||
|
// Before rclone v1.49.0 the sftp backend used "echo 'abc' | md5sum" when
|
||||||
|
// detecting hash support, but was then changed to instead just execute
|
||||||
|
// md5sum/sha1sum (without arguments), which is handled above. The following
|
||||||
|
// code is therefore only necessary to support rclone versions older than
|
||||||
|
// v1.49.0 using a sftp remote connected to a rclone serve sftp instance
|
||||||
|
// running a newer version of rclone (e.g. latest).
|
||||||
switch args {
|
switch args {
|
||||||
case "'abc' | md5sum":
|
case "'abc' | md5sum":
|
||||||
if c.vfs.Fs().Hashes().Contains(hash.MD5) {
|
if c.vfs.Fs().Hashes().Contains(hash.MD5) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue