summaryrefslogtreecommitdiff
path: root/EndoForge/src/AnonymousAccessCommand
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-24 21:10:38 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-24 21:10:38 -0400
commita5c3e1a1ee792d47bc64fd1ca5f42068e0a7f6d5 (patch)
treeb82dc88b76b3044ee1960159fb3dba2a6779cb7a /EndoForge/src/AnonymousAccessCommand
parent19815f519d331e770bdea3938825c65ff5c8df6a (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-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