Parcourir la source

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 <j@w1.fi>
Jouni Malinen il y a 11 ans
Parent
commit
f62415df8a
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      wpa_supplicant/ctrl_iface_unix.c

+ 7 - 1
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: