Bug 146291 - GUI adds trailing spaces to "options" lines in /etc/modprobe.conf when adding/deleting wireless devices
Summary: GUI adds trailing spaces to "options" lines in /etc/modprobe.conf when adding...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: system-config-network
Version: 5.1
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
: ---
Assignee: Harald Hoyer
QA Contact:
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks: 87718
TreeView+ depends on / blocked
 
Reported: 2005-01-26 18:57 UTC by Jack Perdue
Modified: 2009-01-20 21:53 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
* the previous version adds trailing spaces to "options" lines in /etc/modprobe.conf when adding or deleting wireless devices. These spaces would be added to lines not being otherwise affected by the addition or deletion of the wireless devices and the presence of these spaces was observed to cause a crash in certain hardware, including nVidia's accelerated kernel module. This updated package no longer adds these spaces to /etc/modprobe.conf.
Clone Of:
Environment:
Last Closed: 2009-01-20 21:53:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0193 0 normal SHIPPED_LIVE system-config-network update 2009-01-20 16:05:59 UTC

Description Jack Perdue 2005-01-26 18:57:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
When adding and removing devices using the GUI, trailing
spaces are appended to all "options" lines in /etc/modprobe.conf.


Version-Release number of selected component (if applicable):
system-config-network-1.3.17-0.FC2.1

How reproducible:
Always

Steps to Reproduce:
1. Add the following line (as an example), to /etc/modprobe.conf:

options nvidia NVreg_Mobile=0

Make sure (verify) that you have no trailing space at the end 
of the line [Note: "options foo bar=0" will accomplish same].


2. Use the system-config-network GUI add a (New) device. I used
wlan0/1/2 using the ndiswrapper for the Broadcom driver and also
just some bogus settings for a non-existent eth4.  
Save/Exit.


3. Use system-config-network GUI to remove (Delete) the device(s).  
Save/Exit.

That should be sufficient.  Repeat 2 and 3 with different
values if it isn't, but in my test each step adds a space.


4. Check (with vi or xxd) /etc/modprobe.conf.  There will be
trailing spaces appended to the line above (and to any other
"options" lines you have).


Actual Results:  Trailing spaces were appended to "options" lines in
/etc/modprobe.conf.

Expected Results:  No such trailing spaces should have been
appended... especially not
to lines not being affected/changed.

Additional info:

This completely breaks NVIDIA's accelerated kernel module if
there are two trailing spaces in that file.  That's a bug on
their end, but still, this tool shouldn't be adding them.  The
end result is a failed X session looking something like:

(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module!
(EE) NVIDIA(0):  *** Aborting ***
(EE) Screen(s) found, but none have a usable configuration.
Fatal server error:
no screens found

and dmesg indicating something like;

nvidia: Unknown parameter `'

Comment 1 Jonathan Berry 2005-01-27 04:00:31 UTC
I see the same thing in FC3 system-config-network-1.3.22-1.  Also, to
recreate this problem, you need only start system-config-network and
click File->Save.  I also seem to have a problem with the last line of
modprobe.conf being replicated on the save.  The last line of
modprobe.conf for me is:
alias char-major-195* nvidia
After saving from system-config-network, this line appears twice at
the end.  The extra spaces seem to be coming from
/usr/share/system-config-network/netconfpkg/NCHardwareList.py lines
100-106:
    def joinoptlist(self, dict):
	optstring = ''
	for key in dict.keys():
            if dict[key] != None:
                optstring = optstring + key + '=' + dict[key] + ' '
            else:
                optstring = optstring + key + ' '
I don't know Python, but this code definitely adds a space to the end
of the optstring variable and the class that this is a part of seems
to have something to do with /etc/modprobe.conf as line 68 has:
            filename = netconfpkg.ROOT + MODULESCONF
and NC_functions.py has:
    MODULESCONF='/etc/modprobe.conf'


Comment 2 Jack Perdue 2005-01-27 16:52:53 UTC
Here's a small little patch to fix the trailing spaces problem:

-- NCHardwareList.py.orig      2005-01-27 09:28:23.000000000 -0600
+++ NCHardwareList.py   2005-01-27 10:37:24.398738352 -0600
@@ -105,7 +105,7 @@
             else:
                 optstring = optstring + key + ' '
                  
-       return optstring
+       return optstring.strip()


As for the duplicated last line... further experimentation
shows that it only duplicates aliases that have a "*" in it.
For example, if I have the following at the end of modprobe.conf:

alias char-major-195* nvidia
alias eth4 3c501
alias foo* bar
# LAST LINE

and then I start up system-config-network and do File->Save 
twice, I get:

alias char-major-195* nvidia
alias eth4 3c501
alias foo* bar
# LAST LINE
alias char-major-195* nvidia
alias foo* bar
alias char-major-195* nvidia
alias foo* bar

I do not presently know how to correct this behavior
(not that it has caused a problem yet so long as you
can tolerate unnecessary garbage at the end).


Comment 3 Walter Neumann 2005-03-09 16:49:27 UTC
For me the extra spaces at the end of options lines broke both nvidia
loading and alsa sound card loading. The spaces were added to the
following lines.

options snd-intel8x0 index=0 id="ICH"
options snd cards_limit=2

This would seem to be a but in module loading.


Comment 4 Matthew Miller 2005-04-26 16:24:45 UTC
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.

Comment 5 Jack Perdue 2005-04-26 17:27:53 UTC
Still present in FC3/system-config-network-1.3.22-1

Comment 6 Luis 2005-11-11 11:22:58 UTC
The same proble with FC4/system-config-network-1.3.26-1

My modprobe.conf is the following

########################################################
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 &&
/usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; };
/sbin/modprobe -r --ignore-remove snd-intel8x0
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd
#options ipw2100 ifname=eth1
options i8k force=1
alias eth0 e100
###############################################

And I only detect this behaviour in the line 
options i8k force=1
This also breaks the load of the module with an unknown symbol error message

Comment 7 Jack Perdue 2007-03-10 02:21:00 UTC
Still happens on FC5 with system-config-network-1.3.30-2.1

Is there a problem with my:

-       return optstring
+       return optstring.strip()

patch above for the trailing space problem?

Comment 8 Bug Zapper 2008-04-03 15:50:30 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 9 Jack Perdue 2008-04-03 19:55:28 UTC
Both problems still exists with system-config-network-1.3.99-2.el5 on RHEL 5.1,
which, AFAIK, is not EOL.

Comment 11 RHEL Program Management 2008-06-02 20:42:54 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 22 Ruediger Landmann 2009-01-08 06:29:34 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
* the previous version adds trailing spaces to "options" lines in
/etc/modprobe.conf when adding or deleting wireless devices. These spaces would be added to lines not being otherwise affected by the addition or deletion of the wireless devices and the presence of these spaces was observed to cause a crash in certain hardware, including nVidia's accelerated kernel module. This updated package no longer adds these spaces to /etc/modprobe.conf.

Comment 23 errata-xmlrpc 2009-01-20 21:53:48 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-2009-0193.html


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