mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
backend/local: ignore chmod "not supported" errors
This commit is contained in:
@@ -43,5 +43,12 @@ func isMacENOTTY(err error) bool {
|
||||
|
||||
// set file to readonly
|
||||
func setFileReadonly(f string, mode os.FileMode) error {
|
||||
return os.Chmod(f, mode&^0222)
|
||||
err := os.Chmod(f, mode&^0222)
|
||||
|
||||
// ignore the error if the FS does not support setting this mode (e.g. CIFS with gvfs on Linux)
|
||||
if err != nil && errors.Is(err, errors.ErrUnsupported) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user