Tim Tassonis wrote:
Hi all

When fiddling around trying to replace networkmanager with wpa_gui from
wpa_supplicant, I came across a problem in /lib/services/wpa from
blfs-bootscripts-20160415.

As wpa_gui does not use dbus/polkit for access rights, but plain unix
group write permissions on the socket, I put in my
/etc/sysconfig/wpa_supplicant-wifi0.conf the following line:

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

When starting wpa_supplicant and dhcpcd manually, I could then use wpa_gui
as normal user with wheel group membership to manage my access points and
all was well.

But when I set it all up proper in lfs, it wouldn't work anymore. The
reason is that the blfs service file explicitely sets the ctrl_interface
on the commandline, overriding the setting in the config file. Sadly, the
man page of wpasupplicant describes no method to provide the group
information on the command line.

The following diff fixes the wpa service script, allowing wpa_gui (and
wpa_cli) to be used as a regular user.


--- blfs-bootscripts-20160415/blfs/services/wpa    2016-01-08
22:55:44.000000000 +0100
+++ /lib/services/wpa    2016-08-04 20:28:01.851863891 +0200
@@ -40,7 +40,7 @@
        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


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



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.

  -- Bruce


--
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