]> git.ipfire.org Git - people/stevee/network.git/commitdiff
network fix parameter passing when using ""
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 16 Aug 2017 06:25:13 +0000 (08:25 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 16 Aug 2017 12:19:11 +0000 (14:19 +0200)
When we use "" on the command line to pass a value with spaces
the argument was broken when passing it to the next function.
Now the argument is kept as one string with spaces

Fixes: #11438
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
54 files changed:
src/functions/functions.bonding
src/functions/functions.bridge
src/functions/functions.cli.firewall
src/functions/functions.device
src/functions/functions.dhcpd
src/functions/functions.distro
src/functions/functions.dns
src/functions/functions.editor
src/functions/functions.firewall
src/functions/functions.firewall-zones
src/functions/functions.he
src/functions/functions.hook
src/functions/functions.hostapd
src/functions/functions.http
src/functions/functions.interrupts
src/functions/functions.ip
src/functions/functions.ip-tunnel
src/functions/functions.ipsec
src/functions/functions.iptables
src/functions/functions.ipv4
src/functions/functions.ipv6
src/functions/functions.list
src/functions/functions.modem
src/functions/functions.ports
src/functions/functions.ppp
src/functions/functions.pppoe-server
src/functions/functions.route
src/functions/functions.settings
src/functions/functions.util
src/functions/functions.vpn
src/functions/functions.vpn-security-policies
src/functions/functions.wireless
src/functions/functions.wpa_supplicant
src/functions/functions.zone
src/header-config
src/header-port
src/header-zone
src/hooks/configs/dhcp
src/hooks/configs/ipv4-static
src/hooks/configs/ipv6-auto
src/hooks/configs/ipv6-static
src/hooks/configs/pppoe-server
src/hooks/ports/batman-adv
src/hooks/ports/bonding
src/hooks/ports/dummy
src/hooks/ports/vlan
src/hooks/ports/wireless-adhoc
src/hooks/ports/wireless-ap
src/hooks/zones/6to4-tunnel
src/hooks/zones/bridge
src/hooks/zones/modem
src/hooks/zones/pppoe
src/hooks/zones/wireless
src/network

index 490ac2e3aa591b49ced3acde2834130367a75a1e..afa3306732d57e0b04bc4da35e003619b42560a1 100644 (file)
@@ -35,10 +35,10 @@ bonding_create() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               address=$(cli_get_val ${1})
+                               address=$(cli_get_val "${1}")
                                ;;
                        --mode=*)
                                ;;
                        --mode=*)
-                               mode=$(cli_get_val ${1})
+                               mode=$(cli_get_val "${1}")
                                ;;
                        *)
                                error "Unrecognized argument: ${1}"
                                ;;
                        *)
                                error "Unrecognized argument: ${1}"
index 5b817fbb355ad1639befe0bfb907c4cc769a767c..38f51ed3edb4b91ba640f495eb2d986b44839ad6 100644 (file)
@@ -30,10 +30,10 @@ bridge_create() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               address=$(cli_get_val ${1})
+                               address=$(cli_get_val "${1}")
                                ;;
                        --mtu=*)
                                ;;
                        --mtu=*)
-                               mtu=$(cli_get_val ${1})
+                               mtu=$(cli_get_val "${1}")
                                ;;
                        *)
                                error "Unrecognized argument: ${1}"
                                ;;
                        *)
                                error "Unrecognized argument: ${1}"
index ffd3a657d713641972e2562057e6f96181026e6d..74cb65264a37b3292720248d971de28adf5bd841 100644 (file)
@@ -58,7 +58,7 @@ firewall_cli() {
                        ;;
 
                zone)
                        ;;
 
                zone)
-                       firewall_cli_zone $@
+                       firewall_cli_zone "$@"
                        ;;
 
                ""|help|--help|-h)
                        ;;
 
                ""|help|--help|-h)
@@ -81,7 +81,7 @@ firewall_cli_panic() {
        assert isset protocol
        shift
 
        assert isset protocol
        shift
 
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man firewall-panic
                exit ${EXIT_OK}
        fi
                cli_show_man firewall-panic
                exit ${EXIT_OK}
        fi
@@ -104,7 +104,7 @@ firewall_cli_panic() {
 }
 
 firewall_cli_settings() {
 }
 
 firewall_cli_settings() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man firewall-settings
                exit ${EXIT_OK}
        fi
                cli_show_man firewall-settings
                exit ${EXIT_OK}
        fi
@@ -122,7 +122,7 @@ firewall_cli_zone() {
        assert isset protocol
        shift 
 
        assert isset protocol
        shift 
 
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man firewall-zone
                exit ${EXIT_OK}
        fi
                cli_show_man firewall-zone
                exit ${EXIT_OK}
        fi
@@ -143,15 +143,15 @@ firewall_cli_zone() {
                # Process the given action.
                case "${action}" in
                        edit)
                # Process the given action.
                case "${action}" in
                        edit)
-                               firewall_cli_zone_edit ${zone} $@
+                               firewall_cli_zone_edit ${zone} "$@"
                                ;;
                        status|"")
                                ;;
                        status|"")
-                               firewall_cli_zone_status ${zone} $@
+                               firewall_cli_zone_status ${zone} "$@"
                                ;;
 
                        # Print the raw configuration settings.
                        show)
                                ;;
 
                        # Print the raw configuration settings.
                        show)
-                               firewall_zone_print ${zone} $@
+                               firewall_zone_print ${zone} "$@"
 
                                exit ${EXIT_ERROR}
                                ;;
 
                                exit ${EXIT_ERROR}
                                ;;
@@ -168,7 +168,7 @@ firewall_cli_zone() {
 
                case "${action}" in
                        reset)
 
                case "${action}" in
                        reset)
-                               firewall_zone_reset $@
+                               firewall_zone_reset "$@"
                                exit $?
                                ;;
 
                                exit $?
                                ;;
 
index 897f812d7d7bb8a827bc19be43e3663bef434d58..12bf203ffe9e4c44268c6bc20dfaf1b4e07b0847 100644 (file)
@@ -320,11 +320,11 @@ device_get_phy() {
 }
 
 device_is_phy() {
 }
 
 device_is_phy() {
-       phy_exists $@
+       phy_exists "$@"
 }
 
 device_is_serial() {
 }
 
 device_is_serial() {
-       serial_exists $@
+       serial_exists "$@"
 }
 
 # Returns true if a device is a tun device
 }
 
 # Returns true if a device is a tun device
@@ -540,7 +540,7 @@ device_set_promisc() {
 
 # Check if the device is free
 device_is_free() {
 
 # Check if the device is free
 device_is_free() {
-       ! device_is_used $@
+       ! device_is_used "$@"
 }
 
 # Check if the device is used
 }
 
 # Check if the device is used
@@ -775,7 +775,7 @@ device_identify() {
                                seconds="$(cli_get_val "${arg}")"
                                ;;
                esac
                                seconds="$(cli_get_val "${arg}")"
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        assert isinteger seconds
 
 
        assert isinteger seconds
 
index 7d32c394998e3b0e579a3cee211bdec52dfe6615..3b1214fb937d0efd8ea8c3a4d4113f13bc3b5d52 100644 (file)
@@ -118,7 +118,7 @@ dhcpd_service() {
 }
 
 dhcpd_start() {
 }
 
 dhcpd_start() {
-       local services=$(dhcpd_service $@)
+       local services=$(dhcpd_service "$@")
 
        local service
        for service in ${services}; do
 
        local service
        for service in ${services}; do
@@ -127,7 +127,7 @@ dhcpd_start() {
 }
 
 dhcpd_stop() {
 }
 
 dhcpd_stop() {
-       local services=$(dhcpd_service $@)
+       local services=$(dhcpd_service "$@")
 
        local service
        for service in ${services}; do
 
        local service
        for service in ${services}; do
@@ -138,7 +138,7 @@ dhcpd_stop() {
 dhcpd_restart() {
        # DHCP does not support a reload, so
        # we retsart it.
 dhcpd_restart() {
        # DHCP does not support a reload, so
        # we retsart it.
-       local services=$(dhcpd_service $@)
+       local services=$(dhcpd_service "$@")
 
        local service
        for service in ${services}; do
 
        local service
        for service in ${services}; do
@@ -147,11 +147,11 @@ dhcpd_restart() {
 }
 
 dhcpd_reload() {
 }
 
 dhcpd_reload() {
-       dhcpd_restart $@
+       dhcpd_restart "$@"
 }
 
 dhcpd_enable() {
 }
 
 dhcpd_enable() {
-       local services=$(dhcpd_service $@)
+       local services=$(dhcpd_service "$@")
 
        local service
        for service in ${services}; do
 
        local service
        for service in ${services}; do
@@ -160,7 +160,7 @@ dhcpd_enable() {
 }
 
 dhcpd_disable() {
 }
 
 dhcpd_disable() {
-       local services=$(dhcpd_service $@)
+       local services=$(dhcpd_service "$@")
 
        local service
        for service in ${services}; do
 
        local service
        for service in ${services}; do
@@ -181,10 +181,10 @@ dhcpd_edit() {
 
        case "${proto}" in
                ipv6)
 
        case "${proto}" in
                ipv6)
-                       _dhcpd_edit_ipv6 $@ || return $?
+                       _dhcpd_edit_ipv6 "$@" || return $?
                        ;;
                ipv4)
                        ;;
                ipv4)
-                       _dhcpd_edit_ipv4 $@ || return $?
+                       _dhcpd_edit_ipv4 "$@" || return $?
                        ;;
        esac
 
                        ;;
        esac
 
@@ -197,7 +197,7 @@ _dhcpd_edit_ipv4() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --authoritative=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --authoritative=*)
-                               val=$(cli_get_val ${1})
+                               val=$(cli_get_val "${1}")
 
                                if enabled val; then
                                        AUTHORITATIVE="true"
 
                                if enabled val; then
                                        AUTHORITATIVE="true"
@@ -206,7 +206,7 @@ _dhcpd_edit_ipv4() {
                                fi
                                ;;
                        --default-lease-time=*)
                                fi
                                ;;
                        --default-lease-time=*)
-                               local val=$(cli_get_val ${1})
+                               local val=$(cli_get_val "${1}")
                                DEFAULT_LEASE_TIME=$(parse_time ${val})
 
                                if ! isinteger DEFAULT_LEASE_TIME; then
                                DEFAULT_LEASE_TIME=$(parse_time ${val})
 
                                if ! isinteger DEFAULT_LEASE_TIME; then
@@ -215,7 +215,7 @@ _dhcpd_edit_ipv4() {
                                fi
                                ;;
                        --max-lease-time=*)
                                fi
                                ;;
                        --max-lease-time=*)
-                               local val=$(cli_get_val ${1})
+                               local val=$(cli_get_val "${1}")
                                MAX_LEASE_TIME=$(parse_time ${val})
 
                                if ! isinteger MAX_LEASE_TIME; then
                                MAX_LEASE_TIME=$(parse_time ${val})
 
                                if ! isinteger MAX_LEASE_TIME; then
@@ -224,7 +224,7 @@ _dhcpd_edit_ipv4() {
                                fi
                                ;;
                        --min-lease-time=*)
                                fi
                                ;;
                        --min-lease-time=*)
-                               local val=$(cli_get_val ${1})
+                               local val=$(cli_get_val "${1}")
                                MIN_LEASE_TIME=$(parse_time ${val})
 
                                if isset MIN_LEASE_TIME; then
                                MIN_LEASE_TIME=$(parse_time ${val})
 
                                if isset MIN_LEASE_TIME; then
@@ -252,7 +252,7 @@ _dhcpd_edit_ipv6() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --preferred-lifetime=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --preferred-lifetime=*)
-                               local val=$(cli_get_val ${1})
+                               local val=$(cli_get_val "${1}")
                                PREFERRED_LIFETIME=$(parse_time ${val})
 
                                if ! isinteger PREFERRED_LIFETIME; then
                                PREFERRED_LIFETIME=$(parse_time ${val})
 
                                if ! isinteger PREFERRED_LIFETIME; then
@@ -261,7 +261,7 @@ _dhcpd_edit_ipv6() {
                                fi
                                ;;
                        --valid-lifetime=*)
                                fi
                                ;;
                        --valid-lifetime=*)
-                               local val=$(cli_get_val ${1})
+                               local val=$(cli_get_val "${1}")
                                VALID_LIFETIME=$(parse_time ${val})
 
                                if ! isinteger VALID_LIFETIME; then
                                VALID_LIFETIME=$(parse_time ${val})
 
                                if ! isinteger VALID_LIFETIME; then
@@ -512,7 +512,7 @@ dhcpd_subnet_match() {
 }
 
 dhcpd_subnet_exists() {
 }
 
 dhcpd_subnet_exists() {
-       dhcpd_subnet_match $@
+       dhcpd_subnet_match "$@"
 }
 
 dhcpd_subnet_new() {
 }
 
 dhcpd_subnet_new() {
@@ -520,7 +520,7 @@ dhcpd_subnet_new() {
        assert isset proto
        shift
 
        assert isset proto
        shift
 
-       dhcpd_subnet_edit ${proto} "new" $@
+       dhcpd_subnet_edit ${proto} "new" "$@"
 }
 
 dhcpd_subnet_edit() {
 }
 
 dhcpd_subnet_edit() {
@@ -557,7 +557,7 @@ dhcpd_subnet_edit() {
                case "${proto},${mode},${1}" in
                        # Common options
                        ipv6,new,*:*/*|ipv4,new,*.*.*.*/*)
                case "${proto},${mode},${1}" in
                        # Common options
                        ipv6,new,*:*/*|ipv4,new,*.*.*.*/*)
-                               local subnet="$(cli_get_val ${1})"
+                               local subnet="$(cli_get_val "${1}")"
 
                                ADDRESS="$(ip_split_prefix ${subnet})"
                                PREFIX="$(ip_get_prefix ${subnet})"
 
                                ADDRESS="$(ip_split_prefix ${subnet})"
                                PREFIX="$(ip_get_prefix ${subnet})"
@@ -617,7 +617,7 @@ dhcpd_subnet_edit() {
                        # IPv4 options
 
                        ipv4,*,--routers=*)
                        # IPv4 options
 
                        ipv4,*,--routers=*)
-                               ROUTERS=$(cli_get_val ${1})
+                               ROUTERS=$(cli_get_val "${1}")
                                ;;
 
                        *)
                                ;;
 
                        *)
@@ -948,7 +948,7 @@ dhcpd_subnet_settings() {
 }
 
 dhcpd_subnet_options_file() {
 }
 
 dhcpd_subnet_options_file() {
-       local path=$(dhcpd_subnet_path $@)
+       local path=$(dhcpd_subnet_path "$@")
        assert isset path
 
        print "${path}/options"
        assert isset path
 
        print "${path}/options"
index 4dc831b88f1a1bc49781823aa8ca1b139e0920cf..6978233f07902bfd71753b42a8f2a30569923521 100644 (file)
@@ -26,8 +26,8 @@ __os_release() {
 
        local line k v
        while read line; do
 
        local line k v
        while read line; do
-               k=$(cli_get_key ${line})
-               v=$(cli_get_val ${line})
+               k=$(cli_get_key "${line}")
+               v=$(cli_get_val "${line}")
 
                if [ "${what}" = "${k}" ]; then
                        echo "${v//\"/}"
 
                if [ "${what}" = "${k}" ]; then
                        echo "${v//\"/}"
index a54feecd12d93ccd40f0508cb4f29796a7d037c2..e7c3e471b801360d605d1a41d087fcffd5866104 100644 (file)
@@ -199,13 +199,13 @@ dns_server_parse_line() {
        while read -r arg; do
                case "${arg}" in
                        server=*)
        while read -r arg; do
                case "${arg}" in
                        server=*)
-                               server=$(cli_get_val ${arg})
+                               server=$(cli_get_val "${arg}")
                                ;;
                        priority=*)
                                ;;
                        priority=*)
