Bug 140997 - network configuration can truncate /etc/hosts to 0 bytes
network configuration can truncate /etc/hosts to 0 bytes
Product: Fedora
Classification: Fedora
Component: system-config-network (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Depends On:
Blocks: 87718
  Show dependency treegraph
Reported: 2004-11-27 12:15 EST by Andre Robatino
Modified: 2008-01-11 17:20 EST (History)
0 users

See Also:
Fixed In Version: 1.4.7-1.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-11 17:20:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andre Robatino 2004-11-27 12:15:57 EST
Description of problem:
Setting up networking after a clean install of FC3 can cause a
previously normal copy of /etc/hosts to be truncated to 0 bytes.

Version-Release number of selected component (if applicable):

How reproducible:
always (but I don't know the exact steps necessary)

Steps to Reproduce:
1.  Do a clean install of FC3 using default hostname
localhost.localdomain.  Verify that /etc/hosts is the following:

# Do not remove the following line, or various programs
# that require network functionality will fail.       localhost.localdomain   localhost

2.  Configure a dial-up modem and corresponding network connection.
Actual results:
  /etc/hosts truncated to 0 bytes.  This leads to the error message
when logging in

Could not look up internet address for localhost.localdomain.  This
will prevent GNOME from operating correctly.  It may be possible to
correct the problem by adding localhost.localdomain to the file

(or something to this effect).

Expected results:
  /etc/hosts should be unchanged.

Additional info:
  This bug report is secondhand.  My father did a clean install of FC3
on two basically identical machines, one with an internal and one with
an external modem.  After configuring networking the above problem was
observed on the first machine (and fixed by editing /etc/hosts). 
Immediately after installing on the 2nd machine, we verified that
/etc/hosts was correct.  But after configuring networking, the problem
occurred again.  It seemed likely that configuring networking was the
cause.  I observed that on my own machine, the modification time on
/etc/hosts is exactly the same as that of the files ifcfg-* in
/etc/sysconfig/network-scripts created during network configuration,
indicating that system-config-network does in fact manipulate this
file (though in my case, /etc/hosts remained normal).  Unfortunately,
I don't know exactly the steps he took resulting in the problem, but
whatever they were, it's reproducible.
Comment 1 Harald Hoyer 2004-11-29 06:14:05 EST
do you have selinux turned on or off?
Comment 2 Andre Robatino 2004-11-29 13:30:53 EST
  All machines mentioned have the default selinux configuration (on).
 Also forgot to mention that on my machine (which didn't experience
the problem) I configured xDSL, while on both of my father's (which
did) he configured dialup.  Also, my machine is ethernet capable and
his aren't.  On all of these machines, the default
localhost.localdomain is used, so the original /etc/hosts was exactly
the 3 lines above.
Comment 3 Harald Hoyer 2004-11-30 05:08:39 EST
ok, this is it... Thx for spotting this bug, and sorry it bit you!
Comment 4 Andre Robatino 2005-07-08 13:03:58 EDT
  This bug is now occurring in a clean install of FC4.  I verified that the
modification time on the empty /etc/hosts file is exactly the same as the
/etc/sysconfig/network-scripts/ifcfg-* file created when my father's dialup
configuration is set up, and the error did not occur before the dialup config
was done.  Please upgrade this bug to FC4.
Comment 5 Christian Iseli 2007-01-22 05:07:29 EST
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Comment 6 Andre Robatino 2007-01-22 05:21:12 EST
  I'm updating to FC5 since I'm not absolutely sure it happened in FC6, but am
quite sure it happened in FC5.
Comment 7 Andre Robatino 2007-06-09 21:36:19 EDT
  Just helped my father do a clean install of F7, and verified that configuring
a modem connection still truncates /etc/hosts to 0 bytes (fortunately, we made a
copy in advance).  Updating to F7.
Comment 8 Andre Robatino 2007-06-09 21:50:02 EDT
  Also, as reported earlier, configuring an xDSL connection doesn't seem to
truncate /etc/hosts, though configuring a modem connection does.  The behavior
hasn't changed.
Comment 9 Andre Robatino 2007-06-10 17:40:00 EDT
  My father installed on a second machine, and this time it did not truncate
/etc/hosts.  On the first machine, where /etc/hosts was truncated, he had an
internal modem on ttyS1, which was automatically detected by s-c-network.  On
the second machine, where it was not truncated, he had an external modem on
ttyS0, which was not automatically detected (even though it was connected and
turned on), so he manually changed "/dev/modem" to "/dev/ttyS0", after which it
worked properly.  Other than that, the procedure on both machines was exactly
the same.
Comment 10 Fedora Update System 2007-12-06 15:44:45 EST
system-config-network-1.4.7-1.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update system-config-network'
Comment 11 Andre Robatino 2007-12-06 15:50:14 EST
  My father yesterday did a clean install of F8, and configuring the modem
didn't wipe /etc/hosts as happened with earlier Fedora versions (this only
pertains to the original system-config-network-1.4.3-1.fc8, of course).
Comment 12 Fedora Update System 2008-01-11 17:20:22 EST
system-config-network-1.4.7-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.