From 43138ba89cb146a35864413a52c485562f88cfd9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 14 Sep 2020 12:30:54 +0300 Subject: [PATCH] kiss: make sure to check for invalid input when using cwd as package --- kiss | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/kiss b/kiss index 280de57..6b6c9a6 100755 --- a/kiss +++ b/kiss @@ -1375,21 +1375,16 @@ args() { case $action in b|build|c|checksum|d|download|i|install|r|remove) - # This handles the globbing characters '*', '!', '[' and ']' and - # basic white-space. Invalid input characters in other words. + [ "$1" ] || { + export KISS_PATH=${PWD%/*}:$KISS_PATH + set -- "${PWD##*/}" + } + case "$*" in *'*'*|*'!'*|*'['*|*']'*|*' '*|*' '*) die "Arguments contain invalid characters: '!*[ \t]'" ;; esac - - # CRUX style usage using the current directory as the name of the - # package to be operated on. This needs to sit before the 'as_root()' - # calls as they reset the cwd during their invocations. - [ "$1" ] || { - export KISS_PATH=${PWD%/*}:$KISS_PATH - set -- "${PWD##*/}" - } ;; esac