Skip to content

fix: detect logged-in user home directory when running as root#8

Merged
django23 merged 1 commit intodevelopfrom
fix/root-service-home
Feb 19, 2026
Merged

fix: detect logged-in user home directory when running as root#8
django23 merged 1 commit intodevelopfrom
fix/root-service-home

Conversation

@django23
Copy link
Copy Markdown
Owner

@django23 django23 commented Feb 19, 2026

Summary

  • When running as root (e.g. via brew services or sudo), detect the logged-in user's home directory instead of using /var/root
  • Uses stat -f '%Su' /dev/console to find the console user and dscl to resolve their home directory
  • Falls back to ~ if detection fails

Addresses stevegrunwell#72, props @Mahoney.

Test plan

  • All existing tests pass (make check)
  • Shellcheck passes
  • Non-root behavior unchanged (verified by existing test suite)

@django23 django23 closed this Feb 19, 2026
@django23 django23 force-pushed the fix/root-service-home branch from 096398f to 74e8a13 Compare February 19, 2026 19:17
@django23 django23 reopened this Feb 19, 2026
When asimov runs as root (via brew services or sudo), ~ expands to
/var/root. Now detects the console user via stat/dscl and uses their
home directory instead.

Addresses stevegrunwell#72.
@django23 django23 force-pushed the fix/root-service-home branch from a21b2f2 to 0ca062e Compare February 19, 2026 20:16
@django23 django23 merged commit aace9da into develop Feb 19, 2026
3 checks passed
@django23 django23 deleted the fix/root-service-home branch February 19, 2026 20:19
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.

1 participant