fix(start-os): use a private temp file for the login banner's db snapshot - #3615
Open
JesseMarkowitz wants to merge 1 commit into
Open
fix(start-os): use a private temp file for the login banner's db snapshot#3615JesseMarkowitz wants to merge 1 commit into
JesseMarkowitz wants to merge 1 commit into
Conversation
…shot The motd staged its `start-cli db dump` output at a fixed `/tmp/startos_db.json`. pam_motd runs the script as root at login, so that file is created root-owned; every later non-root invocation then fails to write it and the banner silently degrades to `Services: Unknown`, `WAN: N/A` and `NTP: Unknown`. It is also a predictable path in a world-writable directory. Use mktemp, and remove the file on every exit path — the previous code also leaked the snapshot when `start-cli` was absent or the dump failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wQBSdkk5GYtD3LAvCnaGJ
JesseMarkowitz
force-pushed
the
fix/motd-private-temp-file
branch
from
August 1, 2026 01:44
1511e2b to
9da42f1
Compare
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.
Problem
projects/start-os/build/lib/motdstaged itsstart-cli db dumpoutput at a fixed path:DB_DUMP="/tmp/startos_db.json"pam_motdruns the script as root at login, so that file is created root-owned. Every later non-root invocation then fails to write it, and the banner silently degrades toServices: Unknown,WAN: N/A,NTP: Unknown— the exact fieldsparse_essential_db_infoexists to fill.Reproduced on a 0.4.0.1 box as the
start9user:It is also a predictable path in a world-writable directory.
Fix
Use
mktemp, and remove the file on every exit path. The previous code also leaked the snapshot whenstart-cliwas absent or the dump failed — both of those returned without cleanup.Verification
Ran the script against a live 0.4.0.1 server with the blocking
/tmp/startos_db.jsonstill in place:Services: Unknown,WAN: N/A,NTP: UnknownServices: 5/5 running,WAN: 65.78.82.12,NTP: SyncedAlso exercised the two failure paths — server unreachable, and
start-clinot onPATH. Both degrade to the same banner as before and leave zero temp files behind.sh -nclean.Two things for a maintainer to confirm
Base branch.
CONTRIBUTING.mdsays to target anext/*branch when the latest release is not a pre-release, andstart-os/v0.4.0.1is tagged. Butnext/patchstill has the pre-monorepo layout (noprojects/), so this is based onmasterinstead. Happy to retarget.Changelog heading.
## [0.4.0.1]is a cut origin tag, so per the rootAGENTS.mdthis entry goes under a new heading —## [0.4.0.2]. I did not bump the manifests that heading is coupled to, because perVERSION_BUMP.mdan OS revision bump also requires a newversion/v0_4_0_2.rsmigration module and aCurrentchange, which is a release action rather than part of a bug fix. Say the word if you'd rather this land under a different heading.🤖 Generated with Claude Code
https://claude.ai/code/session_011wQBSdkk5GYtD3LAvCnaGJ