diff options
Diffstat (limited to 'EndoForge/src/AnonymousAccessCommand')
-rwxr-xr-x | EndoForge/src/AnonymousAccessCommand | 18 |
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 | ||
77 | unsupported() | ||
78 | { | ||
79 | echo "$0: Error: unsupported" >&2 | ||
80 | } | ||
81 | |||
77 | read authtype authline < "$SSH_USER_AUTH" || exit | 82 | read authtype authline < "$SSH_USER_AUTH" || exit |
78 | [ "$authtype" = publickey ] || exit | 83 | [ "$authtype" = publickey ] || exit |
79 | 84 | ||
@@ -90,12 +95,17 @@ arg=${SSH_ORIGINAL_COMMAND#* } | |||
90 | arg=${arg%\'} | 95 | arg=${arg%\'} |
91 | arg=${arg#\'} | 96 | arg=${arg#\'} |
92 | case "$arg" in | 97 | case "$arg" in |
93 | *\'*) exit ;; # we should support these wtf | 98 | *\'* ) |
94 | *.git) ;; | 99 | unsupported |
95 | *) arg=$arg/.git ;; | 100 | exit |
101 | ;; | ||
96 | esac | 102 | esac |
97 | 103 | ||
98 | dir=$(readlink -e "$arg") || exit | 104 | if ! dir=$(readlink -e "$arg") |
105 | then exit | ||
106 | elif [ -d "$dir"/.git ] | ||
107 | then dir=$dir/.git | ||
108 | fi | ||
99 | 109 | ||
100 | if ! is_self_forge "$dir" | 110 | if ! is_self_forge "$dir" |
101 | then | 111 | then |