Conversation
The builtin driver used sftp.NewServer, which serves the whole host file system to the guest. On Linux and macOS hosts, it now uses sftp.NewRequestServer with handlers rooted at LocalPath: reads go through os.Root, and writes open each parent directory with O_NOFOLLOW, so they never follow a symlink. A path outside the root gets EACCES. Windows keeps sftp.NewServer. Setting the mode fails on a symlink, on macOS as on Linux. On Linux kernels without fchmodat2 (< 6.6), it goes through /proc/self/fd of an O_PATH fd, as glibc does, so it needs no read permission. ReadonlyNames makes a path read-only when any of its components matches one of these names, compared case-insensitively and ignoring the code points that HFS+ ignores, as git does. For example, [".git"] keeps the working tree writable while hooks and config stay read-only. Setting ReadonlyNames selects the builtin driver in auto mode, and fails with the OpenSSH driver or on Windows. Setting the times of a read-only name to its current mtime is a no-op that succeeds, because this is how the Lima guest agent triggers IN_ATTRIB for host changes (mountInotify). Addresses lima-vm#6 for Linux and macOS hosts. Assisted-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Sylvain Zimmer <sylvain@sylvainzimmer.com>
This was referenced Sep 23, 2026
Member
Originally posted by @AkihiroSuda in lima#5529 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #6 for Linux and macOS hosts (Windows keeps sftp.NewServer).
Needed for lima-vm/lima#5529
ReadonlyNamesfield: paths with a matching component are read-only (case-insensitive, HFS+ ignorable code points handled as in git).Tested:
Assisted-by: Claude Opus 5.5 (1M context)