From d96ddedb4cdab3d50e25048f800416d546700049 Mon Sep 17 00:00:00 2001 From: Martin Elshuber Date: Thu, 26 Jun 2025 13:20:20 +0200 Subject: [PATCH] package/strongswan: add option to specify paths to PID and UNIX socket files Strongswan allows to specify a path for PID and UNIX socket files at compile time via the --with-piddir argument. This is especially useful when Strongswan is running inside a container where we may not want to share/mount the default path of /var/run inside the container. Let's add an option to configure the piddir. Considering this is a critical path, let's add a default value to the string option (which is currently the same as strongswan's default when the option is missing) so that it is stable across strongswan releases in Buildroot. Signed-off-by: Martin Elshuber [Quentin: rewriting of commit title and commit log] Signed-off-by: Quentin Schulz Signed-off-by: Julien Olivain --- package/strongswan/Config.in | 10 ++++++++++ package/strongswan/strongswan.mk | 3 +++ 2 files changed, 13 insertions(+) diff --git a/package/strongswan/Config.in b/package/strongswan/Config.in index 047b460be8..10efcc1616 100644 --- a/package/strongswan/Config.in +++ b/package/strongswan/Config.in @@ -63,6 +63,16 @@ config BR2_PACKAGE_STRONGSWAN_WOLFSSL endchoice +config BR2_PACKAGE_STRONGSWAN_PIDDIR + string "piddir" + default "/var/run" + help + Path for PID and UNIX socket files used by strongswan. + + Use the empty string to not pass --with-piddir to strongswan + configure, this then defaults to strongswan's source default + which may not be stable across releases. + config BR2_PACKAGE_STRONGSWAN_AF_ALG bool "Enable AF_ALG crypto interface to Linux Crypto API" diff --git a/package/strongswan/strongswan.mk b/package/strongswan/strongswan.mk index 0ee26df43d..9719242327 100644 --- a/package/strongswan/strongswan.mk +++ b/package/strongswan/strongswan.mk @@ -66,6 +66,9 @@ ifeq ($(BR2_PACKAGE_STRONGSWAN_DROP_CAPS),y) STRONGSWAN_CONF_OPTS += --with-capabilities=libcap endif +# setup piddir if BR2_PACKAGE_STRONGSWAN_PIDDIR is not empty +STRONGSWAN_CONF_OPTS += $(if $(call qstrip,$(BR2_PACKAGE_STRONGSWAN_PIDDIR)),--with-piddir=$(BR2_PACKAGE_STRONGSWAN_PIDDIR)) + ifeq ($(BR2_PACKAGE_STRONGSWAN_NONROOT),y) STRONGSWAN_CONF_OPTS += \ --with-user=charon \