-                               priority=$(cli_get_val ${arg})
+                               priority=$(cli_get_val "${arg}")
                                ;;
                esac
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        # The server address must be set.
        isset server || return ${EXIT_ERROR}
 
        # The server address must be set.
        isset server || return ${EXIT_ERROR}
index f362a6fee843090e57b71be1acfaa33d2ab6ec93..6edac62a2125ba2d1809820453bd1502f7ecda00 100644 (file)
@@ -121,7 +121,7 @@ editor_check() {
        shift
 
        # Execute the check function
        shift
 
        # Execute the check function
-       "${check_func}" $@
+       "${check_func}" "$@"
        local ret="${?}"
 
        case "${ret}" in
        local ret="${?}"
 
        case "${ret}" in
index a503c62081535c489e677672a37af3f1ae015302..58a2aa4e03bb6613edf8ffe81d17d6747746bbea 100644 (file)
@@ -740,9 +740,9 @@ _firewall_parse_rule_line() {
                        return ${EXIT_ERROR}
                fi
 
                        return ${EXIT_ERROR}
                fi
 
-               val=$(cli_get_val ${arg})
+               val=$(cli_get_val "${arg}")
                assign "${key}" "${val}"
                assign "${key}" "${val}"
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        # action must always be set.
        if ! isset action; then
 
        # action must always be set.
        if ! isset action; then
index a72bb8e0033f301523099b51602a7fbc5552b441..6b06fdf4e153b0c7d5dbbf4861639a4569ac74b8 100644 (file)
@@ -44,7 +44,7 @@ firewall_zone_config() {
 }
 
 firewall_zone_exists() {
 }
 
 firewall_zone_exists() {
-       local file=$(firewall_zone_config $@)
+       local file=$(firewall_zone_config "$@")
 
        [ -r "${file}" ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
        [ -r "${file}" ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
@@ -106,10 +106,10 @@ firewall_zone_edit() {
                while [ $# -gt 0 ]; do
                        case "${1}" in
                                --masquerade4=*)
                while [ $# -gt 0 ]; do
                        case "${1}" in
                                --masquerade4=*)
-                                       MASQUERADE4=$(cli_get_val ${1})
+                                       MASQUERADE4=$(cli_get_val "${1}")
                                        ;;
                                --policy=*)
                                        ;;
                                --policy=*)
-                                       POLICY=$(cli_get_val ${1})
+                                       POLICY=$(cli_get_val "${1}")
                                        ;;
                                *)
                                        warning "Unknown option: ${1}"
                                        ;;
                                *)
                                        warning "Unknown option: ${1}"
index 205170cdf110870379ebca5b5c358afafcdb4878..0a73585f6ba0fe99700dfc3c98f16c823bdf31b2 100644 (file)
@@ -27,13 +27,13 @@ he_tunnelbroker_endpoint_update() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --username=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --username=*)
-                               username="$(cli_get_val ${1})"
+                               username="$(cli_get_val "${1}")"
                                ;;
                        --password=*)
                                ;;
                        --password=*)
-                               password="$(cli_get_val ${1})"
+                               password="$(cli_get_val "${1}")"
                                ;;
                        --tunnel-id=*)
                                ;;
                        --tunnel-id=*)
-                               tunnel_id="$(cli_get_val ${1})"
+                               tunnel_id="$(cli_get_val "${1}")"
                                ;;
                esac
                shift
                                ;;
                esac
                shift
index b8049db5b7a62336e6bcb522407dcc790db71086..601baee5c493b45381faaf904c2f1e1b5831ae2e 100644 (file)
@@ -155,11 +155,11 @@ config_get_hook() {
 }
 
 hook_zone_exists() {
 }
 
 hook_zone_exists() {
-       hook_exists zone $@
+       hook_exists zone "$@"
 }
 
 hook_zone_exec() {
 }
 
 hook_zone_exec() {
-       hook_exec zone $@
+       hook_exec zone "$@"
 }
 
 hook_zone_get_all() {
 }
 
 hook_zone_get_all() {
@@ -167,11 +167,11 @@ hook_zone_get_all() {
 }
 
 hook_config_exists() {
 }
 
 hook_config_exists() {
-       hook_exists config $@
+       hook_exists config "$@"
 }
 
 hook_config_exec() {
 }
 
 hook_config_exec() {
-       hook_exec config $@
+       hook_exec config "$@"
 }
 
 hook_config_get_all() {
 }
 
 hook_config_get_all() {
index f7bf2fa58bc343ec379a5acc3ecfe52e8a0d1fd7..8645828979a61b2d870ae0dba5912a3709fc7b90 100644 (file)
@@ -44,13 +44,13 @@ hostapd_config_write() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --broadcast-ssid=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --broadcast-ssid=*)
-                               broadcast_ssid=$(cli_get_val ${1})
+                               broadcast_ssid=$(cli_get_val "${1}")
                                ;;
                        --channel=*)
                                ;;
                        --channel=*)
-                               channel=$(cli_get_val ${1})
+                               channel=$(cli_get_val "${1}")
                                ;;
                        --encryption=*)
                                ;;
                        --encryption=*)
-                               encryption=$(cli_get_val ${1})
+                               encryption=$(cli_get_val "${1}")
                                ;;
                        --ieee80211d=*)
                                local val="$(cli_get_val "${1}")"
                                ;;
                        --ieee80211d=*)
                                local val="$(cli_get_val "${1}")"
@@ -61,13 +61,13 @@ hostapd_config_write() {
                                fi
                                ;;
                        --key=*)
                                fi
                                ;;
                        --key=*)
-                               key=$(cli_get_val ${1})
+                               key=$(cli_get_val "${1}")
                                ;;
                        --mode=*)
                                ;;
                        --mode=*)
-                               mode=$(cli_get_val ${1})
+                               mode=$(cli_get_val "${1}")
                                ;;
                        --ssid=*)
                                ;;
                        --ssid=*)
-                               ssid=$(cli_get_val ${1})
+                               ssid=$(cli_get_val "${1}")
                                ;;
                        --wmm=*)
                                local val="$(cli_get_val "${1}")"
                                ;;
                        --wmm=*)
                                local val="$(cli_get_val "${1}")"
index 693f9f87e340286713a32a40de90418c5560c104..f33aeb64bb7962572b9481056f38d5b3f751f733 100644 (file)
@@ -34,10 +34,10 @@ http_GET() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --username=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --username=*)
-                               username="$(cli_get_val ${1})"
+                               username="$(cli_get_val "${1}")"
                                ;;
                        --password=*)
                                ;;
                        --password=*)
-                               password="$(cli_get_val ${1})"
+                               password="$(cli_get_val "${1}")"
                                ;;
                        *)
                                break
                                ;;
                        *)
                                break
@@ -46,7 +46,7 @@ http_GET() {
                shift
        done
 
                shift
        done
 
-       local url="$(cli_get_val ${1})"
+       local url="$(cli_get_val "${1}")"
        shift
 
        # Add credentials to the URL.
        shift
 
        # Add credentials to the URL.
index 4e089d35943e44eaa4723326b49e1e9c264b46af..3bd2c01e0aa812f06507129144606742fa62cba4 100644 (file)
@@ -99,7 +99,7 @@ __bitmap_to_processor_ids() {
 }
 
 __processor_id_to_bitmap() {
 }
 
 __processor_id_to_bitmap() {
-       hex $(( 1 << $@ ))
+       hex $(( 1 << "$@" ))
 }
 
 interrupt_set_smp_affinity() {
 }
 
 interrupt_set_smp_affinity() {
index d6fd76dc3ae78e58f761c880431dba0e20accdb6..3b43da77a3a39b367587cb8347e0cd939779e7cb 100644 (file)
@@ -114,13 +114,13 @@ ip_prefix_is_valid() {
 }
 
 ip_get_network() {
 }
 
 ip_get_network() {
-       inetcalc -n $@ && return ${EXIT_OK} || return ${EXIT_ERROR}
+       inetcalc -n "$@" && return ${EXIT_OK} || return ${EXIT_ERROR}
 }
 
 ip_network_is_subset_of() {
        assert [ $# -eq 2 ]
 
 }
 
 ip_network_is_subset_of() {
        assert [ $# -eq 2 ]
 
-       inetcalc -s $@ && return ${EXIT_TRUE} || return ${EXIT_FALSE}
+       inetcalc -s "$@" && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
 ip_address_add() {
 }
 
 ip_address_add() {
index 0e1115b2dade999875fb3528befff544213aaffb..cb25eddaab4a8387d1b15caf2439909d7975d6d9 100644 (file)
@@ -37,24 +37,24 @@ ip_tunnel_add() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --mode=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --mode=*)
-                               mode="$(cli_get_val ${1})"
+                               mode="$(cli_get_val "${1}")"
                                ;;
                        --ttl=*)
                                ;;
                        --ttl=*)
-                               ttl="$(cli_get_val ${1})"
+                               ttl="$(cli_get_val "${1}")"
                                ;;
                        --remote-address=*)
                                ;;
                        --remote-address=*)
-                               remote_address="$(cli_get_val ${1})"
+                               remote_address="$(cli_get_val "${1}")"
                                ;;
                        --local-address=*)
                                ;;
                        --local-address=*)
-                               local_address="$(cli_get_val ${1})"
+                               local_address="$(cli_get_val "${1}")"
                                ;;
 
                        # Keys for VTI
                        --ikey=*)
                                ;;
 
                        # Keys for VTI
                        --ikey=*)
-                               ikey="$(cli_get_val ${1})"
+                               ikey="$(cli_get_val "${1}")"
                                ;;
                        --okey=*)
                                ;;
                        --okey=*)
-                               okey="$(cli_get_val ${1})"
+                               okey="$(cli_get_val "${1}")"
                                ;;
                esac
                shift
                                ;;
                esac
                shift
index 72838363ef69549cdc8d847983590c541b0906f3..038ed879c345913f11aba3cfaf529696a44f51ec 100644 (file)
@@ -65,10 +65,10 @@ cli_ipsec() {
 
        case "${action}" in
                connection)
 
        case "${action}" in
                connection)
-                       cli_ipsec_connection $@
+                       cli_ipsec_connection "$@"
                        ;;
                pool)
                        ;;
                pool)
-                       cli_ipsec_pool $@
+                       cli_ipsec_pool "$@"
                        ;;
                *)
                        error "Unrecognized argument: ${action}"
                        ;;
                *)
                        error "Unrecognized argument: ${action}"
@@ -86,7 +86,7 @@ cli_ipsec_connection() {
 
                case "${key}" in
                        authentication|down|disable|dpd|enable|inactivity_timeout|local|mode|peer|pool|remote|security_policy|start_action|up)
 
                case "${key}" in
                        authentication|down|disable|dpd|enable|inactivity_timeout|local|mode|peer|pool|remote|security_policy|start_action|up)
-                               ipsec_connection_${key} ${connection} $@
+                               ipsec_connection_${key} ${connection} "$@"
                                ;;
                        show)
                                cli_ipsec_connection_show "${connection}"
                                ;;
                        show)
                                cli_ipsec_connection_show "${connection}"
@@ -103,10 +103,10 @@ cli_ipsec_connection() {
 
                case "${action}" in
                        new)
 
                case "${action}" in
                        new)
-                               ipsec_connection_new $@
+                               ipsec_connection_new "$@"
                                ;;
                        destroy)
                                ;;
                        destroy)
-                               cli_ipsec_connection_destroy $@
+                               cli_ipsec_connection_destroy "$@"
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
@@ -127,7 +127,7 @@ cli_ipsec_pool() {
 
                case "${key}" in
                        dns_server|network)
 
                case "${key}" in
                        dns_server|network)
-                               ipsec_pool_${key} ${pool} $@
+                               ipsec_pool_${key} ${pool} "$@"
                                ;;
                        show)
                                cli_ipsec_pool_show "${pool}"
                                ;;
                        show)
                                cli_ipsec_pool_show "${pool}"
@@ -144,10 +144,10 @@ cli_ipsec_pool() {
 
                case "${action}" in
                        new)
 
                case "${action}" in
                        new)
-                               ipsec_pool_new $@
+                               ipsec_pool_new "$@"
                                ;;
                        destroy)
                                ;;
                        destroy)
-                               ipsec_pool_destroy $@
+                               ipsec_pool_destroy "$@"
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
@@ -363,7 +363,7 @@ ipsec_connection_read_config() {
        if [ $# -eq 0 ] && [ -n "${IPSEC_CONNECTION_CONFIG_SETTINGS}" ]; then
                list_append args ${IPSEC_CONNECTION_CONFIG_SETTINGS}
        else
        if [ $# -eq 0 ] && [ -n "${IPSEC_CONNECTION_CONFIG_SETTINGS}" ]; then
                list_append args ${IPSEC_CONNECTION_CONFIG_SETTINGS}
        else
-               list_append args $@
+               list_append args "$@"
        fi
 
        local path="${NETWORK_IPSEC_CONNS_DIR}/${connection}/settings"
        fi
 
        local path="${NETWORK_IPSEC_CONNS_DIR}/${connection}/settings"
@@ -477,10 +477,10 @@ ipsec_connection_authentication() {
 
        case ${cmd} in
                mode)
 
        case ${cmd} in
                mode)
-                       ipsec_connection_authentication_mode "${connection}" $@
+                       ipsec_connection_authentication_mode "${connection}" "$@"
                        ;;
                pre-shared-key)
                        ;;
                pre-shared-key)
-                       ipsec_connection_authentication_psk "${connection}" $@
+                       ipsec_connection_authentication_psk "${connection}" "$@"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
@@ -574,13 +574,13 @@ ipsec_connection_dpd() {
 
        case ${cmd} in
                action)
 
        case ${cmd} in
                action)
-                       ipsec_connection_dpd_action "${connection}" $@
+                       ipsec_connection_dpd_action "${connection}" "$@"
                        ;;
                delay)
                        ;;
                delay)
-                       ipsec_connection_dpd_delay "${connection}" $@
+                       ipsec_connection_dpd_delay "${connection}" "$@"
                        ;;
                timeout)
                        ;;
                timeout)
-                       ipsec_connection_dpd_timeout "${connection}" $@
+                       ipsec_connection_dpd_timeout "${connection}" "$@"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
@@ -621,7 +621,7 @@ ipsec_connection_dpd_delay() {
        local value=$@
 
        if ! isinteger value; then
        local value=$@
 
        if ! isinteger value; then
-               value=$(parse_time $@)
+               value=$(parse_time "$@")
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
@@ -653,7 +653,7 @@ ipsec_connection_dpd_timeout() {
        local value=$@
 
        if ! isinteger value; then
        local value=$@
 
        if ! isinteger value; then
-               value=$(parse_time $@)
+               value=$(parse_time "$@")
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
@@ -686,13 +686,13 @@ ipsec_connection_local() {
 
        case ${cmd} in
                address)
 
        case ${cmd} in
                address)
-                       ipsec_connection_local_address "${connection}" $@
+                       ipsec_connection_local_address "${connection}" "$@"
                        ;;
                id)
                        ;;
                id)
-                       ipsec_connection_id "${connection}" "LOCAL" $@
+                       ipsec_connection_id "${connection}" "LOCAL" "$@"
                        ;;
                prefix)
                        ;;
                prefix)
-                       ipsec_connection_prefix "${connection}" "LOCAL" $@
+                       ipsec_connection_prefix "${connection}" "LOCAL" "$@"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
@@ -1003,11 +1003,11 @@ ipsec_connection_remote() {
 
        case ${cmd} in
                id)
 
        case ${cmd} in
                id)
-                       ipsec_connection_id "${connection}" "REMOTE" $@
+                       ipsec_connection_id "${connection}" "REMOTE" "$@"
                        ;;
 
                prefix)
                        ;;
 
                prefix)
-                       ipsec_connection_prefix "${connection}" "REMOTE" $@
+                       ipsec_connection_prefix "${connection}" "REMOTE" "$@"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
                        ;;
                *)
                        log ERROR "Unrecognized argument: ${cmd}"
