Repository navigation
fix(file.flags): clear flags correctly on privileged path - #132
Merged
Merged
Conversation
Symbolic chflags(1) is additive: a name sets its flag, a no-prefixed name clears it, and unnamed flags are untouched. The privileged path assumed replace semantics, so it named the full desired set (removing a flag was a silent no-op) and passed "none" to clear everything, which chflags rejects with rc=1. - Add ungated atoms/file/bsd_flags.rs with symbolic_delta, naming only the managed flags that change (hidden/nohidden, uchg/nouchg) - Move UF_HIDDEN/UF_IMMUTABLE there; re-export from chflags - Tests run on Linux CI, including a proptest against simulated chflags semantics Verified on macOS 27.0.1: chflags nohidden clears only hidden, nodump survives hidden,nouchg, and chflags none exits 1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aux8gVLuPWbaZnmeza37Mu
Asserts the planned command is `chflags nohidden <path>` for a file with hidden set. Fails on the pre-fix code, which planned `chflags none`. Runs only on macOS, so it guards the action wiring that the Linux-run symbolic_delta tests cannot reach. Also backlogs two pre-existing macOS package tests that fail under a non-login shell. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aux8gVLuPWbaZnmeza37Mu
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
file.flagsprivileged path (privileged: true, macOS) the code assumedchflags(1)replaces every flag. It doesn't: symbolicchflagsis additive. Two symptoms followed:chflags none, which fails withinvalid flag: none(rc=1).symbolic_deltanames only the managed flags that change. It uses thenoprefix to clear a flag and never emitsnone.Changes
lib/src/atoms/file/bsd_flags.rscontains:symbolic_delta(current, desired) -> Option<String>.UF_HIDDENandUF_IMMUTABLE, moved here. The macOS-gatedchflagsmodule re-exports them.lib/src/actions/file/flags.rs:symbolic_delta.packagetests that were already non-hermetic.libc::chflagswith a bitmask, is unchanged.Test Plan
nohiddenclears onlyhidden.nodumpsurviveshidden,nouchg.hidden,nouchgandnouchg,hiddengive the same result on auchgfile.chflags noneexits with rc=1.desired). All run on Linux. They fail against the old logic, which emitsnoneand the full flag set, and pass on the fix.plan_clears_a_flag_with_no_prefix_when_privileged, run on the Studio: fails on the pre-fix code and passes on the fix. macOS clippy and fmt are clean.make teston Linux: 1136/1136 nextest, 64 pytest.Risk
Low. This code path only runs on macOS with
privileged: true, and no etch-config manifest usesfile.flagstoday. The new behaviour is strictly narrower: it touches only the bits that change, and flagsfile.flagsdoesn't manage are left alone.Definition of Done
Phase 3 gates:
sys/stat.h).Spec alignment
SKIP: no plan or spec (bug-fix-cycle normal mode).
Related
Reported by the ai-config session's claim-check sweep, which is correcting the cited memory
etch-cli-chflags-replaces-all-flagsseparately. Depends on #131, which unblockedcargo-auditon main.🤖 Generated with Claude Code
https://claude.ai/code/session_01Aux8gVLuPWbaZnmeza37Mu