James Carlson writes:
> James Carlson writes:
> > Looking at the code, it seems pretty clear that the author expects
> > that 'set' doesn't change the return code value, and that the "-ne 0"
> > is checking for failures out of /usr/sbin/route itself.
> 
> Ah, shoot, I'm a bonehead.  Of course it works fine.  This is just a
> ksh93 bug and/or misfeature.

I'm getting myself twisted around in here.  Perhaps Alan Maguire
should check this out.

The problem is that net-routing-setup fails with ksh93 but does not
fail with /sbin/sh.  This is CR 6551716.

As best I can tell, the user's system has some kind of bogus default
route installed on it.  It "succeeds" under /sbin/sh because the 'set'
command apparently returns zero status.  At a guess, it's because
ifconfig itself returns zero status, even on failure (!).

On ksh93, the 'set' command here:

-->                     set -- `/usr/sbin/route -n add default \
                            -gateway $router`
                        [ $? -ne 0 -a "x$5" = "x$route_IP:" ] \
                            && do_delete=no

Seems to return a value that's equal to the number of arguments.  This
is surprising, but it apparently makes the script run into trouble.

Does it sound familiar?

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to