netcfg lists manually specified domains in duplicate
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netcfg (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: netcfg
Netcfg allows you to specify a fully-qualified hostname, but unfortunately the interpretation of such a name is buggy.
Steps to reproduce:
============
1. Make sure no DHCP server is available
2. Install (K)ubuntu
3. As a hostname, enter a hostname with a domain (such as arthur.
At end of installation the domainname will be set to hitchhiker.
Version information:
============
netcfg_1.39ubuntu4
Explanation of bug:
===========
In netcfg, if the hostname entered by the user contains a dot, the part after the first dot is considered to be the domain. However, unfortunately, the domain is also left in the hostname.
Later, an /etc/hosts is generated which contains a line such as the following:
$ip $hostname.
If the user entered arthur.
158.64.137.20 arthur.
instead of
158.64.137.20 arthur.
The result of this is that all kinds of packages will end up believing that hitchhiker.
Fix:
==
The follwoing patch fixes the issue
diff -ur netcfg.
--- netcfg.
+++ netcfg/
@@ -610,6 +610,7 @@
domain = strdup(s + 1);
+ *s='\0';
}
}
return 0;
Thanks for your report. This is also bug 11019, but your patch looks good - I'll stare at it for a bit and probably merge it.