From a18c16e19e5d89d7d8c6463da4b684969d0f226d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 3 Jul 2017 19:44:56 +0200 Subject: [PATCH] local: Ignore ENOTSUP error for chmod Closes: #1079 --- src/restic/backend/local/local_unix.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 }