[Bug 1630644] [NEW] git-daemon.init: Does not set $HOME properly

Erik Bray erik.m.bray+ubuntu at gmail.com
Wed Oct 5 15:41:09 UTC 2016


Public bug reported:

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.

** Affects: git (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to git in Ubuntu.
https://bugs.launchpad.net/bugs/1630644

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

Status in git package in Ubuntu:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/git/+bug/1630644/+subscriptions



More information about the foundations-bugs mailing list