@@ -1030,7 +1030,7 @@ ipsec_connection_inactivity_timeout() {
        local value=$@
 
        if ! isinteger value; then
        local value=$@
 
        if ! isinteger value; then
-               value=$(parse_time $@)
+               value=$(parse_time "$@")
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
@@ -1195,7 +1195,7 @@ ipsec_connection_new() {
 # Function that deletes based on the passed parameters one ore more vpn security policies
 ipsec_connection_destroy() {
        local connection
 # Function that deletes based on the passed parameters one ore more vpn security policies
 ipsec_connection_destroy() {
        local connection
-       for connection in $@; do
+       for connection in "$@"; do
                if ! ipsec_connection_exists "${connection}"; then
                        log ERROR "The VPN IPsec connection ${connection} does not exist."
                        continue
                if ! ipsec_connection_exists "${connection}"; then
                        log ERROR "The VPN IPsec connection ${connection} does not exist."
                        continue
@@ -1598,7 +1598,7 @@ ipsec_pool_read_config() {
        if [ $# -eq 0 ] && [ -n "${IPSEC_POOL_CONFIG_SETTINGS}" ]; then
                list_append args ${IPSEC_POOL_CONFIG_SETTINGS}
        else
        if [ $# -eq 0 ] && [ -n "${IPSEC_POOL_CONFIG_SETTINGS}" ]; then
                list_append args ${IPSEC_POOL_CONFIG_SETTINGS}
        else
-               list_append args $@
+               list_append args "$@"
        fi
 
        local path="${NETWORK_IPSEC_POOLS_DIR}/${pool}/settings"
        fi
 
        local path="${NETWORK_IPSEC_POOLS_DIR}/${pool}/settings"
@@ -1679,7 +1679,7 @@ ipsec_pool_new() {
 # one ore more vpn ipsec pools
 ipsec_pool_destroy() {
        local pool
 # one ore more vpn ipsec pools
 ipsec_pool_destroy() {
        local pool
-       for pool in $@; do
+       for pool in "$@"; do
                if ! ipsec_pool_exists "${pool}"; then
                        log ERROR "The VPN IPsec pool ${pool} does not exist."
                        continue
                if ! ipsec_pool_exists "${pool}"; then
                        log ERROR "The VPN IPsec pool ${pool} does not exist."
                        continue
index 86627a4222bbeca61f1c624ae94a9cd68e6e9985..821eb60854d48f9b72a1a73a2e0e128fd0e34ce9 100644 (file)
@@ -116,7 +116,7 @@ iptables_chain_create() {
                                shift
                                ;;
                        --policy=*)
                                shift
                                ;;
                        --policy=*)
-                               policy="$(cli_get_val ${1})"
+                               policy="$(cli_get_val "${1}")"
                                ;;
                        -*)
                                log WARNING "Unrecognized argument: ${1}"
                                ;;
                        -*)
                                log WARNING "Unrecognized argument: ${1}"
@@ -369,7 +369,7 @@ iptables_dump() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --log-facility=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --log-facility=*)
-                               log_facility="$(cli_get_val ${1})"
+                               log_facility="$(cli_get_val "${1}")"
                                ;;
                        *)
                                log WARNING "Unrecognized argument: ${1}"
                                ;;
                        *)
                                log WARNING "Unrecognized argument: ${1}"
@@ -441,11 +441,11 @@ IPTABLES_MULTIPORT=1
 IPTABLES_PORTRANGE=2
 
 _iptables_port_range() {
 IPTABLES_PORTRANGE=2
 
 _iptables_port_range() {
-       grep -q ":" <<< $@
+       grep -q ":" <<< "$@"
 }
 
 _iptables_port_multiport() {
 }
 
 _iptables_port_multiport() {
-       grep -q "," <<< $@
+       grep -q "," <<< "$@"
 }
 
 _iptables_port() {
 }
 
 _iptables_port() {
@@ -461,7 +461,7 @@ _iptables_port() {
 iptables_source_port() {
        [ -z "$@" ] && return
        local type
 iptables_source_port() {
        [ -z "$@" ] && return
        local type
-       type=$(_iptables_port $@)
+       type=$(_iptables_port "$@")
        if [ "$type" = "$IPTABLES_MULTIPORT" ]; then
                echo "-m multiport --source-ports $@"
        else
        if [ "$type" = "$IPTABLES_MULTIPORT" ]; then
                echo "-m multiport --source-ports $@"
        else
@@ -472,7 +472,7 @@ iptables_source_port() {
 iptables_destination_port() {
        [ -z "$@" ] && return
        local type
 iptables_destination_port() {
        [ -z "$@" ] && return
        local type
-       type=$(_iptables_port $@)
+       type=$(_iptables_port "$@")
        if [ "$type" = "$IPTABLES_MULTIPORT" ]; then
                echo "-m multiport --destination-ports $@"
        else
        if [ "$type" = "$IPTABLES_MULTIPORT" ]; then
                echo "-m multiport --destination-ports $@"
        else
index e893f5ec486779061ab0c41698908145500777c5..d19be518246d9497e6aea9d811d4a6621e17db43 100644 (file)
@@ -260,11 +260,11 @@ ipv4_netmask2prefix() {
 }
 
 ipv4_get_network() {
 }
 
 ipv4_get_network() {
-       ip_get_network $@
+       ip_get_network "$@"
 }
 
 ipv4_get_broadcast() {
 }
 
 ipv4_get_broadcast() {
-       inetcalc -4 -b $@ && return ${EXIT_OK} || return ${EXIT_ERROR}
+       inetcalc -4 -b "$@" && return ${EXIT_OK} || return ${EXIT_ERROR}
 }
 
 ipv4_encode() {
 }
 
 ipv4_encode() {
@@ -315,15 +315,15 @@ ipv4_addr_gt() {
 }
 
 ipv4_addr_ge() {
 }
 
 ipv4_addr_ge() {
-       ipv4_addr_eq $@ || ipv4_addr_gt $@
+       ipv4_addr_eq "$@" || ipv4_addr_gt "$@"
 }
 
 ipv4_addr_lt() {
 }
 
 ipv4_addr_lt() {
-       ! ipv4_addr_eq $@ && ! ipv4_addr_gt $@
+       ! ipv4_addr_eq "$@" && ! ipv4_addr_gt "$@"
 }
 
 ipv4_addr_le() {
 }
 
 ipv4_addr_le() {
-       ipv4_addr_eq $@ || ! ipv4_addr_gt $@
+       ipv4_addr_eq "$@" || ! ipv4_addr_gt "$@"
 }
 
 ipv4_range() {
 }
 
 ipv4_range() {
index e160fb31758b0ce33a7c012d8beebbdfd8582b3e..50c2b9efc84ba84423a70e5918079f62045e70b5 100644 (file)
@@ -64,7 +64,7 @@ ipv6_device_forwarding_enable() {
                                accept_ra=2
                                ;;
                esac
                                accept_ra=2
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        sysctl_set "net.ipv6.conf.${device}.forwarding" 1
 
 
        sysctl_set "net.ipv6.conf.${device}.forwarding" 1
 
@@ -191,7 +191,7 @@ ipv6_address_add() {
                                wait_for_dad="false"
                                ;;
                esac
                                wait_for_dad="false"
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        local cmd="ip addr add ${address} dev ${device} scope ${scope}"
 
 
        local cmd="ip addr add ${address} dev ${device} scope ${scope}"
 
@@ -280,7 +280,7 @@ ipv6_address_change_lifetime() {
                                valid_lft="$(cli_get_val "${arg}")"
                                ;;
                esac
                                valid_lft="$(cli_get_val "${arg}")"
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        local cmd="ip -6 addr change ${address} dev ${device} scope global"
 
 
        local cmd="ip -6 addr change ${address} dev ${device} scope global"
 
@@ -385,7 +385,7 @@ ipv6_device_get_addresses() {
                                scope="$(cli_get_val "${arg}")"
                                ;;
                esac
                                scope="$(cli_get_val "${arg}")"
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        local cmd="ip -o addr show dev ${device}"
        if isset scope; then
 
        local cmd="ip -o addr show dev ${device}"
        if isset scope; then
@@ -411,7 +411,7 @@ ipv6_device_get_addresses() {
 }
 
 ipv6_format() {
 }
 
 ipv6_format() {
-       inetcalc -6 -f $@
+       inetcalc -6 -f "$@"
 }
 
 ipv6_addr_eq() {
 }
 
 ipv6_addr_eq() {
@@ -435,17 +435,17 @@ ipv6_addr_gt() {
 }
 
 ipv6_addr_ge() {
 }
 
 ipv6_addr_ge() {
-       ipv6_addr_eq $@ || ipv6_addr_gt $@
+       ipv6_addr_eq "$@" || ipv6_addr_gt "$@"
 }
 
 ipv6_addr_lt() {
 }
 
 ipv6_addr_lt() {
-       ! ipv6_addr_eq $@ && ! ipv6_addr_gt $@
+       ! ipv6_addr_eq "$@" && ! ipv6_addr_gt "$@"
 }
 
 ipv6_addr_le() {
 }
 
 ipv6_addr_le() {
-       ipv6_addr_eq $@ || ! ipv6_addr_gt $@
+       ipv6_addr_eq "$@" || ! ipv6_addr_gt "$@"
 }
 
 ipv6_get_network() {
 }
 
 ipv6_get_network() {
-       ip_get_network $@
+       ip_get_network "$@"
 }
 }
index 7e96cdf6f3f05d3cab27220868d03d48e019a1c9..9ca13b97b502979ce0c2941c75f33d7fbfb1ae67 100644 (file)
@@ -29,7 +29,7 @@ list_append() {
        shift
 
        local arg
        shift
 
        local arg
-       for arg in $@; do
+       for arg in "$@"; do
                list_append_one "${list}" "${arg}"
        done
 }
                list_append_one "${list}" "${arg}"
        done
 }
@@ -60,7 +60,7 @@ list_append_unique() {
        local ret=${EXIT_ERROR}
 
        local arg
        local ret=${EXIT_ERROR}
 
        local arg
-       for arg in $@; do
+       for arg in "$@"; do
                if ! list_match ${arg} ${!list}; then
                        list_append_one ${list} "${arg}"
                        ret=${EXIT_OK}
                if ! list_match ${arg} ${!list}; then
                        list_append_one ${list} "${arg}"
                        ret=${EXIT_OK}
@@ -83,7 +83,7 @@ list_remove() {
 
        local _list k
        for k in ${!list}; do
 
        local _list k
        for k in ${!list}; do
-               if list_match ${k} $@; then
+               if list_match ${k} "$@"; then
                        ret=${EXIT_OK}
                         continue
                fi
                        ret=${EXIT_OK}
                         continue
                fi
@@ -98,7 +98,7 @@ list_remove() {
 
 list_sort() {
        local i
 
 list_sort() {
        local i
-       for i in $@; do
+       for i in "$@"; do
                print "${i}"
        done | sort | tr '\n' ' '
        print
                print "${i}"
        done | sort | tr '\n' ' '
        print
@@ -106,7 +106,7 @@ list_sort() {
 
 list_unique() {
        local items item
 
 list_unique() {
        local items item
-       for item in $@; do
+       for item in "$@"; do
                # Check if the item has already been processed.
                list_match "${item}" ${items} && continue
 
                # Check if the item has already been processed.
                list_match "${item}" ${items} && continue
 
@@ -120,7 +120,7 @@ list_match() {
        shift
 
        local i
        shift
 
        local i
-       for i in $@; do
+       for i in "$@"; do
                [ "${match}" = "${i}" ] && return ${EXIT_OK}
        done
 
                [ "${match}" = "${i}" ] && return ${EXIT_OK}
        done
 
@@ -137,7 +137,7 @@ list_length() {
        local length=0
 
        local i
        local length=0
 
        local i
-       for i in $@; do
+       for i in "$@"; do
                length=$(( ${length} + 1 ))
        done
 
                length=$(( ${length} + 1 ))
        done
 
@@ -152,7 +152,7 @@ list_count() {
        local counter=0
 
        local arg
        local counter=0
 
        local arg
-       for arg in $@; do
+       for arg in "$@"; do
                if [ "${arg}" = "${what}" ]; then
                        counter=$(( ${counter} + 1 ))
                fi
                if [ "${arg}" = "${what}" ]; then
                        counter=$(( ${counter} + 1 ))
                fi
@@ -177,7 +177,7 @@ list_join() {
 
 list_reverse() {
        local reversed arg
 
 list_reverse() {
        local reversed arg
-       for arg in $@; do
+       for arg in "$@"; do
                reversed="${arg} ${reversed}"
        done
 
                reversed="${arg} ${reversed}"
        done
 
@@ -187,7 +187,7 @@ list_reverse() {
 
 list_head() {
        local arg
 
 list_head() {
        local arg
-       for arg in $@; do
+       for arg in "$@"; do
                print "${arg}"
                return ${EXIT_OK}
        done
                print "${arg}"
                return ${EXIT_OK}
        done
index 90def3f354bee10ee3056f0356fa7a491cf8f0eb..a2b01ca50e9318ea4ccfc9c4aea4061bada31847 100644 (file)
@@ -34,10 +34,10 @@ modem_chat() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --timeout=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --timeout=*)
-                               timeout=$(cli_get_val ${1})
+                               timeout=$(cli_get_val "${1}")
                                ;;
                        --answer=*)
                                ;;
                        --answer=*)
-                               answer=$(cli_get_val ${1})
+                               answer=$(cli_get_val "${1}")
                                ;;
                        --quiet)
                                quiet="true"
                                ;;
                        --quiet)
                                quiet="true"
@@ -204,7 +204,7 @@ modem_sim_unlocked() {
 }
 
 modem_sim_locked() {
 }
 
 modem_sim_locked() {
-       modem_sim_unlocked $@ && return ${EXIT_FALSE} || return ${EXIT_TRUE}
+       modem_sim_unlocked "$@" && return ${EXIT_FALSE} || return ${EXIT_TRUE}
 }
 
 modem_sim_unlock() {
 }
 
 modem_sim_unlock() {
index f7ea1a0b7ee2485b6c8c0802fbb03ff4c5fc1080..5defe0165c1382d38aea3959c23f0bb815f349b0 100644 (file)
@@ -149,7 +149,7 @@ port_is_attached() {
 }
 
 port_is_up() {
 }
 
 port_is_up() {
-       device_is_up $@
+       device_is_up "$@"
 }
 
 port_new() {
 }
 
 port_new() {
@@ -161,7 +161,7 @@ port_new() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       hook_exec port "${hook}" new $@
+       hook_exec port "${hook}" new "$@"
 }
 
 port_destroy() {
 }
 
 port_destroy() {
@@ -203,7 +203,7 @@ port_destroy() {
 }
 
 port_create() {
 }
 
 port_create() {
-       port_cmd "create" $@
+       port_cmd "create" "$@"
 }
 
 port_remove() {
 }
 
 port_remove() {
@@ -234,7 +234,7 @@ port_restart() {
 }
 
 port_edit() {
 }
 
 port_edit() {
-       port_cmd edit $@
+       port_cmd edit "$@"
 }
 
 port_up() {
 }
 
 port_up() {
@@ -252,11 +252,11 @@ port_up() {
 }
 
 port_down() {
 }
 
 port_down() {
-       port_cmd down $@
+       port_cmd down "$@"
 }
 
 port_status() {
 }
 
 port_status() {
-       port_cmd status $@
+       port_cmd status "$@"
 }
 
 port_cmd() {
 }
 
 port_cmd() {
@@ -275,7 +275,7 @@ port_cmd() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       hook_exec port ${hook} ${cmd} ${port} $@
+       hook_exec port ${hook} ${cmd} ${port} "$@"
 }
 
 ports_get() {
 }
 
 ports_get() {
@@ -414,7 +414,7 @@ ports_lowest_address() {
 }
 
 port_identify() {
 }
 
 port_identify() {
-       device_identify $@
+       device_identify "$@"
 }
 
 port_get_color() {
 }
 
 port_get_color() {
index 0840467c33d84114257235ebac52a34a8029610f..b114585fe40c48c88e7c672a2d6d5b9f9e9faa42 100644 (file)
@@ -399,18 +399,18 @@ pppd_write_config() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --auth=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --auth=*)
-                               auth=$(cli_get_val ${1})
+                               auth=$(cli_get_val "${1}")
                                ;;
                        --baudrate=*)
                                ;;
                        --baudrate=*)
-                               baudrate=$(cli_get_val ${1})
+                               baudrate=$(cli_get_val "${1}")
                                assert isoneof baudrate ${SERIAL_BAUDRATES}
                                ;;
                        --connect-command=*)
                                assert isoneof baudrate ${SERIAL_BAUDRATES}
                                ;;
                        --connect-command=*)
-                               connect_cmd=$(cli_get_val ${1})
+                               connect_cmd=$(cli_get_val "${1}")
                                ;;
                        # Enable or disable the use of the default asyncmap.
                        --default-asyncmap=*)
                                ;;
                        # Enable or disable the use of the default asyncmap.
                        --default-asyncmap=*)
-                               value=$(cli_get_val ${1})
+                               value=$(cli_get_val "${1}")
                                if enabled value; then
                                        default_asyncmap="true"
                                else
                                if enabled value; then
                                        default_asyncmap="true"
                                else
@@ -419,15 +419,15 @@ pppd_write_config() {
                                ;;
                        # The name of the created ppp interface.
                        --interface=*)
                                ;;
                        # The name of the created ppp interface.
                        --interface=*)
-                               interface=$(cli_get_val ${1})
+                               interface=$(cli_get_val "${1}")
                                ;;
                        # IPv6
                        --ipv6=*)
                                ;;
                        # IPv6
                        --ipv6=*)
-                               ipv6="$(cli_get_val ${1})"
+                               ipv6="$(cli_get_val "${1}")"
                                ;;
                        # LCP echo failure.
                        --lcr-echo-failure=*)
                                ;;
                        # LCP echo failure.
                        --lcr-echo-failure=*)
-                               lcr_echo_failure=$(cli_get_val ${1})
+                               lcr_echo_failure=$(cli_get_val "${1}")
 
                                if ! isinteger ${lcr_echo_failure}; then
                                        error "--lcr-echo-failure= requires a number"
 
                                if ! isinteger ${lcr_echo_failure}; then
                                        error "--lcr-echo-failure= requires a number"
@@ -436,7 +436,7 @@ pppd_write_config() {
                                ;;
                        # LCP echo interval.
                        --lcr-echo-interval=*)
                                ;;
                        # LCP echo interval.
                        --lcr-echo-interval=*)
-                               lcr_echo_interval=$(cli_get_val ${1})
+                               lcr_echo_interval=$(cli_get_val "${1}")
 
                                if ! isinteger ${lcr_echo_failure}; then
                                        error "--lcr-echo-interval= requires a number"
 
                                if ! isinteger ${lcr_echo_failure}; then
                                        error "--lcr-echo-interval= requires a number"
@@ -445,23 +445,23 @@ pppd_write_config() {
                                ;;
                        # Maximum Transmission Unit
                        --mtu=*)
                                ;;
                        # Maximum Transmission Unit
                        --mtu=*)
-                               mtu=$(cli_get_val ${1})
+                               mtu=$(cli_get_val "${1}")
                                ;;
                        # Maximum Receive Unit
                        --mru=*)
                                ;;
                        # Maximum Receive Unit
                        --mru=*)
-                               mru=$(cli_get_val ${1})
+                               mru=$(cli_get_val "${1}")
                                ;;
                        --password=*)
                                ;;
                        --password=*)
-                               password=$(cli_get_val ${1})
+                               password=$(cli_get_val "${1}")
                                ;;
                        --plugin=*)
                                ;;
                        --plugin=*)
-                               plugin=$(cli_get_val ${1})
+                               plugin=$(cli_get_val "${1}")
                                ;;
                        --plugin-options=*)
                                ;;
                        --plugin-options=*)
-                               plugin_options=$(cli_get_val ${1})
+                               plugin_options=$(cli_get_val "${1}")
                                ;;
                        --pty=*)
                                ;;
                        --pty=*)
-                               pty=$(cli_get_val ${1})
+                               pty=$(cli_get_val "${1}")
                                ;;
                        # Refused authentication methods
                        --refuse=*)
                                ;;
                        # Refused authentication methods
                        --refuse=*)
@@ -470,13 +470,13 @@ pppd_write_config() {
                                ;;
                        # Sets if the modem is a serial device.
                        --serial=*)
                                ;;
                        # Sets if the modem is a serial device.
                        --serial=*)
-                               serial=$(cli_get_val ${1})
+                               serial=$(cli_get_val "${1}")
                                ;;
                        --serial-device=*)
                                ;;
                        --serial-device=*)
-                               serial_device=$(cli_get_val ${1})
+                               serial_device=$(cli_get_val "${1}")
                                ;;
                        --username=*)
                                ;;
                        --username=*)
-                               username=$(cli_get_val ${1})
+                               username=$(cli_get_val "${1}")
                                ;;
                        *)
                                log WARNING "Unhandled argument: ${1}"
                                ;;
                        *)
                                log WARNING "Unhandled argument: ${1}"
index 2db743310d6d574b1bec48d93335114115e65cbc..5d65d24ecb89aae93471290f410ab7c0a5eb421b 100644 (file)
@@ -70,30 +70,30 @@ pppoe_server_options() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --auth=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --auth=*)
-                               auth=$(cli_get_val ${1})
+                               auth=$(cli_get_val "${1}")
                                ;;
                        --default-asyncmap=*)
                                ;;
                        --default-asyncmap=*)
