git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Permission denied on home dir results in fatal error as of 1.8.1.1

From
NMNick Muerdter <stuff@nickm.org>
Date
Feb 9, 2013, 00:40 UTC
Message-ID
<CAECnihxpvtE1XejzHDCRBF=GkyBHmb53WDLa16Suiq=4SeYzvA@mail.gmail.com>

As of git 1.8.1.1 and above (tested up to 1.8.1.3), if the home directory can't be accessed, it results in a fatal error. In git 1.8.1 and below this same setup just resulted in warnings. Was this an intentional change?

I ran into this in a situation where sudo is being used to execute a script as root and then git ends up getting executed as a different user. In this case HOME ends up being /root when git is called as this different user. This home value is obviously incorrect, so there's an issue there, but it would be perhaps be nice if this still just resulted in warnings.

Here's a simple way to reproduce if run as a non-root user:
git 1.8.1.1 (fatal error, doesn't work):

$ env HOME=/root git ls-remote http://github.com/sstephenson/rbenv.git v0.4.0 fatal: unable to access '/root/.config/git/config': Permission denied

git 1.8.1 (warnings, but still works):

$ env HOME=/root git ls-remote http://github.com/sstephenson/rbenv.git v0.4.0 warning: unable to access '/root/.config/git/config': Permission denied warning: unable to access '/root/.gitconfig': Permission denied warning: unable to access '/root/.config/git/config': Permission denied warning: unable to access '/root/.gitconfig': Permission denied warning: unable to access '/root/.config/git/config': Permission denied warning: unable to access '/root/.gitconfig': Permission denied warning: unable to access '/root/.config/git/config': Permission denied warning: unable to access '/root/.gitconfig': Permission denied 9375e99f921f428849f19efe2a2e500b3295d1a7 refs/tags/v0.4.0

Thanks, Nick

Next: Junio C Hamano
Message 1 of 4 in “Permission denied on home dir results in fatal error as of 1.8.1.1”
  1. Nick MuerdterFeb 9, 2013
  2. Junio C HamanoFeb 9, 2013
  3. Jonathan NiederFeb 9, 2013
  4. Nick MuerdterFeb 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.