V8.02.644.2025.05.31
All checks were successful
Retrieve the DNSSEC status at the time of updating the repository. / build-dnssec-diagram (push) Successful in 30s
All checks were successful
Retrieve the DNSSEC status at the time of updating the repository. / build-dnssec-diagram (push) Successful in 30s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -35,22 +35,23 @@ arg_check() {
|
|||||||
sanitize_arg() {
|
sanitize_arg() {
|
||||||
declare input="$1"
|
declare input="$1"
|
||||||
# Define allowed characters:
|
# Define allowed characters:
|
||||||
# letters, digits, dot, underscore, slash, equals, [, ], colon, double-quote, hyphen, space.
|
# letters, digits, dot, underscore, slash, equals, [, ], colon, double-quote, hyphen, plus, space.
|
||||||
declare allowed='a-zA-Z0-9._/=\[\]:"\- '
|
declare allowed
|
||||||
declare disallowed
|
declare disallowed
|
||||||
disallowed=$(printf '%s' "${input}" | tr -d "${allowed}")
|
allowed='a-zA-Z0-9._/=[]:"-+ '
|
||||||
|
disallowed=$(printf '%s' "$input" | sed "s/[$allowed]//g")
|
||||||
|
|
||||||
if [[ -n ${disallowed} ]]; then
|
if [[ -n ${disallowed} ]]; then
|
||||||
{
|
{
|
||||||
printf "❌ Invalid character : '%s'. \n" "${disallowed//?/& }"
|
printf "❌ Invalid character : '%s'. \n" "${disallowed//?/& }"
|
||||||
printf "❌ in argument : '%s'. \n" "${input}"
|
printf "❌ in argument : '%s'. \n" "${input}"
|
||||||
printf "❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - ' \n"
|
printf "❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' \n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
} >> "${LOG_ERROR}"
|
} >> "${LOG_ERROR}"
|
||||||
boot_screen_cleaner
|
boot_screen_cleaner
|
||||||
printf "\e[91m❌ Invalid character : '%s'. \e[0m\n" "${disallowed//?/& }" >&2
|
printf "\e[91m❌ Invalid character : '%s'. \e[0m\n" "${disallowed//?/& }" >&2
|
||||||
printf "\e[91m❌ in argument : '%s'. \e[0m\n" "${input}" >&2
|
printf "\e[91m❌ in argument : '%s'. \e[0m\n" "${input}" >&2
|
||||||
printf "\e[91m❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - ' \e[0m\n" >&2
|
printf "\e[91m❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' \e[0m\n" >&2
|
||||||
# shellcheck disable=SC2162
|
# shellcheck disable=SC2162
|
||||||
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||||
exit "${ERR_INVLD_CHAR}"
|
exit "${ERR_INVLD_CHAR}"
|
||||||
|
|||||||
Reference in New Issue
Block a user