1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-24 16:10:05 -07:00

kiss: make sure to check for invalid input when using cwd as package

This commit is contained in:
Dylan Araps 2020-09-14 12:30:54 +03:00
parent 6dde0696d8
commit 43138ba89c
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

15
kiss
View File

@ -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