Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#18632 - [netcfg] Double quoted ESSID

Attached to Project: Arch Linux
Opened by Allive (allive) - Wednesday, 10 March 2010, 22:21 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Monday, 06 June 2011, 05:54 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
After last netcfg update, when i tries to connect to a wi-fi network using netcfg:
netcfg profile_name
In iwconfig output, i see this:
wlan0 IEEE 802.11g ESSID:""profile_name""

In wlan profile i use such lines:
ESSID=profile_name
SECURITY="none-old"
and some more...

Additional info:
* package version(s)

netcfg v2.5.4

It is treated by modifying this line in /usr/lib/network/connections/wireless

23: WEB_OPTS="essid "$ESSID""
without backslashed quotes

This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Monday, 06 June 2011, 05:54 GMT
Reason for closing:  Won't fix
Additional comments about closing:  SECURITY=none-old or wep-old are deprecated, none/wep should be used instead.
Comment by Thomas Bächler (brain0) - Monday, 10 May 2010, 21:29 GMT
Stupid bash quoting rules. The code won't quote the essid properly, but rather pass the quotes with the argument. This needs a small rewrite I guess.
Comment by Lukas Fleischer (lfleischer) - Wednesday, 19 May 2010, 18:56 GMT
There are several different ways to fix this. The quick 'n' dirty way would be to use the eval builtin to enforce quote removal (see attachment 1, "netcfg-WEP_OPTS-eval.patch") which would, however, cause the undesirable side effect that variables get expanded/interpolated twice so that using a key like "s:\$WEP_OPTS" will result in garbage being passed to iwconfig(8).

The preferred solution would be to use an array for "$WEP_OPTS", set options like 'WEP_OPTS=(essid "$ESSID" key "$KEY")' and invoke iwconfig(8) via 'iwconfig "$INTERFACE" "${WEP_OPTS[@]}"' (see attachment 2, "netcfg-WEP_OPTS-array.patch"). This ensures that arguments are always passed correctly and prevents double quotes without any side effects. Please note that this will break backwards compatibility since "$WEP_OPTS" will be parsed incorrectly (as a single argument, even if it contains unquoted whitespaces) if it has been initialized as a string before.

If you use any of these approaches, please also check for other parts of netcfg that might need to be fixed accordingly (e.g. "$WPA_OPTS", "$IFOPTS").
Comment by James Rayner (iphitus) - Sunday, 21 November 2010, 01:23 GMT
Does your connection work with the plain 'wep' or 'none' SECURITY settings?

The -old code is something I intended to deprecate one day, I only retained it in case there were some crappy legacy drivers that don't work with wpa_supplicant, these should be few and far between now.

Given that it is "legacy" code I'm not keen on making changes that break backwards compatibility - that's the only reason why it is still included.

This used to work, so I suspect some change in the quoting cleanups by profjim might have caused this regression.

Loading...