if you have a wep key like this HtCkO$m?Aq2]& then the init script will fail to set the key because it tries to expand the $ sign for example. various other strings are passed to the shell, too. Reproducible: Always Steps to Reproduce: 1.set a wep key like HtCkO$m?Aq2]& in /etc/conf.d/wireless 2.start /etc/init.d/net.yourwlaninterface 3. Actual Results: * Caching service dependencies ... [ ok ] * Starting ath0 * Configuring wireless network for ath0 /lib/rcscripts/net.modules.d/iwconfig: eval: line 344: syntax error near unexpected token `)' /lib/rcscripts/net.modules.d/iwconfig: eval: line 344: `iwconfig ath0 key HtCkO$m?Aq2]& 2>&1' Expected Results: quote the wep key before passing it to iwconfig with baselayout version baselayout-1.11.10-r4 you can fix this bug by changing the line 344 in /lib/rcscripts/net.modules.d/iwconfig from : e=$( eval "iwconfig ${iface} key ${key} 2>&1" ) to e=$( eval "iwconfig ${iface} key '${key}' 2>&1" )
Try this key_ESSID="'s:HtCkO$m?Aq2]&'"
this solution might work, but i didn't test it, since i think it should be the job of the module to escape or handle the key in an appropriate way. if i can manage to get write access to this file i can insert any command that i want to and it gets executed with root permissions as soon as the init script is restarted. so i really think you should add the quotes in the module.
key_ESSID="'s:HtCkO$ ?Aq2]&' enc open" Is valid and there's a space in the key. AFAIK that is the only way of handling this
"HtCkO$m?Aq2]&" this is the original key. there is no space in it. if it is, its not meant to be there. the problem is this line in the iwconfig module : e=$( eval "iwconfig ${iface} key ${key} 2>&1" ) it just uses the ${key} variable without quoting it. and thats the whole problem causing it. just fix that line and everybody is able to use key_ESSID="s:HtCkO$m?Aq2]&" in wireless.conf. and remeber to use single quotes if you will fix it, otherwise the same will happen again. and there is absolutely no need in using variables in the wep key itself, so its save to just quote the string in the module.
After a quick test, the string does need to be escaped in the configuartion as we need to acccess it via an eval statement. bash will evaluate the $m part of the key as variable m - unless you can demonstrate a way to get the variable without eval expanding it. eval key=\"\$\{key_${essid}\}\"
Futher comment - you need to specify the key in single quotes anyway otherwise bash will expand the $m by default.
all i did to make it work is change this line : e=$( eval "iwconfig ${iface} key ${key} 2>&1" ) into that : e=$( eval "iwconfig ${iface} key '${key}' 2>&1" ) thats how it will work, and is the most secure way to pass the key to iwconfig.
You code fails to work with key_Uber_NET="[2] s:uberlordrules key [2] enc open" You may want to see bug #74053 as that details with the space problem