ieee8021xclient: fix supplicant config ownership

The generated configuration carries the 802.1X identity and password,
but was left owned by root with default permissions so wpa_supplicant
could not read it: since OpenWrt 21.02 the daemon drops privileges and
runs as the "network" user. Hand the file over to that user and keep it
private instead of making it world readable.

Bump PKG_RELEASE since the packaged script changes.

Signed-off-by: Zhao Kunyu <839438904@qq.com>
This commit is contained in:
Zhao Kunyu authored and Hannu Nyman committed 2026-11-22 18:15:55 +02:00
1 parent 31d7ea7799
commit 0256470925
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee8021xclient
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0-or-later
include $(INCLUDE_DIR)/package.mk
@@ -72,6 +72,14 @@ network={
${eap_workaround:+eap_workaround=1}
}
EOF
# The file carries the 802.1X identity and password, so keep it private.
# wpa_supplicant drops privileges and runs as the "network" user since
# OpenWrt 21.02, so hand the file to that user instead of making it
# world readable.
chown network:network "$_config"
chmod 600 "$_config"
ubus wait_for wpa_supplicant
ubus call wpa_supplicant config_add "{ \"driver\":\"wired\", \"iface\": \"$ifname\", \"config\": \"$_config\" }"
}