1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-06 10:33:34 +00:00

local, yandex, dropbox: fix NewObject suceeding on a directory #1079

Add tests to make it consistent across all remotes
This commit is contained in:
Nick Craig-Wood
2017-02-25 11:09:57 +00:00
parent 527099ae72
commit 79e3c67bbd
20 changed files with 66 additions and 34 deletions

View File

@@ -162,6 +162,9 @@ func (f *Fs) newObjectWithInfo(remote string, info os.FileInfo) (fs.Object, erro
return nil, err
}
}
if !o.info.Mode().IsRegular() {
return nil, errors.Wrapf(fs.ErrorNotAFile, "%q", remote)
}
return o, nil
}