Bug 174336 - /sbin/ifup uses uninitialized variables
/sbin/ifup uses uninitialized variables
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
: 185781 (view as bug list)
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2005-11-28 04:23 EST by Christer Weinigel
Modified: 2014-03-16 22:57 EDT (History)
4 users (show)

See Also:
Fixed In Version: 8.32-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-10 18:57:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
"unset WINDOW" at start of {ifup,ifdown} (1.11 KB, patch)
2006-03-05 18:21 EST, Miloslav Trmač
no flags Details | Diff

  None (edit)
Description Christer Weinigel 2005-11-28 04:23:24 EST
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 18:21:18 EST
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 09:55:02 EST
*** Bug 185781 has been marked as a duplicate of this bug. ***
Comment 3 Miloslav Trmač 2006-04-10 18:57:27 EDT
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.