summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoru <u@billy>2023-05-30 17:08:07 -0400
committeru <u@billy>2023-05-30 17:08:07 -0400
commitd02eefc0bb993f569c3a01c133f819400e300e37 (patch)
treeab8396ca9c0f1d12dae7e3acaf6d5857c6a695aa
parent431f7e15201d5b9e6f348ba4367a403b0f022939 (diff)
read keyhash (calling ssh-keygen) later
-rw-r--r--src/endofossil24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/endofossil b/src/endofossil
index 2c5c43c..dd86bb3 100644
--- a/src/endofossil
+++ b/src/endofossil
@@ -22,18 +22,6 @@ do
22done < /proc/$pid/environ 22done < /proc/$pid/environ
23[ "$authtype" = publickey ] 23[ "$authtype" = publickey ]
24 24
25keyhash=
26while read
27do
28 set -- $REPLY
29 if [ "$3 $5" = 'SSHFP 2' ]
30 then
31 keyhash=$6
32 break
33 fi
34done < <(ssh-keygen -f <(printf '%s\n' "$keytype $keyvalue") -r .)
35[ "$keyhash" ]
36
37case "$SSH_ORIGINAL_COMMAND" in 25case "$SSH_ORIGINAL_COMMAND" in
38 *\"* ) exit 1 ;; 26 *\"* ) exit 1 ;;
39 : | true | /bin/true ) exit 0 ;; 27 : | true | /bin/true ) exit 0 ;;
@@ -56,6 +44,18 @@ case "$SSH_ORIGINAL_COMMAND" in
56 * ) exit 1 ;; 44 * ) exit 1 ;;
57esac 45esac
58 46
47keyhash=
48while read
49do
50 set -- $REPLY
51 if [ "$3 $5" = 'SSHFP 2' ]
52 then
53 keyhash=$6
54 break
55 fi
56done < <(ssh-keygen -f <(printf '%s\n' "$keytype $keyvalue") -r .)
57[ "$keyhash" ]
58
59upstreamDatabaseDir=${upstreamDatabase%/*} 59upstreamDatabaseDir=${upstreamDatabase%/*}
60readWriteDbName=${upstreamDatabase#${upstreamDatabaseDir}/} 60readWriteDbName=${upstreamDatabase#${upstreamDatabaseDir}/}
61readWriteDir=$upstreamDatabaseDir/.fossil-remotes/$keyhash 61readWriteDir=$upstreamDatabaseDir/.fossil-remotes/$keyhash