From a884f3f2e64e1c94d9568ae1961040e7ac22ffed Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Wed, 31 May 2023 08:26:49 -0400 Subject: endofossil: move nested case up to top to fail earlier and simplify --- src/endofossil | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 case "$SSH_ORIGINAL_COMMAND" in *\"* ) exit 1 ;; : | true | /bin/true ) exit 0 ;; + fossil\ test-http\ */../* ) exit 1 ;; + fossil\ test-http\ ../* ) exit 1 ;; + fossil\ test-http\ */.. ) exit 1 ;; fossil\ test-http\ * ) set -- $SSH_ORIGINAL_COMMAND [ $# = 3 ] - case "$3" in */../* | ../* | */.. ) exit 1 ;; esac for d in "${shared_paths[@]}" do f=${3#/${d##*/./}} -- cgit v1.2.3