]> git.tuebingen.mpg.de Git - dss.git/commit
Consult $HOME and $LOGNAME rather than calling getpwuid(),
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 12 May 2024 01:09:58 +0000 (03:09 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 12 May 2024 17:45:20 +0000 (19:45 +0200)
commit28f82fe0ca131aafcf764e631a253b2ab244ebfa
tree29c17073077227a2784cf42209c50cf09d4f7825
parent8b42ba90e7650b669a72e0801d18a87a4b629d56
Consult $HOME and $LOGNAME rather than calling getpwuid(),

Quiting getpwnam(3):

    An application that wants to determine its user’s home
    directory should inspect the value of HOME (rather than the value
    getpwuid(getuid())->pw_dir) since this allows the user to modify
    their notion of "the home directory" during a login session.

The old behaviour of get_homedir() to return "/tmp" in the error case
is misleading at best, so abort in this case.
str.c