1
mirror of https://github.com/rclone/rclone synced 2024-11-14 13:36:24 +01:00

Ignore files with control characters in the names - fixes #689

This commit is contained in:
Nick Craig-Wood 2016-10-18 15:24:29 +01:00
parent d8d11023d3
commit 368cce93ff

View File

@ -539,6 +539,13 @@ func (o *Object) SetModTime(modTime time.Time) error {
// Storable returns a boolean showing if this object is storable
func (o *Object) Storable() bool {
// Check for control characters in the remote name and show non storable
for _, c := range o.Remote() {
if c >= 0x00 && c < 0x20 || c == 0x7F {
fs.Debug(o.fs, "Can't store file with control characters: %q", o.Remote())
return false
}
}
mode := o.info.Mode()
// On windows a file with os.ModeSymlink represents a file with reparse points
if runtime.GOOS == "windows" && (mode&os.ModeSymlink) != 0 {