make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / git-server / git-receive-pack
blob2c83c23df3a865a99e6f4739c0c74d1fff56fc48
1 #!/bin/bash
3 set -e
4 set -o pipefail
5 set -u
7 directory=''
9 echo ---- >&2
10 cat /etc/issue.git >&2
11 echo ---- >&2
13 for arg in "$@"
15 case "$arg" in
16 -*) true;;
17 *) directory=$arg;;
18 esac
19 done
21 if [ -n "$directory" ]
22 then
23 mkdir -p "$directory"
24 chmod u+rwx,o-rwx "$directory"
25 git init --bare "$directory" >&2
28 /usr/bin/git-receive-pack "$@"
29 status=$?
31 if [ -n "$directory" ]
32 then
33 git-repo-mgmt "$directory" || true
34 ( cd "$directory" && git update-server-info ; ) || true
37 exit $status