feat(envd): reject watching paths on network filesystems - #1810
Merged
Merged
Conversation
Prevent file watching on NFS, CIFS, SMB, and FUSE mounts by detecting the filesystem type via statfs. Returns FailedPrecondition error to clients. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
mishushakov
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
January 29, 2026 17:55
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d8c0ab3ee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Extract IsNetworkFilesystemType helper and add table-driven tests verifying all supported magic numbers (NFS, CIFS, SMB, SMB2, FUSE) and common non-network filesystems (ext4, tmpfs, overlay, xfs). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Replace unit tests with an integration test that creates an actual FUSE mount using bindfs to verify network filesystem detection works correctly. Test skips if bindfs/fusermount are not available. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Use exec.CommandContext instead of exec.Command and add t.Parallel(). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
mishushakov
commented
Jan 29, 2026
- Add setup step to install bindfs in CI for envd tests - Change test to fail instead of skip if dependencies missing Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
mishushakov
commented
Jan 29, 2026
djeebus
reviewed
Jan 29, 2026
djeebus
approved these changes
Jan 29, 2026
- Change error code from FailedPrecondition to InvalidArgument - Remove bindfs setup step from CI (test skips if not available) - Revert test to skip instead of fail when bindfs missing Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
mishushakov
enabled auto-merge (squash)
January 29, 2026 19:04
mishushakov
added a commit
that referenced
this pull request
Jun 12, 2026
## Summary - Adds an `allow_network_mounts` field to `WatchDirRequest` and `CreateWatcherRequest` so clients can explicitly opt into watching paths on network filesystem mounts (NFS, CIFS, SMB, FUSE), which are rejected by default since #1810. - The streaming (`WatchDir`) and non-streaming (`CreateWatcher`) handlers skip the network-mount rejection when the flag is set; default behavior is unchanged. - Regenerates the filesystem proto code in envd and shared, and bumps envd to 0.6.4. ## Test Plan - Added `TestCreateWatcherOnNetworkMount` (bindfs FUSE mount, Linux-only) verifying the watcher is rejected without the flag and created with it; existing filesystem watch tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.
Summary
Prevent envd from watching files on network filesystem mounts (NFS, CIFS, SMB, FUSE) by detecting the filesystem type via
statfsand returning aFailedPreconditionerror to clients before attempting to create a watcher.Changes
IsPathOnNetworkMount()utility function usingsyscall.StatfsWatchDir) and non-streaming (CreateWatcher) watch endpointsTest Plan
🤖 Generated with Claude Code
Note
Medium Risk
Changes request validation for watcher creation and can reject paths that were previously allowed, potentially impacting clients relying on watching network-mounted directories; also adds a CI dependency on FUSE tooling.
Overview
envdnow blocks directory watch creation when the target path resides on a network-backed filesystem (NFS/CIFS/SMB/FUSE), by addingIsPathOnNetworkMount()(viastatfs) and applying the check in both streaming (WatchDir) and non-streaming (CreateWatcher) watch endpoints.Adds unit tests including a FUSE-based case using
bindfs, and updates the PR test workflow to installbindfsforpackages/envdso the new test can run in CI.Written by Cursor Bugbot for commit f17e5b9. This will update automatically on new commits. Configure here.