tags 236569 + moreinfo
thanks a million

Hi Atsushi,

On Sun, Mar 07, 2004 at 02:09:32PM +1000, Atsushi Nakagawa wrote:
> Package: dhcp3-client
> Version: 3.0+3.0.1rc13-1
> Severity: normal
> 
> 
> dhclient-script breaks and exits prematurely:
> /etc/dhcp3/dhclient-script: line 36: exit_status: unbound variable
> 
> dhclient-script:
> ----
> run_hook() {
>     local script="$1"
>     local exit_status
> 
>     if [ -f $script ]; then
>         . $script
>     fi
> 
> 
> >>> if [ -n "$exit_status" ] && [ "$exit_status" -ne 0 ]; then <<< Line 36
>         logger -p daemon.err "$script returned non-zero exit status 
> $exit_status"
>         save_exit_status=$exit_status
>     fi
> 
>     return $exit_status
> }
> ----
> 
> One of the scripts in /etc/dhcp3/dhclient-exit-hooks.d sets 'set -ue' (Error
> on unbound variable & Exit on error) and since the scripts are sourced, it
> affects dhclient-script too.  Possible workarounds:
> 
> Use ${exit_status:-} instead of $exit_status. - Default value null if unset.
> Use ${exit_status:=} instead of first $exit_status. - Assign default value 
> null
> if unset.

Correct me if I'm wrong, but the sourced hook script in this case isn't
one that ships with dhcp3-client, right?

I'm inclined to agree with Matt on this one, and say that we can't
really 100% successfully guard against badness occurring in 3rd party
hook scripts. There's too many ways that they can break dhclient-script.

I'm inclined to tag this bug "wontfix".

regards

Andrew




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to