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

Re: regression: "96b9e0e3 config: treat user and xdg config permission problems as errors" busted git-daemon

From
EPEvan Priestley <epriestley@epriestley.com>
Date
Apr 12, 2013, 14:45 UTC
Message-ID
<D960D402-22EA-4C2B-BFDD-9BE512C88D97@epriestley.com>
Jonathan Nieder <jrnie...@gmail.com> wrote:
> I'm not sure whether to keep 96b9e0e (config: treat user and xdg
> config permission problem as errors) in the long run, BTW.
> 
> Insights welcome.
For what it's worth, here's an anecdote about this:
I work on some open source software which includes a web-based repository browser for Git, somewhat similar to gitweb. We implement this partially by executing `git` commands from the webserver (usually Apache). For example, we run `git cat-file …` to retrieve file content to show to the user.
After this change, a number of users who manage installs of the software are hitting "fatal: unable to access '/root/.config/git/config': Permission denied" while browsing repositories, because their Apache runs as some unprivileged user (like "apache" or "www-data") but with HOME=/root. We've seen about half a dozen reports of this now, so I believe this sort of setup is at least somewhat common and not just a bizarre one-off user with a broken environment. Users generally have difficulty resolving this error on their own, as it's not obvious that this boils down to an Apache environmental issue.
We'll likely resolve this by running `HOME=/ git ...` instead of `git ...` when we execute commands (or some more finessed version of that, but basically pointing HOME at some dummy readable directory). From cursory investigation, it appears we can't avoid this fatal with more surgical settings like GIT_CONFIG or XDG_CONFIG_HOME, since git still ends up looking in HOME and fataling anyway. This fix is a bit clunky, but not really a big deal.
I imagine our use case is fairly unusual, but I wanted to relate it in case it's helpful in balancing concerns here. If I've missed a more reasonable approach to solving this than redirecting HOME, please let me know, but it looks like that's more or less what the git-daemon patch is doing too.

Thanks, Evan Priestley

Message 1 of 1 in “Re: regression: "96b9e0e3 config: treat user and xdg config permission problems as errors" busted git-daemon”
  1. Evan PriestleyApr 12, 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.