Bug 234756 - Underquoting of arguments to iwconfig in ifup-wireless
Underquoting of arguments to iwconfig in ifup-wireless
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
Blocks: FC7Target
  Show dependency treegraph
Reported: 2007-04-01 09:35 EDT by Robert Bogomip
Modified: 2014-03-16 23:06 EDT (History)
1 user (show)

See Also:
Fixed In Version: 8.52-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-13 18:42:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robert Bogomip 2007-04-01 09:35:18 EDT
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:

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.
Comment 1 Bill Nottingham 2007-04-13 18:42:10 EDT
Fixed in CVS, will be in 8.52-1.

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