Bug 234756

Summary: Underquoting of arguments to iwconfig in ifup-wireless
Product: [Fedora] Fedora Reporter: Robert Bogomip <bob.bogo>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.52-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-13 22:42:10 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: 150225    

Description Robert Bogomip 2007-04-01 13:35:18 UTC
Description of problem:
When file /etc/sysconfig/network-scripts/1 exists, ifup-wireless fails to pass
correct arguments to iwconfig.

Version-Release number of selected component (if applicable):
Discovered on FC6, x86_64 but appears to be present on a FC5 release too.

How reproducible:
Always

Steps to Reproduce:
1. # touch /etc/sysconfig/network-scripts/{1,2,3,4}
2. # ifup ra0
3. # iwconfig ra0
  
Actual results:
The encryption key is set to $DEFAULTKEY (as sepecified in ifcfg-ra0)

Expected results:
The encryption key should be set to the `$DEFAULTKEY'th key from ifcfg-ra0
(i.e., assuming $DEFAULTKEY is 2, the 2nd key (which would be $KEY2)).


Additional info:
This is caused by ifup-wireless having lines like:

  [ -n "$DEFAULTKEY" ] && iwconfig $DEVICE key [${DEFAULTKEY}]

When a file called 1 is present, bash's filename expansion will strip the square
brackets from [1]. Files with shell metacharacters in them should be quoted:

  [ -n "$DEFAULTKEY" ] && iwconfig $DEVICE key "[${DEFAULTKEY}]"

There are many places where these double quotes need to be added.
Hmmmm.

Comment 1 Bill Nottingham 2007-04-13 22:42:10 UTC
Fixed in CVS, will be in 8.52-1.