]> git.tuebingen.mpg.de Git - paraslash.git/commit
Consult $HOME rather than calling getpwuid(),
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 20 Mar 2024 13:43:11 +0000 (14:43 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 20 Mar 2024 23:53:18 +0000 (00:53 +0100)
commitff36ec28f8f5f175e16744470f5d2ddb76f20302
tree64c16b8467894d31c6771eca91c4cc20924ed1ec
parent2934ee80367ee9d50b99ed8d7f672d1a397b4ce0
Consult $HOME 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.

Change the function to return const char *, i.e. a pointer to the
environment rather than a copy that must be freed by the caller.
Document that the caller must not modify or free this string and fix
all callers accordingly.
afs.c
audioc.c
client.c
client_common.c
file_write.c
lsu.c
play.c
server.c
string.c
string.h
upgrade_db.c