-                               default_asyncmap=$(cli_get_val ${1})
+                               default_asyncmap=$(cli_get_val "${1}")
                                ;;
                        --disable-ipv6)
                                ipv6="false"
                                ;;
                        --dns-servers=*)
                                ;;
                        --disable-ipv6)
                                ipv6="false"
                                ;;
                        --dns-servers=*)
-                               dns_servers="$(cli_get_val ${1})"
+                               dns_servers="$(cli_get_val "${1}")"
                                ;;
                        --lcp-echo-failure=*)
                                ;;
                        --lcp-echo-failure=*)
-                               lcp_echo_failure=$(cli_get_val ${1})
+                               lcp_echo_failure=$(cli_get_val "${1}")
                                assert isinteger ${lcp_echo_failure}
                                ;;
                        --lcp-echo-interval=*)
                                assert isinteger ${lcp_echo_failure}
                                ;;
                        --lcp-echo-interval=*)
-                               lcp_echo_interval=$(cli_get_val ${1})
+                               lcp_echo_interval=$(cli_get_val "${1}")
                                assert isinteger ${lcp_echo_interval}
                                ;;
                        --proxyarp=*)
                                assert isinteger ${lcp_echo_interval}
                                ;;
                        --proxyarp=*)
-                               proxyarp=$(cli_get_val ${1})
+                               proxyarp=$(cli_get_val "${1}")
                                ;;
                        --require-auth=*)
                                ;;
                        --require-auth=*)
-                               required_auths="${required_auths} $(cli_get_val ${1})"
+                               required_auths="${required_auths} $(cli_get_val "${1}")"
                                ;;
                esac
                shift
                                ;;
                esac
                shift
index 6a2c1fa5a695366e84cae4a513d9ca29ced00ee4..7ca4f59dc9d6248184b410f6f1781e76fabce890 100644 (file)
@@ -23,7 +23,7 @@
 #
 
 cli_route() {
 #
 
 cli_route() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-route
                exit ${EXIT_OK}
        fi
                cli_show_man network-route
                exit ${EXIT_OK}
        fi
@@ -33,7 +33,7 @@ cli_route() {
 
        case "${action}" in
                static)
 
        case "${action}" in
                static)
-                       cli_route_static $@
+                       cli_route_static "$@"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
@@ -47,7 +47,7 @@ cli_route() {
 }
 
 cli_route_static() {
 }
 
 cli_route_static() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-route-static
                exit ${EXIT_OK}
        fi
                cli_show_man network-route-static
                exit ${EXIT_OK}
        fi
@@ -58,20 +58,20 @@ cli_route_static() {
        case "${action}" in
                # Add a new route.
                add)
        case "${action}" in
                # Add a new route.
                add)
-                       route_add $@
+                       route_add "$@"
                        ;;
                # Remove an existing route.
                remove)
                        ;;
                # Remove an existing route.
                remove)
-                       route_remove $@
+                       route_remove "$@"
                        ;;
                # List all routes.
                list)
                        ;;
                # List all routes.
                list)
-                       route_list $@
+                       route_list "$@"
                        return ${EXIT_OK}
                        ;;
                # Reload all routes
                reload)
                        return ${EXIT_OK}
                        ;;
                # Reload all routes
                reload)
-                       route_apply $@
+                       route_apply "$@"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
@@ -93,7 +93,7 @@ route_add() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --gateway=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --gateway=*)
-                               gateway=$(cli_get_val ${1})
+                               gateway=$(cli_get_val "${1}")
                                ;;
                        --unreachable)
                                unreachable="true"
                                ;;
                        --unreachable)
                                unreachable="true"
@@ -105,7 +105,7 @@ route_add() {
                                blackhole="true"
                                ;;
                        --mtu=*)
                                blackhole="true"
                                ;;
                        --mtu=*)
-                               mtu=$(cli_get_val ${1})
+                               mtu=$(cli_get_val "${1}")
                                ;;
                        *)
                                if isset network; then
                                ;;
                        *)
                                if isset network; then
@@ -217,7 +217,7 @@ route_remove() {
        local _network
        local error=${EXIT_OK}
 
        local _network
        local error=${EXIT_OK}
 
-       for _network in $@; do
+       for _network in "$@"; do
                # Validate input
                if ! ip_net_is_valid ${_network} && ! ip_is_valid ${_network}; then
                        error "Invalid IP address or network: ${_network}"
                # Validate input
                if ! ip_net_is_valid ${_network} && ! ip_is_valid ${_network}; then
                        error "Invalid IP address or network: ${_network}"
@@ -260,7 +260,7 @@ route_list() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --protocol=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --protocol=*)
-                               protocol=$(cli_get_val ${1})
+                               protocol=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unrecognized argument: ${1}"
                                ;;
                        *)
                                warning "Unrecognized argument: ${1}"
@@ -335,25 +335,25 @@ route_parse_line() {
        while read arg; do
                case "${arg}" in
                        network=*)
        while read arg; do
                case "${arg}" in
                        network=*)
-                               network=$(cli_get_val ${arg})
+                               network=$(cli_get_val "${arg}")
                                ;;
                        gateway=*)
                                ;;
                        gateway=*)
-                               gateway=$(cli_get_val ${arg})
+                               gateway=$(cli_get_val "${arg}")
                                ;;
                        unreachable=*)
                                ;;
                        unreachable=*)
-                               unreachable=$(cli_get_val ${arg})
+                               unreachable=$(cli_get_val "${arg}")
                                ;;
                        prohibit=*)
                                ;;
                        prohibit=*)
-                               prohibit=$(cli_get_val ${arg})
+                               prohibit=$(cli_get_val "${arg}")
                                ;;
                        blackhole=*)
                                ;;
                        blackhole=*)
-                               blackhole=$(cli_get_val ${arg})
+                               blackhole=$(cli_get_val "${arg}")
                                ;;
                        mtu=*)
                                ;;
                        mtu=*)
-                               mtu=$(cli_get_val ${arg})
+                               mtu=$(cli_get_val "${arg}")
                                ;;
                esac
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        ### Check if all values are correctly set.
 
 
        ### Check if all values are correctly set.
 
@@ -443,19 +443,19 @@ route_entry_add() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --gateway=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --gateway=*)
-                               gateway=$(cli_get_val ${1})
+                               gateway=$(cli_get_val "${1}")
                                ;;
                        --table=*)
                                ;;
                        --table=*)
-                               table=$(cli_get_val ${1})
+                               table=$(cli_get_val "${1}")
                                ;;
                        --type=*)
                                ;;
                        --type=*)
-                               type=$(cli_get_val ${1})
+                               type=$(cli_get_val "${1}")
                                ;;
                        --proto=*)
                                ;;
                        --proto=*)
-                               proto=$(cli_get_val ${1})
+                               proto=$(cli_get_val "${1}")
                                ;;
                        --mtu=*)
                                ;;
                        --mtu=*)
-                               mtu=$(cli_get_val ${1})
+                               mtu=$(cli_get_val "${1}")
                                ;;
                        *)
                                if isset network; then
                                ;;
                        *)
                                if isset network; then
@@ -574,7 +574,7 @@ route_table_flush() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --protocol=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --protocol=*)
-                               protocol=$(cli_get_val ${1})
+                               protocol=$(cli_get_val "${1}")
                                ;;
                        *)
                                table="${1}"
                                ;;
                        *)
                                table="${1}"
@@ -621,7 +621,7 @@ route_table_exists() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --id=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --id=*)
-                               _id=$(cli_get_val ${1})
+                               _id=$(cli_get_val "${1}")
                                ;;
                        *)
                                _table=${1}
                                ;;
                        *)
                                _table=${1}
@@ -653,13 +653,13 @@ route_rule_add() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --lookup=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --lookup=*)
-                               lookup=$(cli_get_val ${1})
+                               lookup=$(cli_get_val "${1}")
                                ;;
                        --priority=*)
                                ;;
                        --priority=*)
-                               priority=$(cli_get_val ${1})
+                               priority=$(cli_get_val "${1}")
                                ;;
                        --protocol=*)
                                ;;
                        --protocol=*)
-                               protocols=$(cli_get_val ${1})
+                               protocols=$(cli_get_val "${1}")
 
                                assert isoneof protocols ${IP_SUPPORTED_PROTOCOLS}
                                ;;
 
                                assert isoneof protocols ${IP_SUPPORTED_PROTOCOLS}
                                ;;
@@ -717,16 +717,16 @@ route_rule_exists() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --from=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --from=*)
-                               from=$(cli_get_val ${1})
+                               from=$(cli_get_val "${1}")
                                ;;
                        --lookup=*)
                                ;;
                        --lookup=*)
-                               lookup=$(cli_get_val ${1})
+                               lookup=$(cli_get_val "${1}")
                                ;;
                        --priority=*)
                                ;;
                        --priority=*)
-                               prio=$(cli_get_val ${1})
+                               prio=$(cli_get_val "${1}")
                                ;;
                        --protocol=*)
                                ;;
                        --protocol=*)
-                               proto=$(cli_get_val ${1})
+                               proto=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unrecognized argument: ${1}"
                                ;;
                        *)
                                warning "Unrecognized argument: ${1}"
