3
26
Fork
You've already forked mere
1

Allow rootless mere store init #85

Merged
jhuntwork merged 1 commit from fix/rootless-store-init into main 2026年07月02日 18:42:11 +02:00

mere store init gated on uid 0 and unconditionally chowned every
directory to root:root. With a user-writable MERE_ROOT this gating
contributed nothing (filesystem permissions already control access)
but it blocked rootless installs entirely.

  • Drop the uid 0 check in init.initialize(). Filesystem permissions
    gate access: if you can write to the prefix, init succeeds; if not,
    the filesystem returns EACCES at the failing operation.
  • Drop setOwnership() calls from fixDirectory(). Files inherit
    ownership from whoever invoked mere store init: root if run with
    sudo, the invoking user otherwise.
  • Stop flagging wrong_ownership in checkDirectory(). Ownership is
    informational only; mere does not manage it from this code path.
  • Update --root help text to clarify it is the install prefix and the
    store lands at /mere/.

Verified end-to-end against /tmp/mere-test as a non-root user:

  • mere --root /tmp/mere-test store init creates 18 user-owned dirs
  • mere --root /tmp/mere-test profile create test succeeds
  • mere --root /tmp/mere-test install -p test busybox downloads,
    signature-verifies, extracts to store, materializes profile
  • Profile binary runs without sudo
`mere store init` gated on uid 0 and unconditionally chowned every directory to root:root. With a user-writable MERE_ROOT this gating contributed nothing (filesystem permissions already control access) but it blocked rootless installs entirely. - Drop the uid 0 check in `init.initialize()`. Filesystem permissions gate access: if you can write to the prefix, init succeeds; if not, the filesystem returns EACCES at the failing operation. - Drop `setOwnership()` calls from `fixDirectory()`. Files inherit ownership from whoever invoked `mere store init`: root if run with sudo, the invoking user otherwise. - Stop flagging `wrong_ownership` in `checkDirectory()`. Ownership is informational only; mere does not manage it from this code path. - Update --root help text to clarify it is the install prefix and the store lands at <prefix>/mere/. Verified end-to-end against /tmp/mere-test as a non-root user: - `mere --root /tmp/mere-test store init` creates 18 user-owned dirs - `mere --root /tmp/mere-test profile create test` succeeds - `mere --root /tmp/mere-test install -p test busybox` downloads, signature-verifies, extracts to store, materializes profile - Profile binary runs without sudo
Allow rootless mere store init
All checks were successful
/ test (pull_request) Successful in 6m32s
f7762666c7
`mere store init` gated on uid 0 and unconditionally chowned every
directory to root:root. With a user-writable MERE_ROOT this gating
contributed nothing (filesystem permissions already control access)
but it blocked rootless installs entirely.
- Drop the uid 0 check in `init.initialize()`. Filesystem permissions
 gate access: if you can write to the prefix, init succeeds; if not,
 the filesystem returns EACCES at the failing operation.
- Drop `setOwnership()` calls from `fixDirectory()`. Files inherit
 ownership from whoever invoked `mere store init`: root if run with
 sudo, the invoking user otherwise.
- Stop flagging `wrong_ownership` in `checkDirectory()`. Ownership is
 informational only; mere does not manage it from this code path.
- Update --root help text to clarify it is the install prefix and the
 store lands at <prefix>/mere/.
Verified end-to-end against /tmp/mere-test as a non-root user:
- `mere --root /tmp/mere-test store init` creates 18 user-owned dirs
- `mere --root /tmp/mere-test profile create test` succeeds
- `mere --root /tmp/mere-test install -p test busybox` downloads,
 signature-verifies, extracts to store, materializes profile
- Profile binary runs without sudo
jhuntwork deleted branch fix/rootless-store-init 2026年07月02日 18:42:12 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
merelinux/mere!85
Reference in a new issue
merelinux/mere
No description provided.
Delete branch "fix/rootless-store-init"

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?