diff options
-rw-r--r-- | Documentation/git-daemon.txt | 9 | ||||
-rw-r--r-- | daemon.c | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index b08a08cd95..f1a570a874 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -270,6 +270,15 @@ selectively enable/disable services per repository:: ---------------------------------------------------------------- +ENVIRONMENT +----------- +'git-daemon' will set REMOTE_ADDR to the IP address of the client +that connected to it, if the IP address is available. REMOTE_ADDR will +be available in the environment of hooks called when +services are performed. + + + Author ------ Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki @@ -537,6 +537,10 @@ static int execute(struct sockaddr *addr) #endif } loginfo("Connection from %s:%d", addrbuf, port); + setenv("REMOTE_ADDR", addrbuf, 1); + } + else { + unsetenv("REMOTE_ADDR"); } alarm(init_timeout ? init_timeout : timeout); |