Skip to content

Keep dev-link configuration readable under restrictive umasks - #14948

Closed
DanielJBurbridge wants to merge 1 commit into
omacom:quattrofrom
DanielJBurbridge:fix/dev-config-readable
Closed

DanielJBurbridge wants to merge 1 commit into
omacom:quattrofrom
DanielJBurbridge:fix/dev-config-readable

Conversation

@DanielJBurbridge

@DanielJBurbridge DanielJBurbridge commented Oct 11, 2026 •

Copy link
Copy Markdown

omarchy dev link and omarchy dev unlink write /etc/omarchy.conf using sudo tee. With a restrictive privileged umask, a newly created file is mode 0600, so ordinary shells and the uwsm session cannot source it. Rewriting an existing mode-0600 file with tee also leaves it unreadable.

Use install -T to write the generated OMARCHY_PATH export root-owned with mode 0644. The generated payload contains no credential fields. File symlinks, hardlinks and directory symlinks are replaced without changing their referents; a real directory at the fixed config path is refused. Previous contents are replaced rather than made readable.

Regression tests cover missing files, existing mode-0600 files, file/directory symlinks and hardlinks under umask 077. They verify generated contents, unchanged referent contents/modes, directory refusal, no later sudoers operation after write failure, and explicit mode/ownership arguments. Privileged writes are mapped to disposable files while the tests execute real GNU install.

Validation on the final rebased commit:

  • bash test/shell.d/dev-link-test.sh, dev-unlink-test.sh and dev-env-path-test.sh pass.
  • Bash syntax checks and git diff --check pass.
  • Both changed regression suites fail against the original commands and pass with this change.
  • Independent review passed, including separate destination-link fixtures.

./test/all was attempted with no graphical session and a disposable home/runtime, bounded to 300 seconds. It exited 124 after starting 181 of 380 shell suites and reporting seven failed assertions. The full suite did not pass or complete.

All seven reported assertions were reproduced on unchanged base 04b374a989c49bdeda72542f194106ea0c3da3ff in a bounded confirmation run:

  • Agent-account private-browser login when the disposable runtime directory is missing. This suite passes when the directory exists.
  • Browser handoff acknowledgement.
  • Missing omarchy-pkgs checkout for package coverage.
  • Grok migration package removal.
  • Elsewhen old-cache removal.
  • Elsewhen pointer tests.
  • Factory-reset account staging.

Cache paths stayed in disposable fixtures during confirmation. These failures predate the patch; the incomplete aggregate result remains a validation limitation. No live configuration, privileged installation or reboot testing was performed.

The three focused suites, Bash syntax checks and whitespace check passed again on 13 October 2026 against unchanged head a742edef41db862da7c63f733b240bcf932e24f9. The aggregate-suite limitation above remains.

@DanielJBurbridge
DanielJBurbridge marked this pull request as ready for review October 13, 2026 12:42
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Both development commands now write /etc/omarchy.conf with install, using mode 0644 and root ownership.

  • Dev link and unlink keep the shared config readable under strict umasks.

Reviews (1) · Last reviewed commit: "Keep dev-link configuration readable und..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. I've read the change, but it isn't classified or verified yet, so it has no labels.

What I checked: I read the diff at a742edef41db862da7c63f733b240bcf932e24f9 against quattro. It still merges cleanly. The only change quattro has made to these four files since your branch point is the omarchy-system reboot rename, and it doesn't overlap yours. I found no open pull request competing with this fix. Nothing has run on a worker yet.

Why it stops here: every item is classified by two models separately, and the second opinion (Codex Medium) wasn't run because omabot's daily review budget was already spent. A classification from one model alone doesn't count, so I haven't added bug, and I haven't verified the fix.

Next: this goes back in omabot's queue to be classified, then reproduced on a worker and reviewed by both models. Nothing is needed from you in the meantime.

@vander-x

vander-x commented Nov 27, 2026 •

Copy link
Copy Markdown

Hit this on a packaged 4.6.0rc1 install (Omarchy on Arch, Hyprland 0.57.2-7, aquamarine 0.16.0-1), and the impact is worse than "cannot source it": it is a login loop that never reaches a desktop.

Setup: /etc/profile.d/99-umask.sh sets umask 027. Running omarchy dev unlink leaves /etc/omarchy.conf as -rw-r----- root:root, because sudo tee inherits the caller's umask. On the next boot every login attempt does this:

Nov 27 02:27:23 sddm[870]: Authentication for user "user" successful
Nov 27 02:27:23 uwsm_env-preloader[2039]: /usr/share/omarchy/default/bash/env-bootstrap: line 11: /etc/omarchy.conf: Permission denied
Nov 27 02:27:23 systemd[1716]: [email protected]: Failed with result 'exit-code'.
Nov 27 02:27:23 sddm[870]: Greeter stopping...

env-bootstrap runs under set -e, so the failed . /etc/omarchy.conf kills the env unit, uwsm tears the session down before Hyprland starts, and SDDM drops back to the greeter. Four attempts in that boot, all identical; the only recovery is from a TTY with sudo chmod 644 /etc/omarchy.conf.

The generated payload is just export OMARCHY_PATH="/usr/share/omarchy" — no secrets — so writing it with install -Dm644 as this PR does is the right fix, and it also repairs files already left at 0640 by a previous run. Suggest classifying this as a boot-breaking regression rather than a config-hygiene fix.

The omarchy dev link path has the same sudo tee (bin/omarchy-dev-link:114) and omarchy channel set routes through both helpers, so both call sites need it.

@DanielJBurbridge

Copy link
Copy Markdown
Author

Thanks for the review. I’m closing this older branch and will keep the config-permissions fix for a fresh pass against the shared tests.

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.

3 participants