diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-10-24 21:10:38 -0400 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-10-24 21:10:38 -0400 |
commit | a5c3e1a1ee792d47bc64fd1ca5f42068e0a7f6d5 (patch) | |
tree | b82dc88b76b3044ee1960159fb3dba2a6779cb7a /EndoForge/src/AnonymousAccessCommand | |
parent | 19815f519d331e770bdea3938825c65ff5c8df6a (diff) |
Change decision whether to append "/.git"
Before, AnonymousAccessCommand would append "/.git" to any name that
didn't end in ".git".
Now, it appends the ".git" subdir to a dirname exactly when that subdir
exists.
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 |