Skip to content

FINGERPRINT-PLAN: F3's laptop mfg_data copy is private from creation - #531

Merged
derekross merged 1 commit into
derekross:mainfrom
only21mil:build/fp-f3-mfg-copy-private
Nov 9, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
only21mil:build/fp-f3-mfg-copy-private

Conversation

@only21mil

@only21mil only21mil commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Follow-up to Derek's two optional suggestions on #520, in device/cheetah/FINGERPRINT-PLAN.md F3 (the laptop copy of mfg_data):

  • The redirect now runs inside (umask 077; ...), so the copy is created private instead of being made private afterwards. chmod 600 is dropped: the file is only ever created under that umask, and mv keeps its mode.
  • The copy goes to "$F.part" and is renamed to "$F" only when the remote command exits 0 (tools/phone-ssh passes the exit status through) and mv -T succeeds. If either step fails, the failure branch removes the .part and prints "refused or failed; no file kept"; an interruption can leave the .part behind. Before, a refused ro=1 check left an empty file.
  • Expect says a refused or failed copy keeps no file; the Stop line still covers a refused, failed or empty copy and a hash mismatch.

The phone side is unchanged and read-only: PARTNAME lookup, the ro=1 check, dd with no of=.

Tested on the laptop only, with the snippet taken from the plan and a fake phone-ssh that runs its remote script on a fake sysfs: success leaves one mode-600 file with the source's bytes; a refused ro=0, an unreadable device, a dd that dies mid-copy and a missing partition each leave no file. The #520 snippet, for comparison, left a 0-byte file on refusal.

Device and build

  • Phone: none: docs only
  • Kernel release (uname -r): n/a
  • Packages changed, with versions: none

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages passes (or the packages I touched: none)
  • Each changed package has its version bumped, and the new version is in the commit subject (no package changed)
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build: no, docs only
  • Runbook steps passed (plan, step, result): none run
  • What I did not test: F3 on a real phone; the snippet was tested on the laptop with a fake remote only
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)
tools/phone-smoke report

Not applicable: a docs-only change (CONTRIBUTING.md §6.5).

Generated with Claude Opus 5.5 in T3 Code Nightly

Follow-up to Derek's two optional suggestions on derekross#520.

F3's laptop copy of mfg_data was created with the default umask and
made private only afterwards by chmod 600, and when the phone's ro=1
check refused (or dd failed) the redirect had already left an empty
file behind. The copy is now created under (umask 077; ...) as
"$F.part" and renamed to "$F" only when the remote command exits 0;
otherwise the .part is removed and the step says so. chmod 600 is
dropped: the file is only ever created under umask 077, and mv keeps
its mode. The Expect and Stop lines say a refused or failed copy keeps
no file. The phone side is unchanged and read-only: PARTNAME lookup,
the ro=1 check, dd with no of=.

Tested on the laptop with the snippet taken from the plan and a fake
phone-ssh running its remote script on a fake sysfs: success leaves
one mode-600 file matching the source, and a refused ro=0, an
unreadable device, a dd that dies mid-stream and a missing partition
each leave no file. The derekross#520 snippet left a 0-byte file on refusal.

Docs only; nothing ran on a phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, Victor: quick, and exactly what I had in mind. The copy is private from the moment it exists, and a refused or failed read now leaves nothing behind instead of an empty file that looks like a backup. I checked that phone-ssh passes the remote status through (it ends in exec ssh), so the rename really happens only on success. Merging.

@derekross
derekross merged commit 1ef208b into derekross:main Nov 9, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…erekross#531)

Follow-up to Derek's two optional suggestions on derekross#520.

F3's laptop copy of mfg_data was created with the default umask and
made private only afterwards by chmod 600, and when the phone's ro=1
check refused (or dd failed) the redirect had already left an empty
file behind. The copy is now created under (umask 077; ...) as
"$F.part" and renamed to "$F" only when the remote command exits 0;
otherwise the .part is removed and the step says so. chmod 600 is
dropped: the file is only ever created under umask 077, and mv keeps
its mode. The Expect and Stop lines say a refused or failed copy keeps
no file. The phone side is unchanged and read-only: PARTNAME lookup,
the ro=1 check, dd with no of=.

Tested on the laptop with the snippet taken from the plan and a fake
phone-ssh running its remote script on a fake sysfs: success leaves
one mode-600 file matching the source, and a refused ro=0, an
unreadable device, a dd that dies mid-stream and a missing partition
each leave no file. The derekross#520 snippet left a 0-byte file on refusal.

Docs only; nothing ran on a phone.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants