mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
serve nfs: fix writing files via Finder on macOS - fixes #7503
Before this change, writing files to an `nfsmount` via Finder on macOS would cause critical errors, rendering `nfsmount` effectively unusable on macOS. This change fixes the issue so that writes via Finder should be possible. The issue was primarily caused by the handler's HandleLimit being set to -1. -1 is the correct default for a NullAuthHandler, but not for a CachingHandler, which interprets -1 not as "no limit" but as "no cache". This change sets a high default of 1000000, and gives the user control over it with a new --nfs-cache-handle-limit flag (available in both `serve nfs` and `nfsmount`. A minimum of 5 is enforced, as any lower than this will be insufficient to support directory listing.
This commit is contained in:
@@ -36,7 +36,7 @@ func NewServer(ctx context.Context, vfs *vfs.VFS, opt *Options) (s *Server, err
|
||||
ctx: ctx,
|
||||
opt: *opt,
|
||||
}
|
||||
s.handler = newHandler(vfs)
|
||||
s.handler = newHandler(vfs, opt)
|
||||
s.listener, err = net.Listen("tcp", s.opt.ListenAddr)
|
||||
if err != nil {
|
||||
fs.Errorf(nil, "NFS server failed to listen: %v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user