It could be fixed by fixing the obviously wrong patch, and support two cases:
* Set hostname if new_host_name provided and hostname is not set
* Set hostname if new_host_name provided and old_host_name matches the current hostname
Something like
local current_hostname=$(hostname)
if [ -z "$current_hostname" -o "$current_hostname" = "(none)" -o "$current_hostname" = "localhost" -o "$current_hostname" = "$old_host_name" ]; then
if [ -n "$new_host_name" ]; then
hostname "$new_host_name"
fi
fi
However I am not so sure we should support the use case of the debian bug since option host-name should only be "honored by dhclient-script(8) if the hostname for the client machine is not set"...
Bug 482313 would be fixed in the same run (by adding "localhost" to the set of hostnames considered "unset").
Regression was introduced by the fix to: bugs.debian. org/cgi- bin/bugreport. cgi?bug= 508804
http://
It could be fixed by fixing the obviously wrong patch, and support two cases:
* Set hostname if new_host_name provided and hostname is not set
* Set hostname if new_host_name provided and old_host_name matches the current hostname
Something like
local current_ hostname= $(hostname)
if [ -z "$current_hostname" -o "$current_hostname" = "(none)" -o "$current_hostname" = "localhost" -o "$current_hostname" = "$old_host_name" ]; then
if [ -n "$new_host_name" ]; then
hostname "$new_host_name"
fi
fi
However I am not so sure we should support the use case of the debian bug since option host-name should only be "honored by dhclient-script(8) if the hostname for the client machine is not set"...
Bug 482313 would be fixed in the same run (by adding "localhost" to the set of hostnames considered "unset").