From 2474382756cce8288be8483dbdc690a2e126209e Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 12 Jan 2021 23:15:39 -0400 Subject: [PATCH] Improve interface validation on vnet jail creation --- usr/local/share/bastille/create.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index ecff009..a92b41e 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -176,7 +176,7 @@ ${NAME} { vnet; vnet.interface = e0b_${uniq_epair}; - exec.prestart += "jib addm ${uniq_epair} ${INTERFACE}"; + exec.prestart += "jib addm ${uniq_epair} ${bastille_jail_conf_interface}"; exec.poststop += "jib destroy ${uniq_epair}"; } EOF @@ -543,10 +543,14 @@ if [ -z "${EMPTY_JAIL}" ]; then if [ -n "${INTERFACE}" ]; then validate_netif validate_netconf - elif [ -z "${INTERFACE}" ]; then - if [ -n "${VNET_JAIL}" ]; then - # User must specify interface on vnet jails. - error_exit "Error: Network interface not defined." + elif [ -n "${VNET_JAIL}" ]; then + if [ -z "${INTERFACE}" ]; then + if [ -z "${bastille_network_shared}" ]; then + # User must specify interface on vnet jails. + error_exit "Error: Network interface not defined." + else + validate_netconf + fi fi else validate_netconf