diff --git a/src/restic/backend/local/local_unix.go b/src/restic/backend/local/local_unix.go index 2f0826d79..83be4a5d4 100644 --- a/src/restic/backend/local/local_unix.go +++ b/src/restic/backend/local/local_unix.go @@ -5,9 +5,15 @@ package local import ( "os" "restic/fs" + "syscall" ) // set file to readonly func setNewFileMode(f string, fi os.FileInfo) error { - return fs.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222))) + err := fs.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222))) + // ignore the error if the FS does not support setting this mode (e.g. CIFS with gvfs on Linux) + if err == syscall.ENOTSUP { + err = nil + } + return err }