| Summary: | sys-apps/openrc-0.3.0-r1 /lib/rc/net/wpa_supplicant.sh doesn't parse ctrl_interface-option correctly | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Mads <mads> |
| Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jer, pesa, roy |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
Mads
2008-11-11 01:21:54 UTC
The correct steps of reproduction: Steps to Reproduce: 1. Include the line: ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel in wpa_supplicant.conf 2. Start a net.wlan-service dependent on wpa_supplicant 3. Never get a connection Something like this should work: sed -n -e 's/[[:space:]]*#.*//g;s/[[:space:]]*$//g;s/^ctrl_interface=DIR=\(.*\)[[:space:]]\+GROUP=.*/\1/p' (In reply to comment #2) > Something like this should work: > > sed -n -e > 's/[[:space:]]*#.*//g;s/[[:space:]]*$//g;s/^ctrl_interface=DIR=\(.*\)[[:space:]]\+GROUP=.*/\1/p' > Heh, this is not backwards compatible though :( The following solution is much better and it's compatible with <net-wireless/wpa_supplicant-0.6. It is supposed to replace the whole current expression, not just the last piece.
sed -n -e '/^ctrl_interface=/{
s/^ctrl_interface=\([^[:space:]]*\).*/\1/
s/^DIR=//
p
}'
Note: the newline before the last parenthesis is mandatory for BSD sed. On GNU platforms you could just write the entire expression on one line, separating commands with semicolons.
I'm struggling to get this to work with NetBSD sed right now. This is klunky, but works
sed -e '/^ctrl_interface=/!d' \
-e 's/^ctrl_interface=//' \
-e 's/^ *//' \
-e 's/^DIR=//' \
-e 's/^ *//' \
-e 's/GROUP=.*//' \
/etc/wpa_supplicant.conf
Comments?
I guess this was fixed in OpenRC 0.4.1 http://roy.marples.name/projects/openrc/changeset/1452 Looks like you're right. I haven't gotten around to marking each ticket with the version fixed. Thanks for doing that here. |