Bug#268334: marked as done (Adds garbage to /etc/network/interfaces)

Debian Bug Tracking System owner@bugs.debian.org
Fri, 24 Jun 2005 03:18:09 -0700


Your message dated Fri, 24 Jun 2005 12:07:26 +0200
with message-id <1119607646.8452.168.camel@thanatos>
and subject line network-admin slightly less crappy now
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 27 Aug 2004 08:40:30 +0000
>From jdthood@yahoo.co.uk Fri Aug 27 01:40:30 2004
Return-path: <jdthood@yahoo.co.uk>
Received: from post-24.mail.nl.demon.net [194.159.73.194] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1C0cHe-0003cM-00; Fri, 27 Aug 2004 01:40:30 -0700
Received: from aglu.demon.nl ([82.161.38.140]:64503 helo=localhost)
	by post-24.mail.nl.demon.net with esmtp (Exim 4.34)
	id 1C0cHd-000E65-7E; Fri, 27 Aug 2004 08:40:29 +0000
Received: by localhost (Postfix, from userid 1001)
	id 9485910D69F; Fri, 27 Aug 2004 10:41:12 +0200 (CEST)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Thomas Hood <jdthood@yahoo.co.uk>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Adds garbage to /etc/network/interfaces
X-Mailer: reportbug 2.64
Date: Fri, 27 Aug 2004 10:41:12 +0200
Message-Id: <20040827084112.9485910D69F@localhost>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: gnome-system-tools
Version: 0.90.0-3
Severity: important

I set Network Settings|General|Domain name to some value and
(after a long delay when the program doesn't appear to be doing
anything but is actually starting a PPP session and doing God
knows what else) one of the unpleasant results is that my
/etc/network/interfaces gets filled with garbage:

* Every logical interface definition now includes a "name" option
  which reads "Unknown interface type".  WTF is that for?  The
  _name_ of the logical interface definition is the string that
  occurs immediately after the keyword "iface" so I object to
  introducing an option called 'name'.
* inet static stanzas also get new "broadcast" and "network"
  options.  I didn't ask for these to be added.  They aren't
  needed.  My broadcast addresses were all correctly 
  calculated without the "broadcast" option. And the "network"
  option hasn't been used since Linux version 2.1.100 !


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (700, 'testing'), (200, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=en_IE@euro, LC_CTYPE=en_IE@euro

Versions of packages gnome-system-tools depends on:
ii  libart-2.0-2              2.3.16-6       Library of functions for 2D graphi
ii  libatk1.0-0               1.6.1-3        The ATK accessibility toolkit
ii  libbonobo2-0              2.6.2-6        Bonobo CORBA interfaces library
ii  libbonoboui2-0            2.6.1-1        The Bonobo UI library
ii  libc6                     2.3.2.ds1-16   GNU C Library: Shared libraries an
ii  libgconf2-4               2.6.3-2        GNOME configuration database syste
ii  libglade2-0               1:2.4.0-1      Library to load .glade files at ru
ii  libglib2.0-0              2.4.6-1        The GLib library of C routines
ii  libgnome2-0               2.6.1.2-2      The GNOME 2 library - runtime file
ii  libgnomecanvas2-0         2.6.1.1-2      A powerful object-oriented display
ii  libgnomeui-0              2.6.1.1-4      The GNOME 2 libraries (User Interf
ii  libgnomevfs2-0            2.6.2-1        The GNOME virtual file-system libr
ii  libgtk2.0-0               2.4.4-2        The GTK+ graphical user interface 
ii  libice6                   4.3.0.dfsg.1-6 Inter-Client Exchange library
ii  liborbit2                 1:2.10.2-1.1   libraries for ORBit2 - a CORBA ORB
ii  libpango1.0-0             1.4.1-2        Layout and rendering of internatio
ii  libpopt0                  1.7-4          lib for parsing cmdline parameters
ii  libsm6                    4.3.0.dfsg.1-6 X Window System Session Management
ii  libxml2                   2.6.11-3       GNOME XML library
ii  perl                      5.8.4-2        Larry Wall's Practical Extraction 
ii  xlibs                     4.3.0.dfsg.1-6 X Window System client libraries m
ii  zlib1g                    1:1.2.1.1-5    compression library - runtime

-- no debconf information

---------------------------------------
Received: (at 268334-done) by bugs.debian.org; 24 Jun 2005 10:09:02 +0000
>From jdthood@aglu.demon.nl Fri Jun 24 03:09:02 2005
Return-path: <jdthood@aglu.demon.nl>
Received: from mailservice.tudelft.nl [130.161.131.5] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1Dll7N-0004ZT-00; Fri, 24 Jun 2005 03:09:02 -0700
Received: from localhost (localhost [127.0.0.1])
	by rav.antivirus (Postfix) with ESMTP id 4C732800D1;
	Fri, 24 Jun 2005 12:08:30 +0200 (CEST)
Received: from localhost (x095.decis.nl [130.161.177.95])
	by mx4.tudelft.nl (Postfix) with ESMTP id 51731800AA;
	Fri, 24 Jun 2005 12:08:29 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by localhost (Postfix) with ESMTP id 7114E10D5B1;
	Fri, 24 Jun 2005 12:07:27 +0200 (CEST)
Subject: network-admin slightly less crappy now
From: Thomas Hood <jdthood@aglu.demon.nl>
To: 268337@bugs.debian.org, 268334-done@bugs.debian.org
Content-Type: text/plain
Date: Fri, 24 Jun 2005 12:07:26 +0200
Message-Id: <1119607646.8452.168.camel@thanatos>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: by amavisd-new at tudelft.nl
Delivered-To: 268334-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.0 required=4.0 tests=BAYES_01 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 
X-CrossAssassin-Score: 2

network-admin does not do as much damage as it did before, but
unfortunately it still does some damage.

I have a simple laptop system: just the "lo" interface and a Wi-Fi
interface.  I have a number of logical interfaces defined
in /etc/network/interfaces for the different networks that I connect to
and I can configure my Wi-Fi interface as these logical interfaces using
ifup.  I also have several ppp logical interfaces defined but I don't
often use ppp interfaces any more.

# ifconfig |grep '^[^ ]' 
lo        Link encap:Local Loopback
wlanp_0   Link encap:Ethernet  HWaddr 00:07:0E:B3:89:8E

# ifconfig -a |grep '^[^ ]'
lo        Link encap:Local Loopback
wifi0     Link encap:UNSPEC  HWaddr 00-07-0E-B3-89-8E-00-00-00-00-00-00-00-00-00-00
wlanp_0   Link encap:Ethernet  HWaddr 00:07:0E:B3:89:8E

# cat /etc/network/run/ifstate
lo=lo
wlanp_0=decis-wireless-dhcp

# grep ^iface /etc/network/interfaces
iface lo inet loopback
iface decis-wired-static inet dhcp
iface decis-wireless-dhcp inet dhcp
iface ppp-Xircom-Mtl inet ppp
iface ppp-LT-DenHaag inet ppp

gnome-system-tools's network-admin module can't handle this simple case.

First I back up my networking configuration files because I know from
experience what n-a likes to do to them.  Then I start up n-a and enter
the root password.  For ten seconds I look at an entirely greyed-out
window and begin to wonder whether or not it has frozen.  Finally a list
appears in the "Connections" pane:

    Modem connection
    The interface ppp0 is not configured

    Wireless connection
    The interface wifi0 is not configured

It is true that the ppp0 interface is not configured.  It doesn't exist
on my system right now because I am not running a pppd.  I decide not to
investigate network-admin's handling of PPP interfaces right now.

It is more or less true that wifi0 is not configured.  I have a Cisco
Aironet card driven by the airo and airo-cs drivers.  These drivers
create two network interfaces when they load: "wifi0" and "eth0".  I
have configured ifrename to change the latter name to "wlanp_0".  The
latter is configured; the former isn't really a different device.  I
don't really mind the fact that wifi0 appears in the listing, but where
is wlanp_0?

OK, next I try something simple and easy -- I try changing the hostname
from 'thanatos' to 'thanatos1'.  I answer affirmatively the question
whether or not I really want to do this.  The program freezes for a
while and then, unexpectedly, exits.  Has it crashed, or what?  Let's
look at my configuration files.

# diff network/interfaces_PREGST network/interfaces

# diff hostname_PREGST hostname
1c1
< thanatos
---
> thanatos1


OK so far.


# diff -u hosts_PREGST hosts
--- hosts_PREGST        2005-06-19 17:54:43.000000000 +0200
+++ hosts       2005-06-24 10:36:30.000000000 +0200
@@ -1,4 +1,4 @@
-127.0.0.1 localhost.localdomain localhost
+127.0.0.1 localhost.localdomain localhost thanatos thanatos1
127.0.1.1 thanatos

192.168.1.1 lubbers
@@ -26,17 +26,17 @@
# 217.12.6.29  rc1.vip.ukl.yahoo.com

# DECIS
-130.161.177.97 sbs
+130.161.177.97 sbs
130.161.177.119 npi9f5253

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

-fe00::0 ip6-localnet
-ff00::0 ip6-mcastprefix
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
-ff02::3 ip6-allhosts
+fe00::0 ip6-localnet ip6-localnet
+ff00::0 ip6-mcastprefix ip6-mcastprefix
+ff02::1 ip6-allnodes ip6-allnodes
+ff02::2 ip6-allrouters ip6-allrouters
+ff02::3 ip6-allhosts ip6-allhosts

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)
@@ -45,9 +45,3 @@
# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

-::1     ip6-localhost ip6-loopback
-fe00::0 ip6-localnet
-ff00::0 ip6-mcastprefix
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
-ff02::3 ip6-allhosts


#$*%$!  The program has made a mess of my very simple and
straightforward /etc/hosts file!  My existing hostname was on the
127.0.1.1 line; g-s-t has put the new hostname in as an alias for
localhost.localdomain instead.  It has left the old hostname in on the
127.0.1.1 line.  And most bizarrely of all it has _added_ the _old_
hostname in as an alias for localhost.localdomain!

It has replaced some tabs with spaces, unnecessarily.

It has stupidly duplicated host names on a group of lines beginning with
fe00::0.

It has deleted another group of lines for IPv6.

I see that the program has also touched /etc/host.conf.  It didn't occur
to me to back _that_ file up.  Why is network-admin touching that file?
It shouldn't.

I restore my configuration files from backups.

My next test is to see what happens when I change the DNS configuration
via network-admin.  I have resolvconf installed, so /etc/resolv.conf is
a symlink to /etc/resolvconf/run/resolv.conf.  I delete a nameserver
address and add an item to the "search" list and click OK.  The program
pauses and then exits, and I am left again with a mangled hosts file
and, now, an altered /etc/resolvconf/run/resolv.conf file.  Well, I am
relieved that network-admin has not deleted the symlink.  I run
"resolvconf -u" to regenerate resolv.conf.

Once again network-admin has uselessly updated the ctime
on /etc/hosts.conf and also on /etc/hostname.

I restore my configuration files from backups.  So far
my /etc/network/interfaces has remained intact.  Time to take the big
risk.  I don't have the option of modifying the configuration of wlanp_0
so I decide to see what happens if I assign an address to wifi0.

To my relief, network-admin only makes a small change.

# diff interfaces_PREGST interfaces
86a87,91
>
> iface wifi0 inet static
> address 127.0.2.2
> netmask 255.255.0.0
> gateway 127.0.2.1


That, at least, is an improvement.  Because network-admin seems no
longer to mangle /etc/network/interfaces, I am closing #268334.

In conclusion, network-admin is less dangerous than before.  It still
mangles the hosts file.

I would advise that network-admin not touch the hosts file at all when
updating the hostname or when the user makes any changes other than
editing the hosts database via the Hosts tab.  As discussed recently[0]
on debian-boot, there is no good reason why the system hostname (a UNIX
feature predating DNS) should be resolvable as if it were a domain name.
A few programs expect that the hostname can be so resolved, but those
programs are buggy and bug reports have been filed against some of them.
More importantly, Debian does not support the resolving of system
hostname completely and cannot support it completely unless significant
new features are implemented.  Given in addition that network-admin
totally botches its support for managing the resolvability of the system
hostname via /etc/hosts, I think that there is more than enough reason
to drop that support.

[0]http://lists.debian.org/debian-boot/2005/06/msg00758.html

-- 
Thomas Hood <jdthood@aglu.demon.nl>