adding interface length safety

This commit is contained in:
toby 2019-02-23 05:16:27 +00:00
parent 15c67eae20
commit af873ce08e
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,11 @@
set -Eeuo pipefail
IFACE=$1
if [ ${#IFACE} -gt 14 ]; then
echo "interface name too long, mac 14 char: $IFACE"
exit 10
fi
source /etc/libvirt/hooks/$IFACE
if ! [[ $CLUSTER =~ ^[0-9]+$ ]]; then

View File

@ -2,6 +2,11 @@
set -Eeuo pipefail
IFACE=$1
if [ ${#IFACE} -gt 14 ]; then
echo "interface name too long, mac 14 char: $IFACE"
exit 10
fi
source /etc/libvirt/hooks/$IFACE
### I need to keep this for backwards compatibility but PUBLICMAC should always be set since it absolutely needs to match the MAC the VM has been assigned by qemu. otherwise nothign will work