add username character check

This commit is contained in:
Dan Johansen 2019-08-17 14:06:53 +02:00
parent 0bd777f7fb
commit d6e037ed8a
1 changed files with 5 additions and 0 deletions

View File

@ -495,6 +495,11 @@ if [ ! -z "$EDITION" ]; then
--inputbox "Enter username:
(usernames most be all lowercase)" 8 50 \
3>&1 1>&2 2>&3 3>&-)
if [[ "$USER" =~ [A-Z] ]] || [[ "$USER" == *['!'@#\$%^\&*()_+]* ]]; then
clear
msg "Configuration aborted! Username contained invalid characters."
exit 1
fi
else
clear
exit 1