aboutsummaryrefslogtreecommitdiff
path: root/modules/private/gitolite/ldap_gitolite.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/gitolite/ldap_gitolite.sh')
-rw-r--r--modules/private/gitolite/ldap_gitolite.sh33
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/private/gitolite/ldap_gitolite.sh b/modules/private/gitolite/ldap_gitolite.sh
deleted file mode 100644
index 23cb2bf..0000000
--- a/modules/private/gitolite/ldap_gitolite.sh
+++ /dev/null
@@ -1,33 +0,0 @@
1### This snippet is not standalone and must be integrated in the global ldap_authorized_keys.sh
2LDAP_GITOLITE_MEMBER="cn=users,cn=gitolite,ou=services,dc=immae,dc=eu"
3GITOLITE_SHELL=$(which gitolite-shell)
4
5if [[ $user == gitolite ]]; then
6 ldap_search '(&(memberOf='$LDAP_GITOLITE_MEMBER')('$KEY'=*))' $KEY | \
7 while read line ;
8 do
9 if [ ! -z "$line" ]; then
10 if [[ $line == dn* ]]; then
11 user=$(sed -n 's/.*uid=\([^,]*\).*/\1/p' <<< "$line")
12 if [ -n "$user" ]; then
13 if [[ $user == "immae" ]] || [[ $user == "denise" ]]; then
14 # Capitalize first letter (backward compatibility)
15 user=$(sed -r 's/^([a-z])/\U\1/' <<< "$user")
16 fi
17 else
18 # Service fake user
19 user=$(sed -n 's/.*cn=\([^,]*\).*/\1/p' <<< "$line")
20 fi
21 elif [[ $line == $KEY* ]]; then
22 key=$(clean_key_line git "$line")
23 if [ ! -z "$key" ]; then
24 if [[ $key != *$'\n'* ]] && [[ $key == ssh-* ]]; then
25 echo -n 'command="'$GITOLITE_SHELL' '$user'",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty '
26 echo $key
27 fi
28 fi
29 fi
30 fi
31 done
32 exit 0
33fi