Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 174336 - /sbin/ifup uses uninitialized variables
Summary: /sbin/ifup uses uninitialized variables
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
: 185781 (view as bug list)
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
 
Reported: 2005-11-28 09:23 UTC by Christer Weinigel
Modified: 2014-03-17 02:57 UTC (History)
4 users (show)

Fixed In Version: 8.32-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-10 22:57:27 UTC


Attachments (Terms of Use)
"unset WINDOW" at start of {ifup,ifdown} (deleted)
2006-03-05 23:21 UTC, Miloslav Trmač
no flags Details | Diff

Description Christer Weinigel 2005-11-28 09:23:24 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc3 Firefox/1.0.6

Description of problem:
/sbin/ifup uses the environment variable "WINDOW" to set the window size of the default route, this variable is never initialized.

screen sets the variable "WINDOW" to the number of the current window within screen.

So if you ever do "ifup eth0" from within screen the window size of the default route gets set to a ridiculously small number.

I guess a lot of other variables are also used without being initialized, so depending on the user's environment variables a lot of strange things can happen.

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

How reproducible:
Always

Steps to Reproduce:
1. screen
2. env | grep $WINDOW
3. ifup eth0
   (or whatever the interface with the default route is)
4. route -ne

  

Actual Results:  Look at the window size of the default route, it will be the same as the value of WINDOW set by screen.


Expected Results:  If /etc/sysconfig/network-scripts/ifcfg-eth0 does not contain a WINDOW= line the window size should not be set.

Additional info:

Workaround: add a line to /etc/sysconfig/network-scripts/ifcfg-eth0 with

WINDOW=

The correct solution is to unset all variables that are used laterin the script but may not be set in the ifcfg-* files.  I.e. add the following at the beginning of /sbin/ifup:

unset WINDOW GATEWAY GATEWAYDEV ...

Comment 1 Miloslav Trmač 2006-03-05 23:21:18 UTC
Created attachment 125687 [details]
"unset WINDOW" at start of {ifup,ifdown}

I think unsetting only WINDOW is the best choice right now; unsetting every
variable ever defined in an ifcfg-* file would require a long list that would
inevitably get out of date.

The alternative is to solve it the same way as #97604, creating a whitelist of
environment variables that may be passed to the scripts from the outside.

Comment 2 Miloslav Trmač 2006-03-18 14:55:02 UTC
*** Bug 185781 has been marked as a duplicate of this bug. ***

Comment 3 Miloslav Trmač 2006-04-10 22:57:27 UTC
Fixed in rawhide initscripts-8.32-1.  Thanks for your report.


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