Bug 146291 - GUI adds trailing spaces to "options" lines in /etc/modprobe.conf when adding/deleting wireless devices
GUI adds trailing spaces to "options" lines in /etc/modprobe.conf when adding...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: system-config-network (Show other bugs)
5.1
All Linux
high Severity medium
: ---
: ---
Assigned To: Harald Hoyer
bzcl34nup
:
Depends On:
Blocks: 87718
  Show dependency treegraph
 
Reported: 2005-01-26 13:57 EST by Jack Perdue
Modified: 2009-01-20 16:53 EST (History)
6 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 16:53:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jack Perdue 2005-01-26 13:57:45 EST
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-26 23:00:31 EST
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 11:52:53 EST
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 11:49:27 EST
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 12:24:45 EDT
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 13:27:53 EDT
Still present in FC3/system-config-network-1.3.22-1
Comment 6 Luis 2005-11-11 06:22:58 EST
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-09 21:21:00 EST
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 11:50:30 EDT
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 15:55:28 EDT
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 Product and Program Management 2008-06-02 16:42:54 EDT
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 01:29:34 EST
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 16:53:48 EST
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.