Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246365 - sys-apps/openrc-0.3.0-r1 /lib/rc/net/wpa_supplicant.sh doesn't parse ctrl_interface-option correctly
Summary: sys-apps/openrc-0.3.0-r1 /lib/rc/net/wpa_supplicant.sh doesn't parse ctrl_int...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-11 01:21 UTC by Mads
Modified: 2008-12-29 14:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mads 2008-11-11 01:21:54 UTC
sys-apps/openrc-0.3.0-r1 with net-wireless/wpa_supplicant-0.6.4

This version of wpa_supplicant introduces a new way to configure the options ctrl_interface and ctrl_interface_group in wpa_supplicant.conf. /lib/rc/net/wpa_supplicant.sh does not parse this correctly, resulting in non-working wireless.

Old way of configuring ctrl_interface in wpa_supplicant.conf:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

New way of configuring ctrl_interface:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

The error is in line 108 in /lib/rc/net/wpa_supplicant.sh, but I don't know what sed-magic is required to parse this correctly.



Reproducible: Always

Steps to Reproduce:
1. include the line ctrl_interface=DIR=/var/run/wpa_supplicant in wpa_supplicant.conf
2. start a net.wlan-service dependent on wpa_supplicant
3. never get connection

Actual Results:  
No wlan-connection

Expected Results:  
A working wpa_supplicant-initiated wlan connection.
Comment 1 Mads 2008-11-11 01:24:37 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
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2008-11-18 18:45:16 UTC
Something like this should work:

sed -n -e 's/[[:space:]]*#.*//g;s/[[:space:]]*$//g;s/^ctrl_interface=DIR=\(.*\)[[:space:]]\+GROUP=.*/\1/p'
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2008-11-20 18:20:50 UTC
(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 :(
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2008-11-20 21:58:43 UTC
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.
Comment 5 Roy Marples 2008-12-17 10:27:35 UTC
I'm struggling to get this to work with NetBSD sed right now.
Comment 6 Roy Marples 2008-12-17 10:40:14 UTC
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?
Comment 7 Davide Pesavento (RETIRED) gentoo-dev 2008-12-26 21:30:34 UTC
I guess this was fixed in OpenRC 0.4.1

http://roy.marples.name/projects/openrc/changeset/1452
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2008-12-29 14:40:09 UTC
Looks like you're right. I haven't gotten around to marking each ticket with the version fixed. Thanks for doing that here.