mirror of
https://github.com/restic/restic.git
synced 2025-08-12 14:47:41 +00:00
local/sftp: Remove unneeded stat() call
This commit is contained in:
@@ -348,14 +348,7 @@ func (r *SFTP) Save(ctx context.Context, h restic.Handle, rd io.Reader) (err err
|
||||
return errors.Wrap(err, "Close")
|
||||
}
|
||||
|
||||
// set mode to read-only
|
||||
fi, err := r.c.Lstat(filename)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Lstat")
|
||||
}
|
||||
|
||||
err = r.c.Chmod(filename, fi.Mode()&os.FileMode(^uint32(0222)))
|
||||
return errors.Wrap(err, "Chmod")
|
||||
return errors.Wrap(r.c.Chmod(filename, backend.Modes.File), "Chmod")
|
||||
}
|
||||
|
||||
// Load returns a reader that yields the contents of the file at h at the
|
||||
|
Reference in New Issue
Block a user