From 03c801fd66ba1bbba4aa29fb8dcd293abd6e7854 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 11 May 2020 09:41:37 +0300 Subject: [PATCH] kiss: Don't allow invalid characters via PWD --- kiss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kiss b/kiss index a8c34a8..acd38a0 100755 --- a/kiss +++ b/kiss @@ -1472,7 +1472,7 @@ args() { # https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html [ "${action##[as]*}" ] && case "$*" in *\**|*\!*|*\[*|*\]*) - die "Arguments contain invalid characters: '!*[]'" + die "Arguments contain invalid characters: '!*[]' ($*)" esac # Parse some arguments earlier to remove the need to duplicate code. @@ -1503,7 +1503,8 @@ args() { # Second early check to use $PWD in place of arguments. [ "$1" ] || case $action in b|build|c|checksum|i|install|r|remove) export KISS_PATH=${PWD%/*}:$KISS_PATH - set -- "${PWD##*/}" + args "$action" "${PWD##*/}" + return 0 esac # Actions can be abbreviated to their first letter. This saves