summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-05-31 08:26:49 -0400
committerAndrew Cady <d@jerkface.net>2023-05-31 08:26:49 -0400
commita884f3f2e64e1c94d9568ae1961040e7ac22ffed (patch)
treeb512ea222160f473f9b6fa079f4874696c5e88c9
parent4b2bff5030aa12cfb383a224b8e3937c17d49984 (diff)
endofossil: move nested case up to top to fail earlier and simplify
-rw-r--r--src/endofossil4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/endofossil b/src/endofossil
index 382dde5..2960e8e 100644
--- a/src/endofossil
+++ b/src/endofossil
@@ -25,10 +25,12 @@ done < /proc/$pid/environ
25case "$SSH_ORIGINAL_COMMAND" in 25case "$SSH_ORIGINAL_COMMAND" in
26 *\"* ) exit 1 ;; 26 *\"* ) exit 1 ;;
27 : | true | /bin/true ) exit 0 ;; 27 : | true | /bin/true ) exit 0 ;;
28 fossil\ test-http\ */../* ) exit 1 ;;
29 fossil\ test-http\ ../* ) exit 1 ;;
30 fossil\ test-http\ */.. ) exit 1 ;;
28 fossil\ test-http\ * ) 31 fossil\ test-http\ * )
29 set -- $SSH_ORIGINAL_COMMAND 32 set -- $SSH_ORIGINAL_COMMAND
30 [ $# = 3 ] 33 [ $# = 3 ]
31 case "$3" in */../* | ../* | */.. ) exit 1 ;; esac
32 for d in "${shared_paths[@]}" 34 for d in "${shared_paths[@]}"
33 do 35 do
34 f=${3#/${d##*/./}} 36 f=${3#/${d##*/./}}