Loading a manifest now refuses an entry that records a mode above 0777, naming the path and the mode. The check sits beside the path and hash checks in deserializeInner (mfer/deserialize.go). Before, such a manifest loaded: check reported a file with exactly the recorded permission bits as MODE_MISMATCH, and freshen rewrote the mode as the permission bits alone without saying so. Now check, list, export, freshen and fetch all refuse it with one message, for example file entry has a mode above 0777: "a.txt" (04755).
fetchManifest (internal/cli/fetch.go) had its own check for this, which loading now makes first, so it is removed. Its test moves to TestDeserializeRefusesModeOutsidePermissionBits in the existing mfer/deserialize_path_test.go (package mfer), with both of its cases (04755, and setuid as Go keeps it in os.FileMode) and a third showing that 0777 loads. No new files.
docs/FORMAT.md File Mode now says a reader must reject a mode above 0777, instead of listing the refusal under fetch alone.
Not in the diff: downloadFile and alreadyPresent still use only the permission bits of a recorded mode, so TestDownloadFileSetsOnlyPermissionBits, which hands downloadFile an entry directly, stays. The README.md sentence saying fetch refuses such a manifest before downloading any file is still true and unchanged. No test fixture or fuzz seed records such a mode.
Judgement call: the error value keeps the name it had in fetch, errModeOutOfRange, and takes the wording of the other file entry errors.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/mfer/issues/225.
Loading a manifest now refuses an entry that records a mode above `0777`, naming the path and the mode. The check sits beside the path and hash checks in `deserializeInner` (`mfer/deserialize.go`). Before, such a manifest loaded: `check` reported a file with exactly the recorded permission bits as `MODE_MISMATCH`, and `freshen` rewrote the mode as the permission bits alone without saying so. Now `check`, `list`, `export`, `freshen` and `fetch` all refuse it with one message, for example `file entry has a mode above 0777: "a.txt" (04755)`.
`fetchManifest` (`internal/cli/fetch.go`) had its own check for this, which loading now makes first, so it is removed. Its test moves to `TestDeserializeRefusesModeOutsidePermissionBits` in the existing `mfer/deserialize_path_test.go` (package `mfer`), with both of its cases (`04755`, and setuid as Go keeps it in `os.FileMode`) and a third showing that `0777` loads. No new files.
`docs/FORMAT.md` File Mode now says a reader must reject a mode above `0777`, instead of listing the refusal under `fetch` alone.
Not in the diff: `downloadFile` and `alreadyPresent` still use only the permission bits of a recorded mode, so `TestDownloadFileSetsOnlyPermissionBits`, which hands `downloadFile` an entry directly, stays. The `README.md` sentence saying `fetch` refuses such a manifest before downloading any file is still true and unchanged. No test fixture or fuzz seed records such a mode.
Judgement call: the error value keeps the name it had in `fetch`, `errModeOutOfRange`, and takes the wording of the other file entry errors.
Model: opus-5-5
Loading accepted an entry recording a mode above 0777, such as 04755.
check then reported a file with exactly the recorded permission bits
as a mode mismatch, list and export printed the out-of-range mode, and
freshen silently rewrote it as the permission bits alone. Loading now
refuses such an entry, naming the path and the mode, so every command
that reads a manifest refuses it with one message. fetch's own check
for this could no longer be reached and is gone; its test moves to the
loading tests in package mfer. docs/FORMAT.md says readers reject a
mode above 0777.
Model: opus-5-5
Judgement call: the README.md sentence under mfer fetch saying a manifest recording a mode above 0777 is refused before any file is downloaded stays as it is. It is still true, and README.md lists no other load refusal under any command.
Judgement call: the error value name errModeOutOfRange is plain where it now lives, and its message has the same form as the other file entry errors.
Model: opus-5-5
Review passed.
Judgement call: the `README.md` sentence under `mfer fetch` saying a manifest recording a mode above `0777` is refused before any file is downloaded stays as it is. It is still true, and `README.md` lists no other load refusal under any command.
Judgement call: the error value name `errModeOutOfRange` is plain where it now lives, and its message has the same form as the other file entry errors.
Model: opus-5-5
clawbot
merged commit 31e22a9337 into next2026-10-15 22:02:55 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #225.
Loading a manifest now refuses an entry that records a mode above
0777, naming the path and the mode. The check sits beside the path and hash checks indeserializeInner(mfer/deserialize.go). Before, such a manifest loaded:checkreported a file with exactly the recorded permission bits asMODE_MISMATCH, andfreshenrewrote the mode as the permission bits alone without saying so. Nowcheck,list,export,freshenandfetchall refuse it with one message, for examplefile entry has a mode above 0777: "a.txt" (04755).fetchManifest(internal/cli/fetch.go) had its own check for this, which loading now makes first, so it is removed. Its test moves toTestDeserializeRefusesModeOutsidePermissionBitsin the existingmfer/deserialize_path_test.go(packagemfer), with both of its cases (04755, and setuid as Go keeps it inos.FileMode) and a third showing that0777loads. No new files.docs/FORMAT.mdFile Mode now says a reader must reject a mode above0777, instead of listing the refusal underfetchalone.Not in the diff:
downloadFileandalreadyPresentstill use only the permission bits of a recorded mode, soTestDownloadFileSetsOnlyPermissionBits, which handsdownloadFilean entry directly, stays. TheREADME.mdsentence sayingfetchrefuses such a manifest before downloading any file is still true and unchanged. No test fixture or fuzz seed records such a mode.Judgement call: the error value keeps the name it had in
fetch,errModeOutOfRange, and takes the wording of the other file entry errors.Model: opus-5-5
Review passed.
Judgement call: the
README.mdsentence undermfer fetchsaying a manifest recording a mode above0777is refused before any file is downloaded stays as it is. It is still true, andREADME.mdlists no other load refusal under any command.Judgement call: the error value name
errModeOutOfRangeis plain where it now lives, and its message has the same form as the other file entry errors.Model: opus-5-5