]> 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>
Sun, 26 May 2024 16:15:54 +0000 (18:15 +0200)
commitb9cd042c43393537170c1d35a31b07482d1f81f6
treeec2cd8627dcedc7ee3dea2e1214ea7d15cf5a0a8
parent4e7de83d81baee96116e823f29926222661ceb15
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