On 08/07/16 21:20, Bruce Dubbs wrote:
Tim Tassonis wrote:
Hi all



Tim, I know it's been a while, but can you test this patch to the
current script in the book:

--- blfs/services/wpa   (revision 17605)
+++ blfs/services/wpa   (working copy)
@@ -35,12 +35,17 @@
         exit 1
       fi

+      # Only specify -C on command line if it is not in CFGFILE
+      if ! grep -q ctrl_interface; then
+         WPA_ARGS="-C/run/wpa_supplicant $WPA_ARGS"
+      fi
+
       log_info_msg "\n Starting wpa_supplicant on the $1 interface..."

       mkdir -p /run/wpa_supplicant

       /sbin/wpa_supplicant -q -B -Dnl80211,wext -P${PIDFILE} \
-          -C/run/wpa_supplicant -c${CFGFILE} -i$1 ${WPA_ARGS}
+          -c${CFGFILE} -i$1 ${WPA_ARGS}

       if [ "$?" != "0" ]; then
         log_failure_msg2


There is a little bug in your patch. Your

+      if ! grep -q ctrl_interface; then

misses the config file to grep, resulting in an endless wait on stdin. After I changed it to

+      if ! grep -q ctrl_interface ${CFGFILE}; then


, it worked perfectly.




It might also be an idea to mention this on the wpasupplicant page, that
in order to manage access points,

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1

can be used in the config.

I can add that to the configuration info, but would like to get
verification that the above patch is OK first.

For us the first line should be

ctrl_interface=DIR=/run/wpa_supplicant GROUP=<priv group>

We don't use the wheel group anywhere else in BLFS, so I'm not sure what
should be used.  Is it in /run which is always new upon boot, or is the
/etc/sysconfig/wpa_supplicant-wifi0.conf file?  If the .conf file, then
the permissions for that would have to be adjusted.


Yes, "wheel" bit is just my personal choice of admin group. lfs also has "adm", maybe that would be a good choice? Or "dialout"?

The line

ctrl_interface=DIR=/run/wpa_supplicant GROUP=<priv group>

is in /etc/sysconfig/wpa_supplicant-wifi0.conf and is only writable by root. The line causes wpa_supplicant to create the socket file

/run/wpa_supplicant/wlan0

with group write permissions for <priv group>

wpa_gui and wpa_cli then use the socket file to talk to wpa_applicant through it, which then adds/changes/removes the accesspoint data in the config file accordingly.

The config file must not to be writable by anybody else than root.

Bye
Tim

--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to