[OE-core] [PATCH] udhcpc: specify full path for ip command calls
Joshua G Lock
joshua.g.lock at linux.intel.com
Tue Feb 9 13:58:25 UTC 2016
On Tue, 2016-02-09 at 12:20 +0000, Mark O'Donovan wrote:
> Running with a restricted environment (e.g. cron) was causing
> issues as we check for the ip command with full path and call
> without full path
This change should probably change the /sbin/ path in the script to a
symbol and use sed to replace it with the expansion of ${sbindir}
rather than hard-coding a path which isn't always correct.
Regards,
Joshua
> ---
> meta/recipes-core/busybox/files/simple.script | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/meta/recipes-core/busybox/files/simple.script
> b/meta/recipes-core/busybox/files/simple.script
> index 22168b0..e233c3c 100644
> --- a/meta/recipes-core/busybox/files/simple.script
> +++ b/meta/recipes-core/busybox/files/simple.script
> @@ -28,8 +28,8 @@ case "$1" in
> fi
> if ! root_is_nfs ; then
> if [ $have_bin_ip -eq 1 ]; then
> - ip addr flush dev $interface
> - ip link set dev $interface up
> + /sbin/ip addr flush dev $interface
> + /sbin/ip link set dev $interface up
> else
> /sbin/ifconfig $interface 0.0.0.0
> fi
> @@ -38,7 +38,7 @@ case "$1" in
>
> renew|bound)
> if [ $have_bin_ip -eq 1 ]; then
> - ip addr add dev $interface local $ip/$mask
> $BROADCAST
> + /sbin/ip addr add dev $interface local
> $ip/$mask $BROADCAST
> else
> /sbin/ifconfig $interface $ip $BROADCAST
> $NETMASK
> fi
> @@ -59,7 +59,7 @@ case "$1" in
> metric=10
> for i in $router ; do
> if [ $have_bin_ip -eq 1 ]; then
> - ip route add default via $i
> metric $metric
> + /sbin/ip route add default
> via $i metric $metric
> else
> route add default gw $i dev
> $interface metric $metric 2>/dev/null
> fi
> --
> 1.9.1
>
More information about the Openembedded-core
mailing list