Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Joshua G Lock <joshua.g.lock@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] udhcpc: specify full path for ip command calls
Date: Tue, 09 Feb 2016 13:58:25 +0000	[thread overview]
Message-ID: <1455026305.6918.5.camel@linux.intel.com> (raw)
In-Reply-To: <1455020449-320-1-git-send-email-modonovan@biotector.com>

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
> 


  reply	other threads:[~2016-02-09 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 12:20 [PATCH] udhcpc: specify full path for ip command calls Mark O'Donovan
2016-02-09 13:58 ` Joshua G Lock [this message]
2016-02-10  9:23   ` [PATCH v2] " Mark O'Donovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455026305.6918.5.camel@linux.intel.com \
    --to=joshua.g.lock@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox