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

Re: REMOTE_USER value propagation through http push

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 13, 2011, 11:00 UTC
Message-ID
<m3sjtm2z8e.fsf@localhost.localdomain>
In-Reply-To
<4DA57183.6040308@laposte.net>
Axel <axel.ml@laposte.net> writes:
Show 24 quoted lines
> I set up a git server with HTTP authentication with Apache through
> LDAP (Debian Squeeze + Apache 2.2 + mod_authnz_ldap).
> 
> I m using gitweb for browsing the repositories. At this moment, the
> commiter name appears to be the local user who called "git push". The
> username used for HTTP authentication is not used as commiter name,
> though the REMOTE_USER environment variable is defined.
> 
> After a quick look at http-backend.c it looks like the
> GIT_COMMITER_NAME variable should have been defined with the
> REMOTE_USER variable. Is this right ?
> 
> In Apache access logs, the REMOTE_USER appears to be defined in the
> last request of the push :
> 
> 127.0.1.1 - - [13/Apr/2011:11:45:08 +0200] "GET
> /git/sandbox/info/refs?service=git-receive-pack HTTP/1.1" 200 467 "-"
> "git/1.7.2.5"
> 127.0.1.1 - - [13/Apr/2011:11:45:08 +0200] "POST
> /git/sandbox/git-receive-pack HTTP/1.1" 401 618 "-" "git/1.7.2.5"
> 127.0.1.1 - ldapuser [13/Apr/2011:11:45:08 +0200] "POST
> /git/sandbox/git-receive-pack HTTP/1.1" 200 353 "-" "git/1.7.2.5"
> 
> Is this behaviour expected ?
I don't quite understand.

With push over _any_ transport you transfer commits from your repository to remote repository *without changing them*. Committer is a person who created a commit, i.e. did "git commit" (or "git am", or "git rebase", or "git merge").

The only place where user who did "git push" can appear in is _reflogs_ (I don't know if it appears or not)... but gitweb doesn't show wny reflog information. That of course can be improved...

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: AxelNext: axel.ml@laposte.net
Message 2 of 8 in “REMOTE_USER value propagation through http push”
  1. AxelApr 13, 2011
  2. Jakub NarebskiApr 13, 2011
  3. axel.ml@laposte.netApr 13, 2011
  4. Jakub NarebskiApr 13, 2011
  5. axel.ml@laposte.netApr 13, 2011
  6. Jakub NarebskiApr 13, 2011
  7. axel.ml@laposte.netApr 13, 2011
  8. Jakub NarebskiApr 13, 2011

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.