git-daemon.init: Does not set $HOME properly

Bug #1630644 reported by E. Madison Bray
6
This bug affects 1 person
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/erik_m_bray/.config/git/attributes': Permission denied

where erik_m_bray is my username on that server. I had recently restarted the git-daemon server by running `sudo /etc/init.d/git-daemon restart`. Similar issues are on stack exchange: http://serverfault.com/questions/634439/unable-to-access-root-config-git-attributes-permission-denied

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.