create: Don’t allow -|_ in VNET jail names

This commit is contained in:
tschettervictor
2025-07-12 11:55:48 -06:00
committed by GitHub
parent 9d7243e7b8
commit 7d3f77e4c4

View File

@@ -69,6 +69,8 @@ validate_name() {
# Make sure NAME has only allowed characters
if [ -n "$(echo "${NAME_SANITY}" | awk "/^[-_].*$/" )" ]; then
error_exit "[ERROR]: Jail names may not begin with (-|_) characters!"
elif [ "${VNET_JAIL}" -eq 1 ] && echo "${NAME_VERIFY}" | grep -qE '(-|_)'; then
error_exit "[ERROR]: VNET jail names may not contain (-|_) characters."
elif [ "${NAME_VERIFY}" != "${NAME_SANITY}" ]; then
error_exit "[ERROR]: Jail names may not contain special characters!"
elif echo "${NAME_VERIFY}" | grep -qE '^[0-9]+$'; then
@@ -759,6 +761,7 @@ EMPTY_JAIL=""
THICK_JAIL=""
CLONE_JAIL=""
VNET_JAIL=""
VNET_JAIL_BRIDGE=""
VLAN_ID=""
LINUX_JAIL=""
STATIC_MAC=""