From 2f82e0dab89c7874ef21875b95ce24a7f94245be Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 14 Aug 2024 22:57:02 +0100 Subject: [PATCH] hostapd set permissions on dir in /run/ --- modules/hostapd/service.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/hostapd/service.nix b/modules/hostapd/service.nix index 9969cfc..a2752f8 100644 --- a/modules/hostapd/service.nix +++ b/modules/hostapd/service.nix @@ -21,7 +21,7 @@ let driver = "nl80211"; logger_syslog = "-1"; logger_syslog_level = 1; - ctrl_interface = "/run/hostapd"; + ctrl_interface = "/run/${name}"; ctrl_interface_group = 0; }; attrs = defaults // params ; @@ -43,7 +43,9 @@ in longrun { inherit name; dependencies = [ interface ]; run = '' - ${output-template}/bin/output-template '{{' '}}' < ${conf} > /run/${name}.conf - exec ${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}.pid -S /run/${name}.conf + mkdir -p /run/${name} + chmod 0700 /run/${name} + ${output-template}/bin/output-template '{{' '}}' < ${conf} > /run/${name}/hostapd.conf + exec ${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}/hostapd.pid -S /run/${name}/hostapd.conf ''; }