]> 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>
Thu, 16 May 2024 23:36:37 +0000 (01:36 +0200)
commit9f2286ca2fe37031ea297e0c5d326c2f398da309
tree63d93033bf881f16929cb135136d146791dc5157
parentce90164c8b761e17e55a186c8b021ecb55b8fdb5
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