Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grab the home directory from /etc/passwd if needed #255

Merged
merged 1 commit into from
Jul 4, 2024

Commits on Jul 4, 2024

  1. Grab the home directory from /etc/passwd if needed

    Go's `os.UserHomeDir` has one big gotcha: it only fetches the value from
    the HOME environment variable and that's it: it does not try to fetch
    this value from anywhere else if that environment variable is not set.
    
    In some conditions (e.g. a systemd service file) this environment file
    might not be set and hence some important paths will not be properly
    generated. This commit ensures that the home directory is picked: if
    Go's `os.UserHomeDir` fails, then we will try to read this value from
    `/etc/passwd`.
    
    Fixes bsc#1226128
    
    Signed-off-by: Miquel Sabaté Solà <[email protected]>
    mssola committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    a36e56c View commit details
    Browse the repository at this point in the history