From: Pontus Fuchs Date: Mon, 17 Dec 2012 14:27:04 +0000 (+0200) Subject: hostapd: Don't chown control interface to root X-Git-Tag: hostap_2_0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cbd5845d062ab0bc1de4678bc4f0b85bc0d32a9;p=thirdparty%2Fhostap.git hostapd: Don't chown control interface to root If ctrl_interface_group in the config file is set hostapd tries to chown the dir and socket to uid 0. This causes the chown to fail if hostapd is run as non-root. Signed-hostap: Pontus Fuchs --- diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index ccc018ec9..1d4fe0de2 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -997,7 +997,7 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd) } if (hapd->conf->ctrl_interface_gid_set && - chown(hapd->conf->ctrl_interface, 0, + chown(hapd->conf->ctrl_interface, -1, hapd->conf->ctrl_interface_gid) < 0) { perror("chown[ctrl_interface]"); return -1; @@ -1055,7 +1055,7 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd) } if (hapd->conf->ctrl_interface_gid_set && - chown(fname, 0, hapd->conf->ctrl_interface_gid) < 0) { + chown(fname, -1, hapd->conf->ctrl_interface_gid) < 0) { perror("chown[ctrl_interface/ifname]"); goto fail; }