From 609876919a401b06855408739eeca211796b186b Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 26 May 2023 14:13:37 -0400 Subject: do not allow config file names that begin '.' --- src/push-btrfs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/push-btrfs b/src/push-btrfs index a534053..41ffd7f 100755 --- a/src/push-btrfs +++ b/src/push-btrfs @@ -55,10 +55,11 @@ check_user_is_root if [ $# = 1 ] then case "$1" in - '' ) die 'config file name is blank' ;; - */*) die 'config file name must not contain "/"' ;; - *.json) ;; - *) die "config file name must end in '.json'" ;; + '' ) die 'config file name is blank' ;; + */* ) die 'config file name must not contain "/"' ;; + .* ) die 'config file name must not begin "."' ;; + *.json ) ;; + * ) die 'config file name must end ".json"' ;; esac config_file=$CONFIG_DIR/$1 config_file_temp=$CONFIG_DIR/.$1~tmp -- cgit v1.2.3