summaryrefslogtreecommitdiff
path: root/EndoForge/src/AnonymousAccessCommand
diff options
context:
space:
mode:
Diffstat (limited to 'EndoForge/src/AnonymousAccessCommand')
-rwxr-xr-xEndoForge/src/AnonymousAccessCommand18
1 files changed, 14 insertions, 4 deletions
diff --git a/EndoForge/src/AnonymousAccessCommand b/EndoForge/src/AnonymousAccessCommand
index 526f53d..ffdc07a 100755
--- a/EndoForge/src/AnonymousAccessCommand
+++ b/EndoForge/src/AnonymousAccessCommand
@@ -74,6 +74,11 @@ with_soul_bare()
74 ) 74 )
75} 75}
76 76
77unsupported()
78{
79 echo "$0: Error: unsupported" >&2
80}
81
77read authtype authline < "$SSH_USER_AUTH" || exit 82read authtype authline < "$SSH_USER_AUTH" || exit
78[ "$authtype" = publickey ] || exit 83[ "$authtype" = publickey ] || exit
79 84
@@ -90,12 +95,17 @@ arg=${SSH_ORIGINAL_COMMAND#* }
90arg=${arg%\'} 95arg=${arg%\'}
91arg=${arg#\'} 96arg=${arg#\'}
92case "$arg" in 97case "$arg" in
93 *\'*) exit ;; # we should support these wtf 98 *\'* )
94 *.git) ;; 99 unsupported
95 *) arg=$arg/.git ;; 100 exit
101 ;;
96esac 102esac
97 103
98dir=$(readlink -e "$arg") || exit 104if ! dir=$(readlink -e "$arg")
105then exit
106elif [ -d "$dir"/.git ]
107then dir=$dir/.git
108fi
99 109
100if ! is_self_forge "$dir" 110if ! is_self_forge "$dir"
101then 111then