index a7d94640546b5402e677d331638bb78f280c539e..becf3f0f16a67cf22f1e2b9fb0c79b8423594c41 100644 (file)
@@ -37,7 +37,7 @@ settings_read() {
                                list_append valid_keys "${arg}"
                                ;;
                esac
                                list_append valid_keys "${arg}"
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        if [ -d "${file}" ]; then
                error "Not a configuration file: '${file}'"
 
        if [ -d "${file}" ]; then
                error "Not a configuration file: '${file}'"
@@ -58,7 +58,7 @@ settings_read() {
                                        list_match ${key} ${valid_keys} || continue
                                fi
 
                                        list_match ${key} ${valid_keys} || continue
                                fi
 
-                               val=$(cli_get_val ${line})
+                               val=$(cli_get_val "${line}")
                                val=$(settings_strip ${val})
 
                                # Assign variable.
                                val=$(settings_strip ${val})
 
                                # Assign variable.
@@ -99,7 +99,7 @@ settings_read_array() {
                                        fi
                                fi
 
                                        fi
                                fi
 
-                               val=$(cli_get_val ${line})
+                               val=$(cli_get_val "${line}")
                                val=$(settings_strip ${val})
 
                                # Assign variable.
                                val=$(settings_strip ${val})
 
                                # Assign variable.
@@ -146,7 +146,7 @@ settings_write() {
                                ;;
                esac
                shift
                                ;;
                esac
                shift
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        # Check if all values to be written are sane
        if isset check_func && ! settings_check "${check_func}"; then
 
        # Check if all values to be written are sane
        if isset check_func && ! settings_check "${check_func}"; then
@@ -159,7 +159,7 @@ settings_write() {
        > ${settings_file}
 
        local param
        > ${settings_file}
 
        local param
-       for param in $(list_sort $@); do
+       for param in $(list_sort "$@"); do
                echo "${param}=\"${!param}\"" >> ${settings_file}
        done
 }
                echo "${param}=\"${!param}\"" >> ${settings_file}
        done
 }
@@ -179,7 +179,7 @@ settings_remove() {
 settings_print() {
        local param
 
 settings_print() {
        local param
 
-       for param in $(list_sort $@); do
+       for param in $(list_sort "$@"); do
                printf "%-32s = %s\n" "${param}" "${!param}"
        done
 }
                printf "%-32s = %s\n" "${param}" "${!param}"
        done
 }
@@ -219,8 +219,8 @@ settings_set() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        *=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        *=*)
-                               local key=$(cli_get_key ${1})
-                               local val=$(cli_get_val ${1})
+                               local key=$(cli_get_key "${1}")
+                               local val=$(cli_get_val "${1}")
 
                                log INFO "Setting configuration option '${key}=${val}'".
 
 
                                log INFO "Setting configuration option '${key}=${val}'".
 
@@ -258,8 +258,8 @@ network_settings_set() {
 
                case "${arg}" in
                        *=*)
 
                case "${arg}" in
                        *=*)
-                               local key=$(cli_get_key ${arg})
-                               local val=$(cli_get_val ${arg})
+                               local key=$(cli_get_key "${arg}")
+                               local val=$(cli_get_val "${arg}")
 
                                case "${key}" in
                                        DNS_RANDOMIZE|DNS_SEARCH_DOMAIN|DNS_USE_LOCAL_RESOLVER)
 
                                case "${key}" in
                                        DNS_RANDOMIZE|DNS_SEARCH_DOMAIN|DNS_USE_LOCAL_RESOLVER)
index 687d008f8f423f4e4d346325e6fc090f6f62869d..24e3e66b1682ed536722744a66a618af2f3f8d01 100644 (file)
@@ -134,7 +134,7 @@ parse_time() {
        local ret=0
 
        local arg
        local ret=0
 
        local arg
-       for arg in $@; do
+       for arg in "$@"; do
                local unit
 
                case "${arg}" in
                local unit
 
                case "${arg}" in
@@ -495,7 +495,7 @@ cmd() {
 }
 
 cmd_quiet() {
 }
 
 cmd_quiet() {
-       cmd $@ &>/dev/null
+       cmd "$@" &>/dev/null
 }
 
 cmd_exec() {
 }
 
 cmd_exec() {
@@ -515,7 +515,7 @@ cmd_not_implemented() {
 
 # Executes the given command in background
 cmd_background() {
 
 # Executes the given command in background
 cmd_background() {
-       cmd_quiet $@ &
+       cmd_quiet "$@" &
 }
 
 # Prints the PID of the process that was started last
 }
 
 # Prints the PID of the process that was started last
@@ -531,7 +531,7 @@ cmd_background_result() {
 
 # Increase security of the read command
 read() {
 
 # Increase security of the read command
 read() {
-       builtin read -r $@
+       builtin read -r "$@"
 }
 
 seq() {
 }
 
 seq() {
@@ -557,7 +557,7 @@ count() {
 }
 
 which() {
 }
 
 which() {
-       type -P $@
+       type -P "$@"
 }
 
 # Prints the number of seconds since epoch.
 }
 
 # Prints the number of seconds since epoch.
index 6d62f17d7ee27d277f067d4ece06006baf8b1149..c004397e60bf447a255b786da459b9f9e1f67a61 100644 (file)
@@ -25,10 +25,10 @@ cli_vpn() {
 
        case "${action}" in
                ipsec)
 
        case "${action}" in
                ipsec)
-                       cli_ipsec $@
+                       cli_ipsec "$@"
                        ;;
                security-policies)
                        ;;
                security-policies)
-                       cli_vpn_security_policies $@
+                       cli_vpn_security_policies "$@"
                        ;;
                *)
                        error "Unrecognized argument: ${action}"
                        ;;
                *)
                        error "Unrecognized argument: ${action}"
index d5b43b0c9283abc0bd49455c72c6fa50560fcec0..14386ecc25c2a60ac8283a3285347832d5228430 100644 (file)
@@ -269,13 +269,13 @@ cli_vpn_security_policies() {
 
                case "${key}" in
                        cipher|compression|integrity|lifetime|pfs|show)
 
                case "${key}" in
                        cipher|compression|integrity|lifetime|pfs|show)
-                               vpn_security_policies_${key} ${security_policy} $@
+                               vpn_security_policies_${key} ${security_policy} "$@"
                                ;;
                        group-type)
                                ;;
                        group-type)
-                               vpn_security_policies_group_type ${security_policy} $@
+                               vpn_security_policies_group_type ${security_policy} "$@"
                                ;;
                        key-exchange)
                                ;;
                        key-exchange)
-                               vpn_security_policies_key_exchange ${security_policy} $@
+                               vpn_security_policies_key_exchange ${security_policy} "$@"
                                ;;
                        *)
                                error "Unrecognized argument: ${key}"
                                ;;
                        *)
                                error "Unrecognized argument: ${key}"
@@ -288,10 +288,10 @@ cli_vpn_security_policies() {
 
                case "${action}" in
                        new)
 
                case "${action}" in
                        new)
-                               vpn_security_policies_new $@
+                               vpn_security_policies_new "$@"
                                ;;
                        destroy)
                                ;;
                        destroy)
-                               vpn_security_policies_destroy $@
+                               vpn_security_policies_destroy "$@"
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
@@ -419,7 +419,7 @@ vpn_security_policies_read_config() {
        if [ $# -eq 0 ] && [ -n "${VPN_SECURITY_POLICIES_CONFIG_SETTINGS}" ]; then
                list_append args ${VPN_SECURITY_POLICIES_CONFIG_SETTINGS}
        else
        if [ $# -eq 0 ] && [ -n "${VPN_SECURITY_POLICIES_CONFIG_SETTINGS}" ]; then
                list_append args ${VPN_SECURITY_POLICIES_CONFIG_SETTINGS}
        else
-               list_append args $@
+               list_append args "$@"
        fi
 
        local path="$(vpn_security_policies_path ${name})"
        fi
 
        local path="$(vpn_security_policies_path ${name})"
@@ -875,7 +875,7 @@ vpn_security_policies_lifetime(){
        fi
 
        if ! isinteger value; then
        fi
 
        if ! isinteger value; then
-               value=$(parse_time $@)
+               value=$(parse_time "$@")
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
                if [ ! $? -eq 0 ]; then
                        log ERROR "Parsing the passed time was not sucessful please check the passed values."
                        return ${EXIT_ERROR}
@@ -974,7 +974,7 @@ vpn_security_policies_new() {
 # Function that deletes based on the passed parameters one ore more vpn security policies
 vpn_security_policies_destroy() {
        local name
 # Function that deletes based on the passed parameters one ore more vpn security policies
 vpn_security_policies_destroy() {
        local name
-       for name in $@; do
+       for name in "$@"; do
                if ! vpn_security_policy_exists ${name}; then
                        log ERROR "The vpn security policy ${name} does not exist."
                        continue
                if ! vpn_security_policy_exists ${name}; then
                        log ERROR "The vpn security policy ${name} does not exist."
                        continue
index ad6a437761c32e9b2c97274d8bc1cdb088c70ee6..57377e1a4f21c692274c8ea340a5f5aff89631cb 100644 (file)
@@ -38,17 +38,17 @@ wireless_create() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               address=$(cli_get_val ${1})
+                               address=$(cli_get_val "${1}")
                                ;;
                        --channel=*)
                                channel=$(cli_get_val "${1}")
                                ;;
                        --phy=*)
                                ;;
                        --channel=*)
                                channel=$(cli_get_val "${1}")
                                ;;
                        --phy=*)
-                               phy=$(cli_get_val ${1})
+                               phy=$(cli_get_val "${1}")
                                phy=$(phy_get ${phy})
                                ;;
                        --type=*)
                                phy=$(phy_get ${phy})
                                ;;
                        --type=*)
-                               type=$(cli_get_val ${1})
+                               type=$(cli_get_val "${1}")
 
                                # ap --> __ap
                                [ "${type}" = "ap" ] && type="__ap"
 
                                # ap --> __ap
                                [ "${type}" = "ap" ] && type="__ap"
@@ -322,13 +322,13 @@ wireless_ibss_join() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --bssid=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --bssid=*)
-                               bssid="$(cli_get_val ${1})"
+                               bssid="$(cli_get_val "${1}")"
                                ;;
                        --essid=*)
                                ;;
                        --essid=*)
-                               essid="$(cli_get_val ${1})"
+                               essid="$(cli_get_val "${1}")"
                                ;;
                        --channel=*)
                                ;;
                        --channel=*)
-                               local channel="$(cli_get_val ${1})"
+                               local channel="$(cli_get_val "${1}")"
 
                                # Save the frequency of the channel instead
                                # of the channel itself.
 
                                # Save the frequency of the channel instead
                                # of the channel itself.
index f8aed22a10e0d9e97e1b49680767a58be65925b9..e7f36771cbdedb626fcefdd227fb15b7fe5dd395 100644 (file)
@@ -36,19 +36,19 @@ wpa_supplicant_config_write() {
        for arg in "$@"; do
                case "${arg}" in
                        --ap-scan=*)
        for arg in "$@"; do
                case "${arg}" in
                        --ap-scan=*)
-                               ap_scan=$(cli_get_val ${arg})
+                               ap_scan=$(cli_get_val "${arg}")
                                ;;
                        --mode=*)
                                ;;
                        --mode=*)
-                               mode=$(cli_get_val ${arg})
+                               mode=$(cli_get_val "${arg}")
 
                                # Empty signals no encryption.
                                isset mode || mode="NONE"
                                ;;
                        --ssid=*)
 
                                # Empty signals no encryption.
                                isset mode || mode="NONE"
                                ;;
                        --ssid=*)
-                               ssid=$(cli_get_val ${arg})
+                               ssid=$(cli_get_val "${arg}")
                                ;;
                        --key=*)
                                ;;
                        --key=*)
-                               key=$(cli_get_val ${arg})
+                               key=$(cli_get_val "${arg}")
                                ;;
                        *)
                                error "Unrecognized argument: ${arg}"
                                ;;
                        *)
                                error "Unrecognized argument: ${arg}"
index b79127a2106e78ca8e57d412877f77604fab3b54..e9e2dd44220a355881388d616166244b5ef1d613 100644 (file)
@@ -210,7 +210,7 @@ zone_cmd() {
        local hook="$(zone_get_hook ${zone})"
        assert isset hook
 
        local hook="$(zone_get_hook ${zone})"
        assert isset hook
 
-       hook_exec zone "${hook}" "${cmd}" "${zone}" $@
+       hook_exec zone "${hook}" "${cmd}" "${zone}" "$@"
 }
 
 zone_new() {
 }
 
 zone_new() {
@@ -238,7 +238,7 @@ zone_new() {
        # Create directories for configs and ports
        mkdir -p $(zone_dir ${zone})/{configs,ports}
 
        # Create directories for configs and ports
        mkdir -p $(zone_dir ${zone})/{configs,ports}
 
-       hook_zone_exec "${hook}" "new" "${zone}" $@
+       hook_zone_exec "${hook}" "new" "${zone}" "$@"
        local ret=$?
 
        # Maybe the zone new hook did not exit correctly.
        local ret=$?
 
        # Maybe the zone new hook did not exit correctly.
@@ -275,7 +275,7 @@ zone_edit() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       hook_zone_exec ${hook} edit ${zone} $@
+       hook_zone_exec ${hook} edit ${zone} "$@"
 }
 
 zone_rename() {
 }
 
 zone_rename() {
@@ -360,7 +360,7 @@ zone_up() {
 
        zone_db ${zone} starting
 
 
        zone_db ${zone} starting
 
-       hook_zone_exec ${hook} up ${zone} $@
+       hook_zone_exec ${hook} up ${zone} "$@"
 
        zone_db ${zone} started
 
 
        zone_db ${zone} started
 
@@ -390,7 +390,7 @@ zone_down() {
 
        zone_db ${zone} stopping
 
 
        zone_db ${zone} stopping
 
-       hook_zone_exec ${hook} down ${zone} $@
+       hook_zone_exec ${hook} down ${zone} "$@"
 
        zone_db ${zone} stopped
 
 
        zone_db ${zone} stopped
 
@@ -437,7 +437,7 @@ zone_identify() {
        local port
        for port in $(zone_get_ports "${zone}"); do
                # Identify all the ports
        local port
        for port in $(zone_get_ports "${zone}"); do
                # Identify all the ports
-               port_identify "${port}" --background $@
+               port_identify "${port}" --background "$@"
 
                # Save the PIDs of the subprocesses
                list_append pids "$(cmd_background_get_pid)"
 
                # Save the PIDs of the subprocesses
                list_append pids "$(cmd_background_get_pid)"
@@ -716,7 +716,7 @@ zone_show() {
 zones_show() {
        local zone
 
 zones_show() {
        local zone
 
-       for zone in $(zones_get $@); do
+       for zone in $(zones_get "$@"); do
                zone_show ${zone}
        done
 }
                zone_show ${zone}
        done
 }
@@ -956,23 +956,23 @@ zone_port_cmd() {
        assert isset hook
 
        # Dispatch command to hook
        assert isset hook
 
        # Dispatch command to hook
-       hook_zone_exec "${hook}" "${cmd}" "${zone}" "${port}" $@
+       hook_zone_exec "${hook}" "${cmd}" "${zone}" "${port}" "$@"
 }
 
 zone_port_create() {
 }
 
 zone_port_create() {
-       zone_port_cmd "port_create" $@
+       zone_port_cmd "port_create" "$@"
 }
 
 zone_port_remove() {
 }
 
 zone_port_remove() {
-       zone_port_cmd "port_remove" $@
+       zone_port_cmd "port_remove" "$@"
 }
 
 zone_port_up() {
 }
 
 zone_port_up() {
-       zone_port_cmd "port_up" $@
+       zone_port_cmd "port_up" "$@"
 }
 
 zone_port_down() {
 }
 
 zone_port_down() {
-       zone_port_cmd "port_down" $@
+       zone_port_cmd "port_down" "$@"
 }
 
 # The next two functions automagically bring up and down
 }
 
 # The next two functions automagically bring up and down
@@ -1013,7 +1013,7 @@ zone_port_stop() {
 }
 
 zone_port_status() {
 }
 
 zone_port_status() {
-       zone_port_cmd "port_status" $@
+       zone_port_cmd "port_status" "$@"
 }
 
 zone_ports_cmd() {
 }
 
 zone_ports_cmd() {
@@ -1029,28 +1029,28 @@ zone_ports_cmd() {
 
        local port
        for port in $(zone_get_ports ${zone}); do
 
        local port
        for port in $(zone_get_ports ${zone}); do
-               hook_zone_exec "${hook}" "${cmd}" "${zone}" "${port}" $@
+               hook_zone_exec "${hook}" "${cmd}" "${zone}" "${port}" "$@"
        done
 }
 
 zone_ports_create() {
        done
 }
 
 zone_ports_create() {
-       zone_ports_cmd "port_create" $@
+       zone_ports_cmd "port_create" "$@"
 }
 
 zone_ports_remove() {
 }
 
 zone_ports_remove() {
-       zone_ports_cmd "port_remove" $@
+       zone_ports_cmd "port_remove" "$@"
 }
 
 zone_ports_up() {
 }
 
 zone_ports_up() {
-       zone_ports_cmd "port_up" $@
+       zone_ports_cmd "port_up" "$@"
 }
 
 zone_ports_down() {
 }
 
 zone_ports_down() {
-       zone_ports_cmd "port_down" $@
+       zone_ports_cmd "port_down" "$@"
 }
 
 zone_ports_status() {
 }
 
 zone_ports_status() {
-       zone_ports_cmd "port_status" $@
+       zone_ports_cmd "port_status" "$@"
 }
 
 zone_configs_cmd() {
 }
 
 zone_configs_cmd() {
@@ -1067,20 +1067,20 @@ zone_configs_cmd() {
                local config_hook="$(zone_config_get_hook "${zone}" "${config}")"
                assert isset config_hook
 
                local config_hook="$(zone_config_get_hook "${zone}" "${config}")"
                assert isset config_hook
 
-               hook_config_exec "${config_hook}" "${cmd}" "${zone}" "${config}" $@
+               hook_config_exec "${config_hook}" "${cmd}" "${zone}" "${config}" "$@"
        done
 }
 
 zone_configs_up() {
        done
 }
 
 zone_configs_up() {
-       zone_configs_cmd "up" $@
+       zone_configs_cmd "up" "$@"
 }
 
 zone_configs_down() {
 }
 
 zone_configs_down() {
-       zone_configs_cmd "down" $@
+       zone_configs_cmd "down" "$@"
 }
 
 zone_configs_status() {
 }
 
 zone_configs_status() {
-       zone_configs_cmd "status" $@
+       zone_configs_cmd "status" "$@"
 }
 
 zone_configs_list() {
 }
 
 zone_configs_list() {
@@ -1234,7 +1234,7 @@ zone_config_get_hook_from_id() {
 }
 
 zone_has_ip() {
 }
 
 zone_has_ip() {
-       device_has_ip $@
+       device_has_ip "$@"
 }
 
 zone_db() {
 }
 
 zone_db() {
@@ -1256,7 +1256,7 @@ zone_is_up() {
 }
 
 zone_is_down() {
 }
 
 zone_is_down() {
-       ! zone_is_up $@
+       ! zone_is_up "$@"
 }
 
 zone_get_supported_port_hooks() {
 }
 
 zone_get_supported_port_hooks() {
@@ -1288,7 +1288,7 @@ zone_settings_read() {
        if [ $# -eq 0 ] && [ -n "${HOOK_SETTINGS}" ]; then
                list_append args ${HOOK_SETTINGS}
        else
        if [ $# -eq 0 ] && [ -n "${HOOK_SETTINGS}" ]; then
                list_append args ${HOOK_SETTINGS}
        else
-               list_append args $@
+               list_append args "$@"
        fi
 
        # Save the HOOK variable.
        fi
 
        # Save the HOOK variable.
@@ -1357,7 +1357,7 @@ zone_config_settings_read() {
        if [ $# -eq 0 ] && [ -n "${HOOK_CONFIG_SETTINGS}" ]; then
                list_append args ${HOOK_CONFIG_SETTINGS}
        else
        if [ $# -eq 0 ] && [ -n "${HOOK_CONFIG_SETTINGS}" ]; then
                list_append args ${HOOK_CONFIG_SETTINGS}
        else
-               list_append args $@
+               list_append args "$@"
        fi
 
        local path="$(zone_dir "${zone}")/configs/${config}"
        fi
 
        local path="$(zone_dir "${zone}")/configs/${config}"
@@ -1415,7 +1415,7 @@ zone_port_settings_read() {
        if [ $# -eq 0 ] && [ -n "${HOOK_PORT_SETTINGS}" ]; then
                list_append args ${HOOK_PORT_SETTINGS}
        else
        if [ $# -eq 0 ] && [ -n "${HOOK_PORT_SETTINGS}" ]; then
                list_append args ${HOOK_PORT_SETTINGS}
        else
-               list_append args $@
+               list_append args "$@"
        fi
 
        local path="$(zone_dir "${zone}")/ports/${port}"
        fi
 
        local path="$(zone_dir "${zone}")/ports/${port}"
index 6341a22bd0774245ba0a055155ed2ddf206aaf08..ec85a70ec3c51487a056cc36363f0c2ecf07ea94 100644 (file)
@@ -55,7 +55,7 @@ hook_edit() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
index 9fd2503abdc932c9ae9e935318271e95b2cc5319..68cb62dec2e0b8f0340b171aa7402df76443471f 100644 (file)
@@ -66,7 +66,7 @@ hook_default_edit() {
 
        port_settings_read "${port}" ${HOOK_SETTINGS}
 
 
        port_settings_read "${port}" ${HOOK_SETTINGS}
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
@@ -76,7 +76,7 @@ hook_default_edit() {
 }
 
 hook_edit() {
 }
 
 hook_edit() {
-       hook_default_edit $@
+       hook_default_edit "$@"
 }
 
 # Returns a list of all children of this port
 }
 
 # Returns a list of all children of this port
@@ -132,7 +132,7 @@ hook_default_up() {
 
 # Depends on the port existing
 hook_up() {
 
 # Depends on the port existing
 hook_up() {
-       hook_default_up $@
+       hook_default_up "$@"
 }
 
 hook_default_down() {
 }
 
 hook_default_down() {
@@ -151,5 +151,5 @@ hook_default_down() {
 }
 
 hook_down() {
 }
 
 hook_down() {
-       hook_default_down $@
+       hook_default_down "$@"
 }
 }
index 189fbc38d7f365d5215f29e4a9c51ee2efb16f79..ead4a32c0512fb6170f6191ead4544286cd217e6 100644 (file)
@@ -34,7 +34,7 @@ hook_new() {
        assert isset zone
        shift
 
        assert isset zone
        shift
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
@@ -56,7 +56,7 @@ hook_edit() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
@@ -112,7 +112,7 @@ hook_port() {
        local ret
        case "${action}" in
                add|create|edit|rem|show)
        local ret
        case "${action}" in
                add|create|edit|rem|show)
-                       hook_port_${action} "${zone}" $@
+                       hook_port_${action} "${zone}" "$@"
                        ret=$?
                        ;;
                *)
                        ret=$?
                        ;;
                *)
@@ -150,7 +150,7 @@ hook_default_port_create() {
 }
 
 hook_port_create() {
 }
 
 hook_port_create() {
-       hook_default_port_create $@
+       hook_default_port_create "$@"
 }
 
 hook_default_port_remove() {
 }
 
 hook_default_port_remove() {
@@ -163,7 +163,7 @@ hook_default_port_remove() {
 }
 
 hook_port_remove() {
 }
 
 hook_port_remove() {
-       hook_default_port_remove $@
+       hook_default_port_remove "$@"
 }
 
 hook_port_up() {
 }
 
 hook_port_up() {
index 7f6780b5d34fc0b4b85e8e51b860c73db70d90a8..f22507c651a83fe6665c26fdee22829779faf22e 100644 (file)
@@ -72,7 +72,7 @@ hook_new() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
index ef74991ec44de20def2a80d3956ce41481bb3029..7aea0b978ca95b0fab06e27b6b64add5b07469e3 100644 (file)
@@ -87,7 +87,7 @@ hook_parse_cmdline() {
                                exit ${EXIT_CONF_ERROR}
                                ;;
                esac
                                exit ${EXIT_CONF_ERROR}
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        if ! isset ADDRESS; then
                error "You need to provide an IPv4 address"
 
        if ! isset ADDRESS; then
                error "You need to provide an IPv4 address"
@@ -115,7 +115,7 @@ hook_new() {
 
        assert zone_exists "${zone}"
 
 
        assert zone_exists "${zone}"
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
index 375e585d3ad834c9a4e3dc84d817d9134218d6a5..bf1003d1988ce3e150ed1684efba932d046ecf77 100644 (file)
@@ -45,7 +45,7 @@ hook_parse_cmdline() {
                                fi
                                ;;
                esac
                                fi
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 }
 
 hook_new() {
 }
 
 hook_new() {
@@ -57,7 +57,7 @@ hook_new() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
index c41401cb75890343741f2b105f5d3303e50afd0d..273c201a7996e71378a676d6b11f14b40dd8cd98 100644 (file)
@@ -66,7 +66,7 @@ hook_new() {
        local zone=${1}
        shift
 
        local zone=${1}
        shift
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
index b4d2538947c76d45c9e439325aab978fb7e61e71..7021be2a973c60440a592a5e31dc573a5d173856 100644 (file)
@@ -65,24 +65,24 @@ hook_parse_cmdline() {
                                done
                                ;;
                        --max-sessions=*)
                                done
                                ;;
                        --max-sessions=*)
-                               MAX_SESSIONS=$(cli_get_val ${1})
+                               MAX_SESSIONS=$(cli_get_val "${1}")
                                if ! isinteger ${MAX_SESSIONS} || ! [ ${MAX_SESSIONS} -ge 0 ]; then
                                        error "Invalid value for '--max-session'. This value must be an integer greate or eqal zero."
                                        exit ${EXIT_ERROR}
                                fi
                                ;;
                        --mtu=*)
                                if ! isinteger ${MAX_SESSIONS} || ! [ ${MAX_SESSIONS} -ge 0 ]; then
                                        error "Invalid value for '--max-session'. This value must be an integer greate or eqal zero."
                                        exit ${EXIT_ERROR}
                                fi
                                ;;
                        --mtu=*)
-                               MTU=$(cli_get_val ${1})
+                               MTU=$(cli_get_val "${1}")
                                if ! mtu_is_valid "ipv4" ${MTU}; then
                                        error "Invalid value for '--mtu'. Cannot be larger then 9000 or smaller than 576"
                                        exit ${EXIT_ERROR}
                                fi
                                ;;
                        --service-name=*)
                                if ! mtu_is_valid "ipv4" ${MTU}; then
                                        error "Invalid value for '--mtu'. Cannot be larger then 9000 or smaller than 576"
                                        exit ${EXIT_ERROR}
                                fi
                                ;;
                        --service-name=*)
-                               SERVICE_NAME=$(cli_get_val ${1})
+                               SERVICE_NAME=$(cli_get_val "${1}")
                                ;;
                        --subnet=*)
                                ;;
                        --subnet=*)
-                               SUBNET=$(cli_get_val ${1})
+                               SUBNET=$(cli_get_val "${1}")
                                if ! ipv4_net_is_valid "${SUBNET}"; then
                                        error "Invalid IPv4 Subnet ${SUBNET}."
                                        exit ${EXIT_ERROR}
                                if ! ipv4_net_is_valid "${SUBNET}"; then
                                        error "Invalid IPv4 Subnet ${SUBNET}."
                                        exit ${EXIT_ERROR}
@@ -105,7 +105,7 @@ hook_new() {
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi
index 4f1620199b47dfb9e84fbec5780ac3f76ea2aa85..b304f4fe6f07b31af0e5c7d451df2559a0f0287a 100644 (file)
@@ -37,10 +37,10 @@ hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               ADDRESS="$(cli_get_val ${1})"
+                               ADDRESS="$(cli_get_val "${1}")"
                                ;;
                        --slaves=*)
                                ;;
                        --slaves=*)
-                               SLAVES="$(cli_get_val ${1})"
+                               SLAVES="$(cli_get_val "${1}")"
                                ;;
                        *)
                                warning "Ignoring unknown argument '${1}'"
                                ;;
                        *)
                                warning "Ignoring unknown argument '${1}'"
@@ -67,13 +67,13 @@ hook_edit() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               ADDRESS="$(cli_get_val ${1})"
+                               ADDRESS="$(cli_get_val "${1}")"
                                ;;
                        --add-slave=*)
                                ;;
                        --add-slave=*)
-                               SLAVES="${SLAVES} $(cli_get_val ${1})"
+                               SLAVES="${SLAVES} $(cli_get_val "${1}")"
                                ;;
                        --del-slave=*)
                                ;;
                        --del-slave=*)
-                               local slave="$(cli_get_val ${1})"
+                               local slave="$(cli_get_val "${1}")"
 
                                local s slaves
                                for s in ${SLAVES}; do
 
                                local s slaves
                                for s in ${SLAVES}; do
index e268186c5984e3ccebea588c41e53adbfdb8444f..36bcf6c7dc76fa4036c8c67f35f7e8f1376366d9 100644 (file)
@@ -39,16 +39,16 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --miimon=*)
                                ;;
                        --miimon=*)
-                               MIIMON=$(cli_get_val ${1})
+                               MIIMON=$(cli_get_val "${1}")
                                ;;
                        --mode=*)
                                ;;
                        --mode=*)
-                               MODE=$(cli_get_val ${1})
+                               MODE=$(cli_get_val "${1}")
                                ;;
                        +*)
                                ;;
                        +*)
-                               local slave=$(cli_get_val ${1:1})
+                               local slave=$(cli_get_val "${1:1}")
 
                                if port_exists "${slave}"; then
                                        if list_match "${slave}" ${SLAVES}; then
 
                                if port_exists "${slave}"; then
                                        if list_match "${slave}" ${SLAVES}; then
@@ -61,7 +61,7 @@ hook_parse_cmdline() {
                                fi
                                ;;
                        -*)
                                fi
                                ;;
                        -*)
-                               local slave=$(cli_get_val ${1:1})
+                               local slave=$(cli_get_val "${1:1}")
                                if ! list_remove SLAVES "${slave}"; then
                                        warning "Port ${slave} is not a slave of this bonding device"
                                fi
                                if ! list_remove SLAVES "${slave}"; then
                                        warning "Port ${slave} is not a slave of this bonding device"
                                fi
@@ -84,7 +84,7 @@ hook_parse_cmdline() {
 }
 
 hook_new() {
 }
 
 hook_new() {
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
@@ -106,7 +106,7 @@ hook_new() {
 hook_edit() {
        local port=${1}
 
 hook_edit() {
        local port=${1}
 
-       if ! hook_default_edit $@; then
+       if ! hook_default_edit "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
index 7e6f5d2460bd1a469a15017ffd80c97a5c4abc3f..30de50e99e781e4442cf2794673021fbd0f4e915 100644 (file)
@@ -31,7 +31,7 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
@@ -53,7 +53,7 @@ hook_parse_cmdline() {
 }
 
 hook_new() {
 }
 
 hook_new() {
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
index 344361484fbceb7a6469f6c7630e2b4036efb180..2231de116ba84fd08abcc86d8acae4927110b314 100644 (file)
@@ -51,13 +51,13 @@ hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --parent-device=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --parent-device=*)
-                               PARENT_DEVICE=$(cli_get_val ${1})
+                               PARENT_DEVICE=$(cli_get_val "${1}")
                                ;;
                        --address=*)
                                ;;
                        --address=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --tag=*)
                                ;;
                        --tag=*)
-                               TAG=$(cli_get_val ${1})
+                               TAG=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
@@ -83,7 +83,7 @@ hook_edit() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
index 09ab402816b9861baf8217e651a4a28339c9a990..d97bf551f93253befe3600816ee2f7e78a23fffb 100644 (file)
@@ -45,22 +45,22 @@ hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --bssid=*)
                                ;;
                        --bssid=*)
-                               BSSID=$(cli_get_val ${1})
+                               BSSID=$(cli_get_val "${1}")
                                ;;
                        --channel=*)
                                ;;
                        --channel=*)
-                               CHANNEL=$(cli_get_val ${1})
+                               CHANNEL=$(cli_get_val "${1}")
                                ;;
                        --mtu=*)
                                MTU="$(cli_get_val "${1}")"
                                ;;
                        --phy=*)
                                ;;
                        --mtu=*)
                                MTU="$(cli_get_val "${1}")"
                                ;;
                        --phy=*)
-                               PHY=$(cli_get_val ${1})
+                               PHY=$(cli_get_val "${1}")
                                ;;
                        --ssid=*)
                                ;;
                        --ssid=*)
-                               SSID=$(cli_get_val ${1})
+                               SSID=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Ignoring unknown argument '${1}'"
                                ;;
                        *)
                                warning "Ignoring unknown argument '${1}'"
@@ -91,16 +91,16 @@ hook_edit() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --bssid=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --bssid=*)
-                               BSSID=$(cli_get_val ${1})
+                               BSSID=$(cli_get_val "${1}")
                                ;;
                        --channel=*)
                                ;;
                        --channel=*)
-                               CHANNEL=$(cli_get_val ${1})
+                               CHANNEL=$(cli_get_val "${1}")
                                ;;
                        --mtu=*)
                                MTU="$(cli_get_val "${1}")"
                                ;;
                        --ssid=*)
                                ;;
                        --mtu=*)
                                MTU="$(cli_get_val "${1}")"
                                ;;
                        --ssid=*)
-                               SSID=$(cli_get_val ${1})
+                               SSID=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
                                ;;
                        *)
                                warning "Unknown argument '${1}'"
index 9c0375cc80bf32f266ad5f85ababc0f0dab45728..4b31a8b25e35a0449e905e1707a4c02b1ed95c04 100644 (file)
@@ -59,28 +59,28 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --broadcast-ssid=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --broadcast-ssid=*)
-                               BROADCAST_SSID=$(cli_get_val ${1})
+                               BROADCAST_SSID=$(cli_get_val "${1}")
                                ;;
                        --channel=*)
                                ;;
                        --channel=*)
-                               CHANNEL=$(cli_get_val ${1})
+                               CHANNEL=$(cli_get_val "${1}")
                                ;;
                        --encryption=*)
                                ;;
                        --encryption=*)
-                               ENCRYPTION=$(cli_get_val ${1})
+                               ENCRYPTION=$(cli_get_val "${1}")
                                ;;
                        --key=*)
                                ;;
                        --key=*)
-                               KEY=$(cli_get_val ${1})
+                               KEY=$(cli_get_val "${1}")
                                ;;
                        --mac=*)
                                ;;
                        --mac=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --mode=*)
                                ;;
                        --mode=*)
-                               MODE=$(cli_get_val ${1})
+                               MODE=$(cli_get_val "${1}")
                                ;;
                        --phy=*)
                                ;;
                        --phy=*)
-                               PHY=$(cli_get_val ${1})
+                               PHY=$(cli_get_val "${1}")
                                ;;
                        --ssid=*)
                                ;;
                        --ssid=*)
-                               SSID=$(cli_get_val ${1})
+                               SSID=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Ignoring unknown argument '${1}'"
                                ;;
                        *)
                                warning "Ignoring unknown argument '${1}'"
@@ -98,7 +98,7 @@ hook_edit() {
        local port=${1}
        assert isset port
 
        local port=${1}
        assert isset port
 
-       if ! hook_default_edit $@; then
+       if ! hook_default_edit "$@"; then
                return ${EXIT_ERROR}
        fi
 
                return ${EXIT_ERROR}
        fi
 
index f55074148b815efa1a6dcbf376a7a5f6f8190418..bf20872acd7fdd4d3c8f4dffd22da159998e1dd0 100644 (file)
@@ -64,16 +64,16 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --server-address=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --server-address=*)
-                               SERVER_ADDRESS=$(cli_get_val ${1})
+                               SERVER_ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --local-ipv4-address=*)
                                ;;
                        --local-ipv4-address=*)
-                               LOCAL_ADDRESS=$(cli_get_val ${1})
+                               LOCAL_ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --local-ipv6-address=*)
                                ;;
                        --local-ipv6-address=*)
-                               LOCAL_ADDRESS6=$(cli_get_val ${1})
+                               LOCAL_ADDRESS6=$(cli_get_val "${1}")
                                ;;
                        --auto-update-endpoint=*)
                                ;;
                        --auto-update-endpoint=*)
-                               local val="$(cli_get_val ${1})"
+                               local val="$(cli_get_val "${1}")"
 
                                if enabled val; then
                                        AUTO_UPDATE_ENDPOINT="true"
 
                                if enabled val; then
                                        AUTO_UPDATE_ENDPOINT="true"
@@ -82,13 +82,13 @@ hook_parse_cmdline() {
                                fi
                                ;;
                        --tunnel-id=*)
                                fi
                                ;;
                        --tunnel-id=*)
-                               TUNNEL_ID="$(cli_get_val ${1})"
+                               TUNNEL_ID="$(cli_get_val "${1}")"
                                ;;
                        --username=*)
                                ;;
                        --username=*)
-                               USERNAME="$(cli_get_val ${1})"
+                               USERNAME="$(cli_get_val "${1}")"
                                ;;
                        --password=*)
                                ;;
                        --password=*)
-                               PASSWORD="$(cli_get_val ${1})"
+                               PASSWORD="$(cli_get_val "${1}")"
                                ;;
                        *)
                                echo "Unknown option: ${1}" >&2
                                ;;
                        *)
                                echo "Unknown option: ${1}" >&2
index 245f4c1a21b59078421552d59c4ffb5e84d7d2a5..e90111ca8286a4bad9f3f06c9e2e5e16836c128d 100644 (file)
@@ -268,7 +268,7 @@ hook_port_attach() {
                                PRIORITY="$(cli_get_val "${arg}")"
                                ;;
                esac
                                PRIORITY="$(cli_get_val "${arg}")"
                                ;;
                esac
-       done <<< "$(args $@)"
+       done <<< "$(args "$@")"
 
        if ! zone_port_settings_write "${zone}" "${port}"; then
                exit ${EXIT_ERROR}
 
        if ! zone_port_settings_write "${zone}" "${port}"; then
                exit ${EXIT_ERROR}
@@ -294,7 +294,7 @@ hook_port_detach() {
 }
 
 hook_port_edit() {
 }
 
 hook_port_edit() {
-       hook_port_attach $@
+       hook_port_attach "$@"
 }
 
 hook_port_up() {
 }
 
 hook_port_up() {
index ff21d4558a85a8cf6c6f6fa0ac463ea24ae082f4..1b4c3c023e0ce0a169da67f8876d22645832c066 100644 (file)
@@ -94,39 +94,39 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --apn=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --apn=*)
-                               APN=$(cli_get_val ${1})
+                               APN=$(cli_get_val "${1}")
                                ;;
                        --auth=*)
                                ;;
                        --auth=*)
-                               AUTH=$(cli_get_val ${1})
+                               AUTH=$(cli_get_val "${1}")
                                ;;
                        --baudrate=*)
                                ;;
                        --baudrate=*)
-                               BAUDRATE=$(cli_get_val ${1})
+                               BAUDRATE=$(cli_get_val "${1}")
                                assert isoneif "${BAUDRATE}" ${SERIAL_BAUDRATES}
                                ;;
                        --device=*)
                                assert isoneif "${BAUDRATE}" ${SERIAL_BAUDRATES}
                                ;;
                        --device=*)
-                               DEVICE=$(cli_get_val ${1})
+                               DEVICE=$(cli_get_val "${1}")
                                ;;
                        --imsi=*)
                                IMSI="$(cli_get_val "${1}")"
                                ;;
                        --monitor-device=*)
                                ;;
                        --imsi=*)
                                IMSI="$(cli_get_val "${1}")"
                                ;;
                        --monitor-device=*)
-                               MONITOR_DEVICE=$(cli_get_val ${1})
+                               MONITOR_DEVICE=$(cli_get_val "${1}")
                                ;;
                        --mtu=*)
                                ;;
                        --mtu=*)
-                               MTU=$(cli_get_val ${1})
+                               MTU=$(cli_get_val "${1}")
                                assert isinteger ${MTU}
                                ;;
                        --password=*)
                                assert isinteger ${MTU}
                                ;;
                        --password=*)
-                               PASSWORD=$(cli_get_val ${1})
+                               PASSWORD=$(cli_get_val "${1}")
                                ;;
                        --phone-number=*)
                                ;;
                        --phone-number=*)
-                               PHONE_NUMBER=$(cli_get_val ${1})
+                               PHONE_NUMBER=$(cli_get_val "${1}")
                                ;;
                        --pin=*)
                                ;;
                        --pin=*)
-                               PIN=$(cli_get_val ${1})
+                               PIN=$(cli_get_val "${1}")
                                ;;
                        --username=*)
                                ;;
                        --username=*)
-                               USERNAME=$(cli_get_val ${1})
+                               USERNAME=$(cli_get_val "${1}")
                                ;;
                        *)
                                echo "Unknown argument: ${1}" >&2
                                ;;
                        *)
                                echo "Unknown argument: ${1}" >&2
index 5b44b8c377d961adf4a54c41778bd454ed3758b7..021d89b2dd5ff1ea1efb9284ff3bf27663ce4ac4 100644 (file)
@@ -64,10 +64,10 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --access-concentrator=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --access-concentrator=*)
-                               ACCESS_CONCENTRATOR=$(cli_get_val ${1})
+                               ACCESS_CONCENTRATOR=$(cli_get_val "${1}")
                                ;;
                        --auth=*)
                                ;;
                        --auth=*)
-                               AUTH=$(cli_get_val ${1})
+                               AUTH=$(cli_get_val "${1}")
                                ;;
                        --ipv6=*)
                                local value="$(cli_get_val "${1}")"
                                ;;
                        --ipv6=*)
                                local value="$(cli_get_val "${1}")"
@@ -78,19 +78,19 @@ hook_parse_cmdline() {
                                fi
                                ;;
                        --mtu=*)
                                fi
                                ;;
                        --mtu=*)
-                               MTU=$(cli_get_val ${1})
+                               MTU=$(cli_get_val "${1}")
                                ;;
                        --password=*)
                                ;;
                        --password=*)
-                               PASSWORD=$(cli_get_val ${1})
+                               PASSWORD=$(cli_get_val "${1}")
                                ;;
                        --prefix-delegation=*)
                                PREFIX_DELEGATION="$(cli_get_bool "${1}")"
                                ;;
                        --service-name=*)
                                ;;
                        --prefix-delegation=*)
                                PREFIX_DELEGATION="$(cli_get_bool "${1}")"
                                ;;
                        --service-name=*)
-                               SERVICE_NAME=$(cli_get_val ${1})
+                               SERVICE_NAME=$(cli_get_val "${1}")
                                ;;
                        --username=*)
                                ;;
                        --username=*)
-                               USERNAME=$(cli_get_val ${1})
+                               USERNAME=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unknown argument: ${1}" >&2
                                ;;
                        *)
                                warning "Unknown argument: ${1}" >&2
index bd202f2a4c2d4a1a789040fa181ac4f5916fb497..0bb4aa81a17e35fcefccb7804d2579fefb07e3f0 100644 (file)
@@ -48,19 +48,19 @@ hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --phy=*|--parent-device=*)
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --phy=*|--parent-device=*)
-                               PHY=$(cli_get_val ${1})
+                               PHY=$(cli_get_val "${1}")
                                ;;
                        --encryption-mode=*)
                                ;;
                        --encryption-mode=*)
-                               ENCRYPTION_MODE=$(cli_get_val ${1})
+                               ENCRYPTION_MODE=$(cli_get_val "${1}")
                                ;;
                        --address=*)
                                ;;
                        --address=*)
-                               ADDRESS=$(cli_get_val ${1})
+                               ADDRESS=$(cli_get_val "${1}")
                                ;;
                        --ssid=*)
                                ;;
                        --ssid=*)
-                               SSID=$(cli_get_val ${1})
+                               SSID=$(cli_get_val "${1}")
                                ;;
                        --key=*)
                                ;;
                        --key=*)
-                               KEY=$(cli_get_val ${1})
+                               KEY=$(cli_get_val "${1}")
                                ;;
                        *)
                                warning "Unrecognized option: ${1}"
                                ;;
                        *)
                                warning "Unrecognized option: ${1}"
index 711cf75f796b7f06c8ae9eba9611f224c1e01c54..bc4210c0506b8afc72d8aa63a61314562e2062f1 100644 (file)
@@ -39,13 +39,13 @@ done
 network_settings_read
 
 cli_settings() {
 network_settings_read
 
 cli_settings() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-settings
                exit ${EXIT_OK}
        fi
 
        if [ -n "${1}" ]; then
                cli_show_man network-settings
                exit ${EXIT_OK}
        fi
 
        if [ -n "${1}" ]; then
-               network_settings_set $@
+               network_settings_set "$@"
                network_settings_write
        else
                network_settings_print
                network_settings_write
        else
                network_settings_print
@@ -53,7 +53,7 @@ cli_settings() {
 }
 
 cli_device() {
 }
 
 cli_device() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-device
                exit ${EXIT_OK}
        fi
                cli_show_man network-device
                exit ${EXIT_OK}
        fi
@@ -63,7 +63,7 @@ cli_device() {
 
        case "${action}" in
                list)
 
        case "${action}" in
                list)
-                       cli_device_list $@
+                       cli_device_list "$@"
                        ;;
                *)
                        local device="${action}"
                        ;;
                *)
                        local device="${action}"
@@ -79,22 +79,22 @@ cli_device() {
 
                        case "${action}" in
                                discover)
 
                        case "${action}" in
                                discover)
-                                       cli_device_discover ${device} $@
+                                       cli_device_discover ${device} "$@"
                                        ;;
                                identify)
                                        ;;
                                identify)
-                                       device_identify "${device}" $@
+                                       device_identify "${device}" "$@"
                                        ;;
                                monitor)
                                        ;;
                                monitor)
-                                       cli_device_monitor "${device}" $@
+                                       cli_device_monitor "${device}" "$@"
                                        ;;
                                status)
                                        cli_device_status ${device}
                                        ;;
                                unlock)
                                        ;;
                                status)
                                        cli_device_status ${device}
                                        ;;
                                unlock)
-                                       cli_device_serial_unlock ${device} $@
+                                       cli_device_serial_unlock ${device} "$@"
                                        ;;
                                ussd)
                                        ;;
                                ussd)
-                                       cli_device_send_ussd_command "${device}" $@
+                                       cli_device_send_ussd_command "${device}" "$@"
                                        ;;
                                *)
                                        cli_show_man network-device
                                        ;;
                                *)
                                        cli_show_man network-device
@@ -339,7 +339,7 @@ cli_device_discover() {
 }
 
 cli_device_serial_unlock() {
 }
 
 cli_device_serial_unlock() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-device
                exit ${EXIT_OK}
        fi
                cli_show_man network-device
                exit ${EXIT_OK}
        fi
@@ -482,7 +482,7 @@ cli_device_list() {
 }
 
 cli_hostname() {
 }
 
 cli_hostname() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network
                exit ${EXIT_OK}
        fi
                cli_show_man network
                exit ${EXIT_OK}
        fi
@@ -501,7 +501,7 @@ cli_hostname() {
 }
 
 cli_port() {
 }
 
 cli_port() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-port
                exit ${EXIT_OK}
        fi
                cli_show_man network-port
                exit ${EXIT_OK}
        fi
@@ -516,13 +516,13 @@ cli_port() {
 
                case "${action}" in
                        edit|create|remove|up|down|status|identify)
 
                case "${action}" in
                        edit|create|remove|up|down|status|identify)
-                               port_${action} "${port}" $@
+                               port_${action} "${port}" "$@"
                                ;;
                        color)
                                ;;
                        color)
-                               color_cli "port" "${port}" $@
+                               color_cli "port" "${port}" "$@"
                                ;;
                        description)
                                ;;
                        description)
-                               description_cli "port" "${port}" $@
+                               description_cli "port" "${port}" "$@"
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
@@ -535,7 +535,7 @@ cli_port() {
 
                case "${action}" in
                        new|destroy)
 
                case "${action}" in
                        new|destroy)
-                               port_${action} $@
+                               port_${action} "$@"
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
@@ -546,7 +546,7 @@ cli_port() {
 }
 
 cli_zone() {
 }
 
 cli_zone() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
@@ -574,19 +574,19 @@ cli_zone() {
 
                case "${action}" in
                        port)
 
                case "${action}" in
                        port)
