forked from kiss-community/kiss
kiss: make sure to check for invalid input when using cwd as package
This commit is contained in:
parent
6dde0696d8
commit
43138ba89c
15
kiss
15
kiss
@ -1375,21 +1375,16 @@ args() {
|
|||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
b|build|c|checksum|d|download|i|install|r|remove)
|
b|build|c|checksum|d|download|i|install|r|remove)
|
||||||
# This handles the globbing characters '*', '!', '[' and ']' and
|
[ "$1" ] || {
|
||||||
# basic white-space. Invalid input characters in other words.
|
export KISS_PATH=${PWD%/*}:$KISS_PATH
|
||||||
|
set -- "${PWD##*/}"
|
||||||
|
}
|
||||||
|
|
||||||
case "$*" in
|
case "$*" in
|
||||||
*'*'*|*'!'*|*'['*|*']'*|*' '*|*' '*)
|
*'*'*|*'!'*|*'['*|*']'*|*' '*|*' '*)
|
||||||
die "Arguments contain invalid characters: '!*[ \t]'"
|
die "Arguments contain invalid characters: '!*[ \t]'"
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user