Commit 75b6a374 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Improve quoting in eval statements

This covers some corner cases where, for instance, IFS does not contain
whitespace characters.
parent 4d18e145
...@@ -18,7 +18,7 @@ case $ACTION in ...@@ -18,7 +18,7 @@ case $ACTION in
DhcpcdOptions+=" -K -L" DhcpcdOptions+=" -K -L"
ip_set || exit 1 ip_set || exit 1
# Sandbox the eval # Sandbox the eval
if ! ( eval $ExecUpPost ); then if ! ( do_debug eval "$ExecUpPost" ); then
# Failing ExecUpPost will take the connection down # Failing ExecUpPost will take the connection down
netctl-auto stop "$INTERFACE" netctl-auto stop "$INTERFACE"
exit 1 exit 1
...@@ -26,7 +26,7 @@ case $ACTION in ...@@ -26,7 +26,7 @@ case $ACTION in
;; ;;
DISCONNECT) DISCONNECT)
# Sandbox the eval # Sandbox the eval
if ! ( eval $ExecDownPre ); then if ! ( do_debug eval "$ExecDownPre" ); then
exit 1 exit 1
fi fi
ip_unset ip_unset
......
...@@ -93,7 +93,7 @@ timeout_wait() { ...@@ -93,7 +93,7 @@ timeout_wait() {
local timeout=$1 local timeout=$1
(( timeout *= 5 )) (( timeout *= 5 ))
shift shift
until eval "$*"; do until eval "$@"; do
(( timeout-- > 0 )) || return 1 (( timeout-- > 0 )) || return 1
sleep 0.2 sleep 0.2
done done
......
...@@ -49,7 +49,7 @@ case $1 in ...@@ -49,7 +49,7 @@ case $1 in
fi fi
network_ready network_ready
# Sandbox the eval # Sandbox the eval
if ! ( eval $ExecUpPost ); then if ! ( do_debug eval "$ExecUpPost" ); then
report_error "ExecUpPost failed for network profile '$Profile'" report_error "ExecUpPost failed for network profile '$Profile'"
# Failing ExecUpPost will take the connection down # Failing ExecUpPost will take the connection down
"${Connection}_down" "${Connection}_down"
...@@ -61,7 +61,7 @@ case $1 in ...@@ -61,7 +61,7 @@ case $1 in
stop) stop)
report_notice "Stopping network profile '$Profile'..." report_notice "Stopping network profile '$Profile'..."
# Sandbox the eval # Sandbox the eval
if ! ( eval $ExecDownPre ); then if ! ( do_debug eval "$ExecDownPre" ); then
report_error "ExecDownPre failed for network profile '$Profile'" report_error "ExecDownPre failed for network profile '$Profile'"
# Failing ExecDownPre will leave the profile active # Failing ExecDownPre will leave the profile active
exit 1 exit 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment