From: Jouni Malinen Date: Fri, 13 Jun 2014 22:20:18 +0000 (+0300) Subject: Note chmod() failure in debug log even in ignore case (CID 62843) X-Git-Tag: hostap_2_3~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f62415df8a948b62ba6f88c24f854d38626f8bb1;p=thirdparty%2Fhostap.git Note chmod() failure in debug log even in ignore case (CID 62843) If this chmod() call fails, the global control interface is allowed to be used since there was no change to its group. Anyway, it can be helpful to note the error case in debug log instead of silently ignoring it. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/ctrl_iface_unix.c b/wpa_supplicant/ctrl_iface_unix.c index d4e45de77..40082e24a 100644 --- a/wpa_supplicant/ctrl_iface_unix.c +++ b/wpa_supplicant/ctrl_iface_unix.c @@ -990,7 +990,13 @@ static int wpas_global_ctrl_iface_open_sock(struct wpa_global *global, goto fail; } } else { - chmod(ctrl, S_IRWXU); + if (chmod(ctrl, S_IRWXU) < 0) { + wpa_printf(MSG_DEBUG, + "chmod[global_ctrl_interface=%s](S_IRWXU): %s", + ctrl, strerror(errno)); + /* continue anyway since group change was not required + */ + } } havesock: