From patchwork Mon Jan 28 10:34:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouke Witteveen X-Patchwork-Id: 216156 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 85CAE2C008C for ; Mon, 28 Jan 2013 21:33:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 801919C193; Mon, 28 Jan 2013 05:33:49 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NJRCEGHNDdzY; Mon, 28 Jan 2013 05:33:49 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id AC4429C170; Mon, 28 Jan 2013 05:33:44 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 50CED9C170 for ; Mon, 28 Jan 2013 05:33:43 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fhlm+Ez5v2Kc for ; Mon, 28 Jan 2013 05:33:37 -0500 (EST) Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com [209.85.215.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id A67979C16F for ; Mon, 28 Jan 2013 05:33:37 -0500 (EST) Received: by mail-ea0-f175.google.com with SMTP id d1so1064994eab.20 for ; Mon, 28 Jan 2013 02:33:35 -0800 (PST) X-Received: by 10.14.2.196 with SMTP id 44mr50042738eef.25.1359369213996; Mon, 28 Jan 2013 02:33:33 -0800 (PST) Received: from Mindship-03.lan (ip82-139-86-183.lijbrandt.net. [82.139.86.183]) by mx.google.com with ESMTPS id f6sm15375270eeo.7.2013.01.28.02.33.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jan 2013 02:33:33 -0800 (PST) Date: Mon, 28 Jan 2013 11:34:33 +0100 From: Jouke Witteveen To: hostap@lists.shmoo.com Subject: [PATCH] Migrate from /var/run to /run Message-ID: <20130128103433.GA1247@Mindship-03.lan> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Follow an FHS proposal[1] that is already implemented on some major distributions. [1] https://bugs.linuxfoundation.org/show_bug.cgi?id=718 Signed-off-by: Jouke Witteveen --- wpa_supplicant/ChangeLog | 1 + wpa_supplicant/README | 32 +++++++++++----------- wpa_supplicant/README-P2P | 2 +- wpa_supplicant/README-WPS | 2 +- wpa_supplicant/config.h | 8 +++--- wpa_supplicant/doc/docbook/wpa_priv.sgml | 12 ++++---- .../doc/docbook/wpa_supplicant.conf.sgml | 12 ++++---- wpa_supplicant/examples/ieee8021x.conf | 2 +- wpa_supplicant/examples/plaintext.conf | 2 +- wpa_supplicant/examples/wep.conf | 2 +- wpa_supplicant/examples/wpa-psk-tkip.conf | 2 +- wpa_supplicant/examples/wpa2-eap-ccmp.conf | 2 +- wpa_supplicant/examples/wps-nfc.py | 2 +- wpa_supplicant/wpa_cli.c | 2 +- wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 2 +- wpa_supplicant/wpa_priv.c | 2 +- wpa_supplicant/wpa_supplicant.conf | 10 +++---- 17 files changed, 49 insertions(+), 48 deletions(-) diff --git a/wpa_supplicant/ChangeLog b/wpa_supplicant/ChangeLog index 3f10e11..73e9a7f 100644 --- a/wpa_supplicant/ChangeLog +++ b/wpa_supplicant/ChangeLog @@ -3,6 +3,7 @@ ChangeLog for wpa_supplicant ????-??-?? - v2.1 * added support for simulataneous authentication of equals (SAE) for stronger password-based authentication with WPA2-Personal + * migrate from /var/run to /run 2013-01-12 - v2.0 * removed Qt3-based wpa_gui (obsoleted by wpa_qui-qt4) diff --git a/wpa_supplicant/README b/wpa_supplicant/README index d84e61e..f0ee234 100644 --- a/wpa_supplicant/README +++ b/wpa_supplicant/README @@ -504,7 +504,7 @@ Example configuration files for some common configurations: network # allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel # # home network; allow all valid ciphers @@ -534,7 +534,7 @@ network={ 2) WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series) -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel network={ ssid="example" @@ -552,7 +552,7 @@ network={ 3) EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the unencrypted use. Real identity is sent only within an encrypted TLS tunnel. -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel network={ ssid="example" @@ -570,7 +570,7 @@ network={ 4) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and broadcast); use EAP-TLS for authentication -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel network={ ssid="1x-test" @@ -591,7 +591,7 @@ network={ selected SSID. This is mostly for testing and is not recommended for normal use. -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel network={ ssid="example" @@ -618,7 +618,7 @@ network={ 6) Authentication for wired Ethernet. This can be used with 'wired' or 'roboswitch' interface (-Dwired or -Droboswitch on command line). -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel ap_scan=0 network={ @@ -772,7 +772,7 @@ wpa_cli [-p] [-i] [-hvB] [-a] \ -a = run in daemon mode executing the action file based on events from wpa_supplicant -B = run a daemon in the background - default path: /var/run/wpa_supplicant + default path: /run/wpa_supplicant default interface: first interface found in socket path @@ -867,12 +867,12 @@ network interfaces and then add a network interface and configure a network (SSID): # Start wpa_supplicant in the background -wpa_supplicant -g/var/run/wpa_supplicant-global -B +wpa_supplicant -g/run/wpa_supplicant-global -B # Add a new interface (wlan0, no configuration file, driver=wext, and # enable control interface) -wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan0 \ - "" wext /var/run/wpa_supplicant +wpa_cli -g/run/wpa_supplicant-global interface_add wlan0 \ + "" wext /run/wpa_supplicant # Configure a network using the newly added network interface: wpa_cli -iwlan0 add_network @@ -888,7 +888,7 @@ wpa_cli -iwlan0 enable_network 0 # with the WPA-PSK network using SSID test. # Remove network interface -wpa_cli -g/var/run/wpa_supplicant-global interface_remove wlan0 +wpa_cli -g/run/wpa_supplicant-global interface_remove wlan0 Privilege separation @@ -926,14 +926,14 @@ Example configuration: - create user group for users that are allowed to use wpa_supplicant ('wpapriv' in this example) and assign users that should be able to use wpa_supplicant into that group -- create /var/run/wpa_priv directory for UNIX domain sockets and control +- create /run/wpa_priv directory for UNIX domain sockets and control user access by setting it accessible only for the wpapriv group: - mkdir /var/run/wpa_priv - chown root:wpapriv /var/run/wpa_priv - chmod 0750 /var/run/wpa_priv + mkdir /run/wpa_priv + chown root:wpapriv /run/wpa_priv + chmod 0750 /run/wpa_priv - start wpa_priv as root (e.g., from system startup scripts) with the enabled interfaces configured on the command line: - wpa_priv -B -P /var/run/wpa_priv.pid wext:ath0 + wpa_priv -B -P /run/wpa_priv.pid wext:ath0 - run wpa_supplicant as non-root with a user that is in wpapriv group: wpa_supplicant -i ath0 -c wpa_supplicant.conf diff --git a/wpa_supplicant/README-P2P b/wpa_supplicant/README-P2P index fb99c7b..e9fa43c 100644 --- a/wpa_supplicant/README-P2P +++ b/wpa_supplicant/README-P2P @@ -42,7 +42,7 @@ for P2P may be set. In order to make the devices easier to recognize, device_name and device_type should be specified. For example, something like this should be included: -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant device_name=My P2P Device device_type=1-0050F204-1 diff --git a/wpa_supplicant/README-WPS b/wpa_supplicant/README-WPS index 1ea9843..9835e55 100644 --- a/wpa_supplicant/README-WPS +++ b/wpa_supplicant/README-WPS @@ -243,7 +243,7 @@ wpa_supplicant -Dnone -c er.conf -ieth0 Sample er.conf: -ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin +ctrl_interface=DIR=/run/wpa_supplicant GROUP=admin device_name=WPS External Registrar diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 0c3cb9a..83c7d8f 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -323,8 +323,8 @@ struct wpa_config { * information and configuration. The socket file will be named based * on the interface name, so multiple %wpa_supplicant processes can be * run at the same time if more than one interface is used. - * /var/run/wpa_supplicant is the recommended directory for sockets and - * by default, wpa_cli will use it when trying to connect with + * /run/wpa_supplicant is the recommended directory for sockets and by + * default, wpa_cli will use it when trying to connect with * %wpa_supplicant. * * Access control for the control interface can be configured @@ -342,8 +342,8 @@ struct wpa_config { * interface access to this group. * * When configuring both the directory and group, use following format: - * DIR=/var/run/wpa_supplicant GROUP=wheel - * DIR=/var/run/wpa_supplicant GROUP=0 + * DIR=/run/wpa_supplicant GROUP=wheel + * DIR=/run/wpa_supplicant GROUP=0 * (group can be either group name or gid) * * For UDP connections (default on Windows): The value will be ignored. diff --git a/wpa_supplicant/doc/docbook/wpa_priv.sgml b/wpa_supplicant/doc/docbook/wpa_priv.sgml index eb907a8..9cb5770 100644 --- a/wpa_supplicant/doc/docbook/wpa_priv.sgml +++ b/wpa_supplicant/doc/docbook/wpa_priv.sgml @@ -56,14 +56,14 @@ Create user group (e.g., wpapriv) and assign users that should be able to use wpa_supplicant into that group. - Create /var/run/wpa_priv directory for UNIX domain sockets and + Create /run/wpa_priv directory for UNIX domain sockets and control user access by setting it accessible only for the wpapriv group:
-mkdir /var/run/wpa_priv -chown root:wpapriv /var/run/wpa_priv -chmod 0750 /var/run/wpa_priv +mkdir /run/wpa_priv +chown root:wpapriv /run/wpa_priv +chmod 0750 /run/wpa_priv
Start wpa_priv as root (e.g., from system @@ -71,7 +71,7 @@ chmod 0750 /var/run/wpa_priv command line:
-wpa_priv -B -c /var/run/wpa_priv -P /var/run/wpa_priv.pid wext:wlan0 +wpa_priv -B -c /run/wpa_priv -P /run/wpa_priv.pid wext:wlan0
Run wpa_supplicant as non-root with a user @@ -89,7 +89,7 @@ wpa_supplicant -i ath0 -c wpa_supplicant.conf -c ctrl path Specify the path to wpa_priv control directory - (Default: /var/run/wpa_priv/). + (Default: /run/wpa_priv/). diff --git a/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml b/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml index 462039d..e2a40db 100644 --- a/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml +++ b/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml @@ -46,7 +46,7 @@
# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group -ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel +ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel # # home network; allow all valid ciphers network={ @@ -79,7 +79,7 @@ network={ Aegis, Interlink RAD-Series)
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel +ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel network={ ssid="example" scan_ssid=1 @@ -101,7 +101,7 @@ network={
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel +ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel network={ ssid="example" scan_ssid=1 @@ -123,7 +123,7 @@ network={ authentication
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel +ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel network={ ssid="1x-test" scan_ssid=1 @@ -148,7 +148,7 @@ network={ use.
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel +ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel network={ ssid="example" scan_ssid=1 @@ -178,7 +178,7 @@ network={ (-Dwired or -Droboswitch on command line).
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel +ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel ap_scan=0 network={ key_mgmt=IEEE8021X diff --git a/wpa_supplicant/examples/ieee8021x.conf b/wpa_supplicant/examples/ieee8021x.conf index e8a5503..7147191 100644 --- a/wpa_supplicant/examples/ieee8021x.conf +++ b/wpa_supplicant/examples/ieee8021x.conf @@ -1,6 +1,6 @@ # IEEE 802.1X with dynamic WEP keys using EAP-PEAP/MSCHAPv2 -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant network={ ssid="example 802.1x network" diff --git a/wpa_supplicant/examples/plaintext.conf b/wpa_supplicant/examples/plaintext.conf index 542ac1d..bd17d18 100644 --- a/wpa_supplicant/examples/plaintext.conf +++ b/wpa_supplicant/examples/plaintext.conf @@ -1,6 +1,6 @@ # Plaintext (no encryption) network -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant network={ ssid="example open network" diff --git a/wpa_supplicant/examples/wep.conf b/wpa_supplicant/examples/wep.conf index 9c7b55f..4896934 100644 --- a/wpa_supplicant/examples/wep.conf +++ b/wpa_supplicant/examples/wep.conf @@ -1,6 +1,6 @@ # Static WEP keys -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant network={ ssid="example wep network" diff --git a/wpa_supplicant/examples/wpa-psk-tkip.conf b/wpa_supplicant/examples/wpa-psk-tkip.conf index 93d7fc2..15b309f 100644 --- a/wpa_supplicant/examples/wpa-psk-tkip.conf +++ b/wpa_supplicant/examples/wpa-psk-tkip.conf @@ -1,6 +1,6 @@ # WPA-PSK/TKIP -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant network={ ssid="example wpa-psk network" diff --git a/wpa_supplicant/examples/wpa2-eap-ccmp.conf b/wpa_supplicant/examples/wpa2-eap-ccmp.conf index d7a64d8..db93708 100644 --- a/wpa_supplicant/examples/wpa2-eap-ccmp.conf +++ b/wpa_supplicant/examples/wpa2-eap-ccmp.conf @@ -1,6 +1,6 @@ # WPA2-EAP/CCMP using EAP-TLS -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant network={ ssid="example wpa2-eap network" diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py index 0cfc1f6..c7da9a5 100755 --- a/wpa_supplicant/examples/wps-nfc.py +++ b/wpa_supplicant/examples/wps-nfc.py @@ -17,7 +17,7 @@ import nfc.handover import wpactrl -wpas_ctrl = '/var/run/wpa_supplicant' +wpas_ctrl = '/run/wpa_supplicant' def wpas_connect(): ifaces = [] diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 632db80..dc079d6 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -73,7 +73,7 @@ static int wpa_cli_attached = 0; static int wpa_cli_connected = 0; static int wpa_cli_last_id = 0; #ifndef CONFIG_CTRL_IFACE_DIR -#define CONFIG_CTRL_IFACE_DIR "/var/run/wpa_supplicant" +#define CONFIG_CTRL_IFACE_DIR "/run/wpa_supplicant" #endif /* CONFIG_CTRL_IFACE_DIR */ static const char *ctrl_iface_dir = CONFIG_CTRL_IFACE_DIR; static char *ctrl_ifname = NULL; diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp index 6bba8d2..049130f 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp @@ -133,7 +133,7 @@ WpaGui::WpaGui(QApplication *_app, QWidget *parent, const char *, Qt::WFlags) ctrl_conn = NULL; monitor_conn = NULL; msgNotifier = NULL; - ctrl_iface_dir = strdup("/var/run/wpa_supplicant"); + ctrl_iface_dir = strdup("/run/wpa_supplicant"); parse_argv(); diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c index ad6a080..cf9a5a8 100644 --- a/wpa_supplicant/wpa_priv.c +++ b/wpa_supplicant/wpa_priv.c @@ -956,7 +956,7 @@ int main(int argc, char *argv[]) int ret = -1; char *pid_file = NULL; int daemonize = 0; - char *ctrl_dir = "/var/run/wpa_priv"; + char *ctrl_dir = "/run/wpa_priv"; struct wpa_priv_interface *interfaces = NULL, *iface; if (os_program_init()) diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index 18460b8..592b73f 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -38,8 +38,8 @@ # The socket file will be named based on the interface name, so multiple # wpa_supplicant processes can be run at the same time if more than one # interface is used. -# /var/run/wpa_supplicant is the recommended directory for sockets and by -# default, wpa_cli will use it when trying to connect with wpa_supplicant. +# /run/wpa_supplicant is the recommended directory for sockets and by default, +# wpa_cli will use it when trying to connect with wpa_supplicant. # # Access control for the control interface can be configured by setting the # directory to allow only members of a group to use sockets. This way, it is @@ -55,8 +55,8 @@ # value it got by default when the directory or socket was created. # # When configuring both the directory and group, use following format: -# DIR=/var/run/wpa_supplicant GROUP=wheel -# DIR=/var/run/wpa_supplicant GROUP=0 +# DIR=/run/wpa_supplicant GROUP=wheel +# DIR=/run/wpa_supplicant GROUP=0 # (group can be either group name or gid) # # For UDP connections (default on Windows): The value will be ignored. This @@ -72,7 +72,7 @@ # DACL (which will reject all connections). See README-Windows.txt for more # information about SDDL string format. # -ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/run/wpa_supplicant # IEEE 802.1X/EAPOL version # wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines