Bug 200035 - import from system-config-network-cmd will mangle DEVICE and break the ifcfg interface
Summary: import from system-config-network-cmd will mangle DEVICE and break the ifcfg ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rhpl
Version: 4.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Harald Hoyer
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-24 22:32 UTC by Panagiotes M. Petrakis
Modified: 2010-11-24 12:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Due to an error in a parser, having a comment at the same line as the configuration option may have caused this option to be parsed incorrectly. With this update, this error no longer occurs, and lines containing comments are now parsed as expected.
Clone Of:
Environment:
Last Closed: 2010-11-24 12:43:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0910 0 normal SHIPPED_LIVE rhpl bugfix update 2010-11-24 12:42:59 UTC

Description Panagiotes M. Petrakis 2006-07-24 22:32:16 UTC
Description of problem:
If there is a comment after the DEVICE field.
Peforming a network backup then restore changes the field by adding
single quotes aroud the DEVICE name. Which will then break the 
ifcfg interface. 

Version-Release number of selected component (if applicable):
# rpm -qf `which system-config-network-cmd`
system-config-network-tui-1.3.22.0.EL.4.2-1

How reproducible: ALWAYS


Steps to Reproduce:
1. Edit ifcfg-bond0
2. Add a comment at the end of the DEVICE line like this. 

DEVICE=bond0    # My primary failover team
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Unknown


3. Export the network config
system-config-network-cmd -e > backup.cfg

4. Import network config.
system-config-network-cmd -c -i < backup.cfg

5. Examine ifcfg-bond0. note the comments that were once there are now
gone and that the interface name is surrounded by single quotes.

# cat ifcfg-bond0
DEVICE='bond0   '
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Unknown


Actual results:
# ifup bond0
ip_tables: (C) 2000-2002 Netfilter core team
/sbin/ifup: line 261: [: /etc/dhclient-bond0: binary operator expected
/sbin/ifup: line 291: [: /etc/dhclient-bond0: binary operator expected

Determining IP information for bond0    ...
 failed; no link present.  Check cable?


Expected results:
a) The comments would remain.
b) The DEVICE name would be as it was. 

Additional info:
Editor used in perform this task was vim on a freshly installed
system, RHEL4 beta2. No additional editor settings were in use.

The amount of white from the end of the bareword 'bond0' to the
closing single quote was one full tab. This bug occurs with tabs
and expanded spaces. This happens only on the DEVICE line, for example.

DEVICE=bond0
ONBOOT=yes # we're booting here
BOOTPROTO=dhcp
TYPE=Unknown


!! Perform the steps above.

# cat ifcfg-bond0
DEVICE=bond0
ONBOOT=yes # we're booting here
BOOTPROTO=dhcp
TYPE=Ethernet


So the elimination of the comments is inconsistant as to how the other configs
are handled.

Comment 2 RHEL Program Management 2008-10-31 16:43:28 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 8 Jaromir Hradilek 2010-11-09 11:20:34 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Due to an error in a parser, having a comment at the same line as the configuration option may have caused this option to be parsed incorrectly. With this update, this error no longer occurs, and lines containing comments are now parsed as expected.

Comment 9 Alexander Todorov 2010-11-12 10:38:58 UTC
qa_ack+

# rpm -q rhpl
rhpl-0.148.6-1

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0  # our main device
BOOTPROTO=dhcp
HWADDR=00:E0:81:45:C0:6A
ONBOOT=yes
TYPE=Ethernet

# system-config-network-cmd -e > backup.cfg 
# system-config-network-cmd -i < backup.cfg 

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE='eth0  '
BOOTPROTO=dhcp
HWADDR=00:E0:81:45:C0:6A
ONBOOT=yes
TYPE=Ethernet


See the spaces between quotes.

Comment 10 Alexander Todorov 2010-11-12 10:42:25 UTC
# rpm -q rhpl
rhpl-0.148.6-2

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0  # primary device
BOOTPROTO=dhcp
HWADDR=00:E0:81:45:C0:6A
ONBOOT=yes
TYPE=Ethernet

# system-config-network-cmd -e > backup.cfg 
# system-config-network-cmd -i < backup.cfg 

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:E0:81:45:C0:6A
ONBOOT=yes
TYPE=Ethernet

Config file looks OK.

# service network restart
Shutting down interface eth0:  [  OK  ]
Shutting down loopback interface:  [  OK  ]
Setting network parameters:  [  OK  ]
Bringing up loopback interface:  [  OK  ]
Bringing up interface eth0:  [  OK  ]


No errors while restarting service. Moving to VERIFIED.

Comment 12 errata-xmlrpc 2010-11-24 12:43:04 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0910.html


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