Make clearer error messages regarding -e

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3270 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-01-12 23:29:45 +00:00
parent e9423d9c04
commit bcffc35f78

View File

@ -1218,7 +1218,7 @@ validate_interfaces_file() {
options=$(separate_list $options) options=$(separate_list $options)
iface=$(chain_base $interface) iface=$(chain_base $interface)
[ -n "$EXPORT" -a x$networks = detect ] && startup_error "BROADCAST 'detect' is incompatible with the -e option: Interface \"$interface\"" [ -n "$EXPORT" -a x$networks = detect ] && startup_error "BROADCAST 'detect' is incompatible with the -e run-line option: Interface \"$interface\""
eval ${iface}_broadcast="$networks" eval ${iface}_broadcast="$networks"
eval ${iface}_zone="$z" eval ${iface}_zone="$z"
@ -1231,7 +1231,7 @@ validate_interfaces_file() {
dhcp|tcpflags|arp_filter|routefilter|logmartians|sourceroute|blacklist|proxyarp|nosmurfs|upnp|-) dhcp|tcpflags|arp_filter|routefilter|logmartians|sourceroute|blacklist|proxyarp|nosmurfs|upnp|-)
;; ;;
maclist) maclist)
[ -n "$EXPORT" ] && startup_error "The 'maclist' option is incompatible with the -e option: Interface \"$interface\"" [ -n "$EXPORT" ] && startup_error "The 'maclist' option is incompatible with the -e run-line option: Interface \"$interface\""
;; ;;
norfc1918) norfc1918)
if [ $COMMAND = generate ]; then if [ $COMMAND = generate ]; then
@ -1272,7 +1272,7 @@ __EOF__
[ -n "$wildcard" ] && \ [ -n "$wildcard" ] && \
startup_error "The \"detectnets\" option may not be used with a wild-card interface" startup_error "The \"detectnets\" option may not be used with a wild-card interface"
[ -n $EXPORT ] && \ [ -n $EXPORT ] && \
startup_error "'detectnets' not permitted with the -e option" startup_error "'detectnets' not permitted with the -e run-line option"
;; ;;
routeback) routeback)
[ -n "$z" ] || startup_error "The routeback option may not be specified on a multi-zone interface" [ -n "$z" ] || startup_error "The routeback option may not be specified on a multi-zone interface"
@ -1670,7 +1670,7 @@ validate_hosts_file() {
norfc1918|blacklist|tcpflags|nosmurfs|-) norfc1918|blacklist|tcpflags|nosmurfs|-)
;; ;;
maclist) maclist)
[ -n "$EXPORT" ] && startup_error "The 'maclist' option is incompatible with the -e option: \"$host\"" [ -n "$EXPORT" ] && startup_error "The 'maclist' option is incompatible with the -e run-line option: \"$host\""
;; ;;
ipsec) ipsec)
[ -n "$POLICY_MATCH" ] || \ [ -n "$POLICY_MATCH" ] || \
@ -7311,7 +7311,7 @@ setup_masq()
*.*.*|+*|!+*) *.*.*|+*|!+*)
;; ;;
*) *)
[ -n "$EXPORT" ] && fatal_error "An interface name in the SUBNET column is not allowed with the -e option" [ -n "$EXPORT" ] && fatal_error "An interface name in the SUBNET column is not allowed with the -e run-line option"
networks=$(get_routed_networks $networks) networks=$(get_routed_networks $networks)
[ -z "$networks" ] && fatal_error "Unable to determine the routes through interface \"$source\"" [ -z "$networks" ] && fatal_error "Unable to determine the routes through interface \"$source\""
networks="$networks" networks="$networks"
@ -9801,7 +9801,7 @@ do_initialize() {
LOG_MARTIANS=$(added_param_value_no LOG_MARTIANS $LOG_MARTIANS) LOG_MARTIANS=$(added_param_value_no LOG_MARTIANS $LOG_MARTIANS)
DETECT_DNAT_IPADDRS=$(added_param_value_no DETECT_DNAT_IPADDRS $DETECT_DNAT_IPADDRS) DETECT_DNAT_IPADDRS=$(added_param_value_no DETECT_DNAT_IPADDRS $DETECT_DNAT_IPADDRS)
[ -n "$DETECT_DNAT_IPADDRS" -a -n "$EXPORT" ] && \ [ -n "$DETECT_DNAT_IPADDRS" -a -n "$EXPORT" ] && \
startup_error "DETECT_DNAT_IPADDRS=Yes not allowed with the -e option" startup_error "DETECT_DNAT_IPADDRS=Yes not allowed with the -e run-line option"
FORWARDPING=$(added_param_value_no FORWARDPING $FORWARDPING) FORWARDPING=$(added_param_value_no FORWARDPING $FORWARDPING)
[ -n "$FORWARDPING" ] && \ [ -n "$FORWARDPING" ] && \
startup_error "FORWARDPING=Yes is no longer supported" startup_error "FORWARDPING=Yes is no longer supported"