aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Aspegren S√łndergaard <andersas@gmail.com>2009-11-16 14:43:25 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 19:34:47 (GMT)
commit35db79ce3ae84eb83d797dfebbb15f928bfe0393 (patch)
treec8b60115b1830662f57bd196ca1f6866a326725f
parent6b18f2e013ba2fd3deb5a3454aca5279d6822ad2 (diff)
downloadhostap-06-35db79ce3ae84eb83d797dfebbb15f928bfe0393.zip
hostap-06-35db79ce3ae84eb83d797dfebbb15f928bfe0393.tar.gz
hostap-06-35db79ce3ae84eb83d797dfebbb15f928bfe0393.tar.bz2
wpa_supplicant: Fix ctrl_interface group permissions to allow read/execute
When using umask 0077, the control interface directory was left without group read/execute permissions even if the configuration file explicitly asked for the group to be allowed to access the control interface. Fix this by adding read/execute permissions for group if a specific group is defined in the configuration. [Bug 199] (cherry picked from commit 3fd2a226f9dfb1ff5016e4f2809174f4ae8f33eb)
-rw-r--r--wpa_supplicant/ctrl_iface_unix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface_unix.c b/wpa_supplicant/ctrl_iface_unix.c
index 8c45bd6..2a62713 100644
--- a/wpa_supplicant/ctrl_iface_unix.c
+++ b/wpa_supplicant/ctrl_iface_unix.c
@@ -332,6 +332,14 @@ wpa_supplicant_ctrl_iface_init(struct wpa_supplicant *wpa_s)
goto fail;
}
+ /* Make sure the group can enter and read the directory */
+ if (gid_set &&
+ chmod(dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP) < 0) {
+ wpa_printf(MSG_ERROR, "CTRL: chmod[ctrl_interface]: %s",
+ strerror(errno));
+ goto fail;
+ }
+
if (os_strlen(dir) + 1 + os_strlen(wpa_s->ifname) >=
sizeof(addr.sun_path)) {
wpa_printf(MSG_ERROR, "ctrl_iface path limit exceeded");