-                               cli_zone_port "${zone}" $@
+                               cli_zone_port "${zone}" "$@"
                                ;;
                        rename)
                                ;;
                        rename)
-                               cli_zone_rename "${zone}" $@
+                               cli_zone_rename "${zone}" "$@"
                                ;;
                        config|disable|down|edit|enable|identify|status|up)
                                ;;
                        config|disable|down|edit|enable|identify|status|up)
-                               zone_${action} ${zone} $@
+                               zone_${action} ${zone} "$@"
                                ;;
                        color)
                                ;;
                        color)
-                               color_cli "zone" "${zone}" $@
+                               color_cli "zone" "${zone}" "$@"
                                ;;
                        description)
                                ;;
                        description)
-                               description_cli "zone" ${zone} $@
+                               description_cli "zone" ${zone} "$@"
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
@@ -600,10 +600,10 @@ cli_zone() {
 
                case "${action}" in
                        new)
 
                case "${action}" in
                        new)
-                               cli_zone_new $@
+                               cli_zone_new "$@"
                                ;;
                        destroy)
                                ;;
                        destroy)
-                               cli_zone_destroy $@
+                               cli_zone_destroy "$@"
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
                                ;;
                        ""|*)
                                if [ -n "${action}" ]; then
@@ -619,19 +619,19 @@ cli_zone() {
 }
 
 cli_zone_new() {
 }
 
 cli_zone_new() {
-       if cli_help_requested $@ || [ $# -lt 2 ]; then
+       if cli_help_requested "$@" || [ $# -lt 2 ]; then
                cli_show_man network-zone-new
                exit ${EXIT_OK}
        fi
 
                cli_show_man network-zone-new
                exit ${EXIT_OK}
        fi
 
-       zone_new $@
+       zone_new "$@"
 }
 
 # Removes a zone either immediately, if it is currently down,
 # or adds a tag that the removal will be done when the zone
 # is brought down the next time.
 cli_zone_destroy() {
 }
 
 # Removes a zone either immediately, if it is currently down,
 # or adds a tag that the removal will be done when the zone
 # is brought down the next time.
 cli_zone_destroy() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
@@ -651,7 +651,7 @@ cli_zone_destroy() {
 }
 
 cli_zone_port() {
 }
 
 cli_zone_port() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-zone-port
                exit ${EXIT_OK}
        fi
                cli_show_man network-zone-port
                exit ${EXIT_OK}
        fi
@@ -666,7 +666,7 @@ cli_zone_port() {
 
                case "${action}" in
                        edit)
 
                case "${action}" in
                        edit)
-                               zone_port_edit "${zone}" "${port}" $@
+                               zone_port_edit "${zone}" "${port}" "$@"
                                ;;
                        *)
                                error "Unrecognised argument: ${action}"
                                ;;
                        *)
                                error "Unrecognised argument: ${action}"
@@ -679,10 +679,10 @@ cli_zone_port() {
 
                case "${action}" in
                        attach)
 
                case "${action}" in
                        attach)
-                               zone_port_attach "${zone}" $@
+                               zone_port_attach "${zone}" "$@"
                                ;;
                        detach)
                                ;;
                        detach)
-                               zone_port_detach "${zone}" $@
+                               zone_port_detach "${zone}" "$@"
                                ;;
                        *)
                                error "Unrecognised argument: ${action}"
                                ;;
                        *)
                                error "Unrecognised argument: ${action}"
@@ -695,7 +695,7 @@ cli_zone_port() {
 }
 
 cli_zone_rename() {
 }
 
 cli_zone_rename() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
@@ -739,7 +739,7 @@ cli_list_hooks() {
        local type=${1}
        shift
 
        local type=${1}
        shift
 
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
                cli_show_man network-zone
                exit ${EXIT_OK}
        fi
@@ -759,7 +759,7 @@ cli_dhcpd() {
        local proto=${1}
        shift
 
        local proto=${1}
        shift
 
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-dhcp
                exit ${EXIT_OK}
        fi
                cli_show_man network-dhcp
                exit ${EXIT_OK}
        fi
@@ -769,7 +769,7 @@ cli_dhcpd() {
 
        case "${action}" in
                edit)
 
        case "${action}" in
                edit)
-                       dhcpd_edit ${proto} $@
+                       dhcpd_edit ${proto} "$@"
                        ;;
                start)
                        dhcpd_start ${proto}
                        ;;
                start)
                        dhcpd_start ${proto}
@@ -787,10 +787,10 @@ cli_dhcpd() {
                        dhcpd_reload ${proto}
                        ;;
                subnet)
                        dhcpd_reload ${proto}
                        ;;
                subnet)
-                       cli_dhcpd_subnet ${proto} $@
+                       cli_dhcpd_subnet ${proto} "$@"
                        ;;
                show|"")
                        ;;
                show|"")
-                       cli_dhcpd_show ${proto} $@
+                       cli_dhcpd_show ${proto} "$@"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
@@ -879,7 +879,7 @@ cli_dhcpd_subnet() {
        local proto=${1}
        shift
 
        local proto=${1}
        shift
 
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-dhcp-subnet
                exit ${EXIT_OK}
        fi
                cli_show_man network-dhcp-subnet
                exit ${EXIT_OK}
        fi
@@ -889,10 +889,10 @@ cli_dhcpd_subnet() {
 
        case "${action}" in
                new)
 
        case "${action}" in
                new)
-                       dhcpd_subnet_new ${proto} $@
+                       dhcpd_subnet_new ${proto} "$@"
                        ;;
                remove)
                        ;;
                remove)
-                       dhcpd_subnet_remove ${proto} $@
+                       dhcpd_subnet_remove ${proto} "$@"
                        ;;
                *:*/*|*.*.*.*/*)
                        local subnet=${action}
                        ;;
                *:*/*|*.*.*.*/*)
                        local subnet=${action}
@@ -908,7 +908,7 @@ cli_dhcpd_subnet() {
 
                        case "${action}" in
                                edit)
 
                        case "${action}" in
                                edit)
-                                       dhcpd_subnet_edit ${proto} ${subnet} $@
+                                       dhcpd_subnet_edit ${proto} ${subnet} "$@"
                                        local ret=$?
 
                                        if [ ${ret} -eq ${EXIT_OK} ]; then
                                        local ret=$?
 
                                        if [ ${ret} -eq ${EXIT_OK} ]; then
@@ -917,15 +917,15 @@ cli_dhcpd_subnet() {
                                        exit ${ret}
                                        ;;
                                range)
                                        exit ${ret}
                                        ;;
                                range)
-                                       cli_dhcpd_subnet_range ${proto} ${subnet} $@
+                                       cli_dhcpd_subnet_range ${proto} ${subnet} "$@"
                                        exit $?
                                        ;;
                                show)
                                        exit $?
                                        ;;
                                show)
-                                       cli_dhcpd_subnet_show ${proto} ${subnet} $@
+                                       cli_dhcpd_subnet_show ${proto} ${subnet} "$@"
                                        exit $?
                                        ;;
                                options)
                                        exit $?
                                        ;;
                                options)
-                                       cli_dhcpd_subnet_options ${proto} ${subnet} $@
+                                       cli_dhcpd_subnet_options ${proto} ${subnet} "$@"
                                        exit $?
                                        ;;
                                *)
                                        exit $?
                                        ;;
                                *)
@@ -962,10 +962,10 @@ cli_dhcpd_subnet_range() {
 
        case "${action}" in
                new)
 
        case "${action}" in
                new)
-                       dhcpd_subnet_range_new ${proto} ${subnet} $@ || exit ${EXIT_ERROR}
+                       dhcpd_subnet_range_new ${proto} ${subnet} "$@" || exit ${EXIT_ERROR}
                        ;;
                remove)
                        ;;
                remove)
-                       dhcpd_subnet_range_remove ${proto} ${subnet} $@ || exit ${EXIT_ERROR}
+                       dhcpd_subnet_range_remove ${proto} ${subnet} "$@" || exit ${EXIT_ERROR}
                        ;;
                *)
                        error "Unrecognized action: ${action}"
                        ;;
                *)
                        error "Unrecognized action: ${action}"
@@ -1044,7 +1044,7 @@ cli_dhcpd_subnet_options() {
                case "${1}" in
                        *=*)
                                key=$(cli_get_key ${1})
                case "${1}" in
                        *=*)
                                key=$(cli_get_key ${1})
-                               val=$(cli_get_val ${1})
+                               val=$(cli_get_val "${1}")
 
                                dhcpd_subnet_option_set ${proto} ${subnet} ${key} ${val}
                esac
 
                                dhcpd_subnet_option_set ${proto} ${subnet} ${key} ${val}
                esac
@@ -1053,12 +1053,12 @@ cli_dhcpd_subnet_options() {
 }
 
 cli_start() {
 }
 
 cli_start() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network
                exit ${EXIT_OK}
        fi
 
                cli_show_man network
                exit ${EXIT_OK}
        fi
 
-       local zones=$(zones_get $@)
+       local zones=$(zones_get "$@")
 
        local zone
        for zone in ${zones}; do
 
        local zone
        for zone in ${zones}; do
@@ -1069,12 +1069,12 @@ cli_start() {
 }
 
 cli_stop() {
 }
 
 cli_stop() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network
                exit ${EXIT_OK}
        fi
 
                cli_show_man network
                exit ${EXIT_OK}
        fi
 
-       local zones=$(zones_get $@)
+       local zones=$(zones_get "$@")
 
        local zone
        for zone in ${zones}; do
 
        local zone
        for zone in ${zones}; do
@@ -1085,21 +1085,21 @@ cli_stop() {
 }
 
 cli_restart() {
 }
 
 cli_restart() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network
                exit ${EXIT_OK}
        fi
 
                cli_show_man network
                exit ${EXIT_OK}
        fi
 
-       cli_stop $@
+       cli_stop "$@"
 
        # Give the system some time to calm down
        sleep ${TIMEOUT_RESTART}
 
 
        # Give the system some time to calm down
        sleep ${TIMEOUT_RESTART}
 
-       cli_start $@
+       cli_start "$@"
 }
 
 cli_status() {
 }
 
 cli_status() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network
                exit ${EXIT_OK}
        fi
                cli_show_man network
                exit ${EXIT_OK}
        fi
@@ -1110,7 +1110,7 @@ cli_status() {
        local log_disable_stdout=${LOG_DISABLE_STDOUT}
        LOG_DISABLE_STDOUT="true"
 
        local log_disable_stdout=${LOG_DISABLE_STDOUT}
        LOG_DISABLE_STDOUT="true"
 
-       local zones=$(zones_get $@)
+       local zones=$(zones_get "$@")
 
        local zone
        for zone in ${zones}; do
 
        local zone
        for zone in ${zones}; do
@@ -1122,7 +1122,7 @@ cli_status() {
 }
 
 cli_reset() {
 }
 
 cli_reset() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network
                exit ${EXIT_OK}
        fi
                cli_show_man network
                exit ${EXIT_OK}
        fi
@@ -1219,7 +1219,7 @@ cli_help() {
 }
 
 cli_dns_server() {
 }
 
 cli_dns_server() {
-       if cli_help_requested $@; then
+       if cli_help_requested "$@"; then
                cli_show_man network-dns-server
                exit ${EXIT_OK}
        fi
                cli_show_man network-dns-server
                exit ${EXIT_OK}
        fi
@@ -1282,22 +1282,22 @@ cli_raw() {
                        db_dump
                        ;;
                ipsec-connection-exists)
                        db_dump
                        ;;
                ipsec-connection-exists)
-                       ipsec_connection_exists $@
+                       ipsec_connection_exists "$@"
                        ;;
                list-devices)
                        device_list
                        ;;
                list-dhcpd-ranges-of-subnet)
                        ;;
                list-devices)
                        device_list
                        ;;
                list-dhcpd-ranges-of-subnet)
-                       dhcpd_subnet_range_list $@
+                       dhcpd_subnet_range_list "$@"
                        ;;
                list-dhcpd-settings)
                        ;;
                list-dhcpd-settings)
-                       dhcpd_global_settings_list $@
+                       dhcpd_global_settings_list "$@"
                        ;;
                list-dhcpd-subnets)
                        ;;
                list-dhcpd-subnets)
-                       dhcpd_subnet_list $@
+                       dhcpd_subnet_list "$@"
                        ;;
                list-dhcpd-subnet-options)
                        ;;
                list-dhcpd-subnet-options)
-                       dhcpd_subnet_options_list $@
+                       dhcpd_subnet_options_list "$@"
                        ;;
                list-dns-servers)
                        dns_server_list
                        ;;
                list-dns-servers)
                        dns_server_list
@@ -1306,7 +1306,7 @@ cli_raw() {
                        port_list_free
                        ;;
                list-hooks)
                        port_list_free
                        ;;
                list-hooks)
-                       hook_list $@
+                       hook_list "$@"
                        ;;
                list-ipsec-connections)
                        ipsec_list_connections
                        ;;
                list-ipsec-connections)
                        ipsec_list_connections
@@ -1315,7 +1315,7 @@ cli_raw() {
                        port_list
                        ;;
                list-ports-of-zone)
                        port_list
                        ;;
                list-ports-of-zone)
-                       zone_get_ports $@
+                       zone_get_ports "$@"
                        ;;
                list-vpn-security-policies-all)
                        vpn_security_policies_list_all
                        ;;
                list-vpn-security-policies-all)
                        vpn_security_policies_list_all
@@ -1330,22 +1330,22 @@ cli_raw() {
                        zones_get_next_free
                        ;;
                list-zone-config-ids)
                        zones_get_next_free
                        ;;
                list-zone-config-ids)
-                       zone_config_list_ids $@
+                       zone_config_list_ids "$@"
                        ;;
                list-zone-config-hids)
                        ;;
                list-zone-config-hids)
-                       zone_config_list_hids $@
+                       zone_config_list_hids "$@"
                        ;;
                vpn-security-policy-exists)
                        ;;
                vpn-security-policy-exists)
-                       vpn_security_policy_exists $@
+                       vpn_security_policy_exists "$@"
                        ;;
                zone-name-is-valid)
                        ;;
                zone-name-is-valid)
-                       zone_name_is_valid $@
+                       zone_name_is_valid "$@"
                        ;;
                zone-config-id-is-valid)
                        ;;
                zone-config-id-is-valid)
-                       zone_config_id_is_valid $@
+                       zone_config_id_is_valid "$@"
                        ;;
                zone-config-hid-is-valid)
                        ;;
                zone-config-hid-is-valid)
-                       zone_config_hid_is_valid $@
+                       zone_config_hid_is_valid "$@"
                        ;;
                *)
                        error "No such command: ${cmd}"
                        ;;
                *)
                        error "No such command: ${cmd}"
@@ -1363,25 +1363,25 @@ case "${action}" in
                ;;
 
        settings|hostname|port|device|zone|start|stop|restart|status|reset|route|vpn)
                ;;
 
        settings|hostname|port|device|zone|start|stop|restart|status|reset|route|vpn)
-               cli_${action} $@
+               cli_${action} "$@"
                ;;
 
        # DHCP server configuration (automatically detects which protocol to use).
        dhcpv6|dhcpv4)
                ;;
 
        # DHCP server configuration (automatically detects which protocol to use).
        dhcpv6|dhcpv4)
-               cli_dhcpd ${action/dhcp/ip} $@
+               cli_dhcpd ${action/dhcp/ip} "$@"
                ;;
 
        # DNS server configuration.
        dns-server)
                ;;
 
        # DNS server configuration.
        dns-server)
-               cli_dns_server $@
+               cli_dns_server "$@"
                ;;
 
        ""|help|--help|-h)
                ;;
 
        ""|help|--help|-h)
-               cli_help $@
+               cli_help "$@"
                ;;
 
        raw)
                ;;
 
        raw)
-               cli_raw $@
+               cli_raw "$@"
                ;;
 
        *)
                ;;
 
        *)