Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jul 2000 13:58:47 +0900
From:      Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
To:        nsayer@quack.kfu.com
Cc:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Subject:   Re: DHCP client problem?
Message-ID:  <14715.52487.753460.86952F@rina>
In-Reply-To: In your message of "Sun, 23 Jul 2000 13:26:02 -0700" <397B54DA.C55EBAE1@quack.kfu.com>
References:  <200007220022.RAA02194@medusa.kfu.com> <86ittyjtvd.wl@ringo.FromTo.Cc> <397B54DA.C55EBAE1@quack.kfu.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 23 Jul 2000 13:26:02 -0700,
  Nick Sayer <nsayer@quack.kfu.com> said:

Nick> Reversing that patch fixes it. Since the source for this is in contrib,
Nick> I presume we
Nick> need to send this back to ISC rather than patch it in our tree?

Nick> Tatsumi Hosokawa wrote:
(snip)
>> -  if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
>> -     [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
>> -    ifconfig $interface inet $new_ip_address $new_netmask_arg \
>> -                                       $new_broadcast_arg $medium
>> +  if [ "x$old_ip_address" = "x" ] || [ "x$old_ip_address" != "x$new_ip_address" ] || \
>> +     [ "x$reason" = "xBOUND" ] || [ "x$reason" = "xREBOOT" ]; then
>> +    ifconfig "$interface" inet "$new_ip_address" "$new_netmask_arg" \
>> +                                       "$new_broadcast_arg" "$medium"

Did you see this log?

On Thu, 20 Jul 2000 02:53:11 -0700 (PDT),
  "David E. O'Brien" <obrien@FreeBSD.org> said:

David> obrien      2000/07/20 02:53:11 PDT

David>   Modified files:
David>     contrib/isc-dhcp/client/scripts freebsd 
David>   Log:
David>   safe shell quoting
  
David>   Obtained from:	OpenBSD (rev 1.6)


And I have already suggested the following fix.

On Sun, 23 Jul 2000 18:53:55 +0900,
  Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp> said:

Seigo> 1.

Seigo> This breaks ifconfig(8) in dhclient-script(8) because our ifconfig(8)
Seigo> does not support both a parameter name and its argument to be in a
Seigo> single argument.

Seigo> What we need to do against dhclient-script(8) to prevent executing
Seigo> arbitrary commands include:

Seigo> - quoting the arguments from dhclient(8), and
Seigo> - intializing the internal variables.

Seigo> It should be a good idea to quote each argument from dhclient(8),
Seigo> followed by substituting the argument to an internal variable in a way
Seigo> like this:

Seigo> new_netmask_arg="netmask \"$new_subnet_mask\""

Seigo> Then we do not have to quote all of the variables in dhclient-script(8).

Seigo> 2.

Seigo> An argument of "" is passed to ifconfig(8) if the value of $medium is
Seigo> empty, making ifconfig(8) confused. This is because certain ethernet
Seigo> card drivers including ed(4) do not support configuring media
Seigo> types. Fortunately, the fix proposed in 1 allows us once again to
Seigo> remove quotations around the arguments of ifconfig(8).

I wonder if ifconfig(8) of OpenBSD supports providing both the name of
a parameter and its value in a single argument, and an ampty argument...
(eg ifconfig ed1 inet xxx.xxx.xxx.xxx "netmask yyy.yyy.yyy.yyy" "")

-- 
Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp> <tanimura@FreeBSD.org>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14715.52487.753460.86952F>