git-daemon.init: Does not set $HOME properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Greetings,
I recently had users of a git server complaining when they did a git clone/fetch over git:// they got a warning:
remote: warning: unable to access '/home/
where erik_m_bray is my username on that server. I had recently restarted the git-daemon server by running `sudo /etc/init.
In the man page for git-daemon, the documentation for the --user option states:
Like many programs that switch user id, the daemon does not reset
environment variables such as $HOME when it runs git programs, e.g.
upload-pack and receive-pack. When using this option, you may also
want to set and export HOME to point at the home directory of <user>
before starting the daemon, and make sure any Git configuration files
in that directory are readable by <user>.
Since this init script does not set $HOME properly git-daemon will still use whatever $HOME was when it was started (mine, in this case, since sudoers is configured to preserve the user's $HOME by default).
$ lsb_release -rd
Description: Ubuntu 14.04.5 LTS
Release: 14.04
but this looks to be the case in current versions as well.