Thread (10 messages) flat view 10 messages, 6 authors, 2016-06-15

Re: git-daemon: needs /root/.config/git/config?

From: Bernhard R. Link <hidden>
Date: 2016-06-15 22:57:37

* Ian Kumlien [off-list ref] [130605 13:31]:
Yes, i agree, it's suboptimal but I for one would use getpwuid to get
the home directory of the executing user to avoid this - though i don't
know how portable it is (or if there is any other issues)
It's not only suboptimal but simply wrong. getpwuid gives at best the
initial home directory, and even there it is only a guess. (If you are
looking for some home directory of a different user it might be a good
guess). But using getpwuid(getuid())->pw_dir if HOME is set is a serious
mistake, as you throw out the good value for some almost but not quite
totally unrelated value.

        Bernhard R. Link
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help