FS#7730 - netcfg / network-profiles problem

Attached to Project: Arch Linux
Opened by dwr budr (dwrbudr) - Thursday, 02 August 2007, 22:37 GMT
Last edited by James Rayner (iphitus) - Saturday, 18 August 2007, 10:41 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To James Rayner (iphitus)
Architecture i686
Severity Medium
Priority Normal
Reported Version 2007.05 Duke
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Take this `/etc/network-profiles/test` file, noting the "a space" ESSID, deviating from the normal single word ESSI:

DESCRIPTION="test"

INTERFACE=eth1
HOSTNAME=myhost
ESSID="a space"
KEY=pass
IWOPTS="mode managed essid $ESSID channel 6 key restricted $KEY"


# netcfg test
:: Starting network profile: test [BUSY]
iwconfig: unknown command "space"
[FAIL]

As you can see, the quotation marks in the ESSID are not preserved, meaning netcfg calls `iwconfig mode managed essid a space channel 6 key restricted pass` instead of `iwconfig mode managed essid "a space" channel 6 key restricted pass`. Therefore, iwconfig assumes the word "space" is a command line argument instead of the rest of the ESSID.

Making sure the netcfg script preserves the quotation marks in the ESSID variable (the onw in the network-profiles file) would fix this.

Additional info:
* package version(s)

local/initscripts 2007.08-1
local/wireless_tools 29pre21-1

* config and/or log files etc.

See description.

Steps to reproduce:

See description.
This task depends upon

Closed by  James Rayner (iphitus)
Saturday, 18 August 2007, 10:41 GMT
Reason for closing:  Fixed
Comment by Christ Schlacta (aarcane) - Saturday, 04 August 2007, 18:25 GMT
that's a limitation of the shell bash. try placing single-quotes around it inside the double quotes like ESSID="'a space'" or try escaping it properly ESSID="a\ space". if neither of those work, I'm out of ideas, but the good folks at #bash would know the answer.
Comment by dwr budr (dwrbudr) - Wednesday, 15 August 2007, 14:35 GMT
I asked at #bash and it seems there's no easy way around this without implementing an array structure. Please see: http://wooledge.org/mywiki/BashFAQ#faq50
Comment by James Rayner (iphitus) - Thursday, 16 August 2007, 02:23 GMT
spaces work fine in a later version of the developmental network scripts.
Comment by James Rayner (iphitus) - Saturday, 18 August 2007, 10:41 GMT
I was able to use eval and quote the essid. Works fine in my testing here. The "security issue" linked off that bash faq is not an issue here.

See netcfg2. http://bbs.archlinux.org/viewtopic.php?id=36384

Closing this, as the current scripts will be replaced by netcfg2.

Loading...