On Wed, Oct 5, 2016 at 5:12 PM, Erik Bray <erik.m.b...@gmail.com> wrote:
> On Wed, Oct 5, 2016 at 4:58 PM, Erik Bray <erik.m.b...@gmail.com> wrote:
>> On Wed, Oct 5, 2016 at 12:26 PM, Jeroen Demeyer <jdeme...@cage.ugent.be> 
>> wrote:
>>> When running "git fetch", I get
>>>
>>> remote: warning: unable to access
>>> '/home/erik_m_bray/.config/git/attributes': Permission denied
>>
>> Confirmed--this is only for git:// too.  I was the last person to
>> restart git-daemon on the server.  But I feel like that was over a
>> week ago.  Also it runs as user 'git' not me, obviously, so I don't
>> know why it's trying to read something (which doesn't exist) from my
>> home directory.
>
> Fixed.  I think this is a bug in git-daemon and/or Ubuntu's init
> script for it.  It tries at some point to read a git configuration in
> someone's home directory, but rather than use the home directory of
> the user it's actually running as, it apparently uses the value of
> $HOME.  On Ubuntu the default sudo behavior is to preserve the
> original user's $HOME, hence it trying to use mine.

Well the git-daemon man page is at least explicit about this:

```
--user=<user>--group=<group>

Change daemon’s uid and gid before entering the service loop. When
only --user is given without --group, the primary group ID for the
user is used. The values of the option are given to getpwnam(3)and
getgrnam(3) and numeric IDs are not supported.

Giving these options is an error when used with --inetd; use the
facility of inet daemon to achieve the same before spawning git daemon
if needed.

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>.
```

Ubuntu's init script for it doesn't set HOME properly so I guess that's it.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to