Skip to main content

resolve_user_home

Function resolve_user_home 

Source
pub fn resolve_user_home() -> PathBuf
Expand description

Resolve the real user’s home directory, handling sudo context.

Priority order:

  1. MLSTACK_USER_HOME env var
  2. HOME env var (if not /root or not running under sudo)
  3. /etc/passwd lookup for SUDO_USER, then USER, then LOGNAME
  4. Fallback to /tmp