Bug 174336

Summary: /sbin/ifup uses uninitialized variables
Product: [Fedora] Fedora Reporter: Christer Weinigel <christer>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: codykoeninger, denis, mitr, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.32-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-04-10 22:57:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150221    
Attachments:
Description Flags
"unset WINDOW" at start of {ifup,ifdown} none

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.