An empty users file converges a root-only box as silently as forgetting one #57
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#57
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An empty users file converges a root-only box as silently as forgetting one
Found by
claude-bot-andresmgslreviewing #54.The gap
#51 made
--usersrequired so that bootstrapping a box without decidingabout its people becomes impossible — the complete path is the default path,
and skipping it is a deliberate
--no-users.An empty or comments-only users file walks straight through that. It
passes pre-flight (the parser is happy — zero users is not a parse error),
apply converges nothing, and the box comes up root-only. Which is exactly
the outcome
--no-usersexists to make explicit, reached by the path thatwas supposed to guarantee the opposite.
So the ambiguity the required flag was built to kill survives in a narrower
form:
--users ./userswith an empty file and--no-usersproduce the samebox, but only one of them says so.
The sharper case
A truncated users file against a box that already has operators does not
just converge nothing — it revokes every one of them. That is apply's
documented and correct drop-semantics (expire the account, rename
authorized_keys, keep the home), and it warns per user, so it is loudrather than silent. But it is reached by a file that a moment's
>in thewrong place produces, on a command whose other failure modes were
deliberately made to fail before spending anything.
Proposed fix
Catch the zero-user parse in bootstrap's pre-flight — where the file is
already being parsed for validation, before apt, hostname, or key spend —
and refuse, naming
--no-usersas the way to say root-only out loud.Deliberately narrow: this is about
rig bootstrap's contract, notrig users apply's. A standalonerig users applyagainst an emptied fileis a real de-provisioning operation and must stay possible.
Open question
Does the same refusal belong on
rig users applyitself, at least as aconfirmation when the file is empty and the
/etc/rig/usersledger isnot? Revoking every operator on a box is a big enough action that "the file
was empty" is worth distinguishing from "the file said to remove them."
Filed as a question, not a proposal.
Context
Not a regression — #54 introduced the required flag, and this is the corner
it does not cover. Raised at review as non-blocking, deferred here rather
than restarting an approved round.