summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-05-26 14:13:37 -0400
committerAndrew Cady <d@jerkface.net>2023-05-26 14:13:53 -0400
commit609876919a401b06855408739eeca211796b186b (patch)
tree99b9f0f64fea8f93b43c2ce14c2c0c75466e70e6
parent3b0ecb25bf5e032b5cc0232040fca854f01d297b (diff)
do not allow config file names that begin '.'
-rwxr-xr-xsrc/push-btrfs9
1 files 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
55if [ $# = 1 ] 55if [ $# = 1 ]
56then 56then
57 case "$1" in 57 case "$1" in
58 '' ) die 'config file name is blank' ;; 58 '' ) die 'config file name is blank' ;;
59 */*) die 'config file name must not contain "/"' ;; 59 */* ) die 'config file name must not contain "/"' ;;
60 *.json) ;; 60 .* ) die 'config file name must not begin "."' ;;
61 *) die "config file name must end in '.json'" ;; 61 *.json ) ;;
62 * ) die 'config file name must end ".json"' ;;
62 esac 63 esac
63 config_file=$CONFIG_DIR/$1 64 config_file=$CONFIG_DIR/$1
64 config_file_temp=$CONFIG_DIR/.$1~tmp 65 config_file_temp=$CONFIG_DIR/.$1~tmp