strongswan/strongswan — pull request #8 by shlevy (2014-10-01 01:39:32+00:00)
Title: No hardcoded sysconfdir

These patches allow strongswan to run without any configuration in a global location (e.g. `/etc`).

In particular, this is useful for the [NixOS](http://nixos.org) distro, as by design it isolates each service and its configuration from each other, to allow both reproducibility (e.g. configuration rollback) and running multiple instances of a service side-by-side.

Note that I've only fully tested these patches on top of `5.2.0`, which required changing the first patch to:

```diff
diff -Naur a/src/libstrongswan/library.c b/src/libstrongswan/library.c
--- a/src/libstrongswan/library.c 2014-06-05 03:50:30.000000000 -0400
+++ b/src/libstrongswan/library.c 2014-09-30 15:25:27.927757711 -0400
@@ -307,7 +307,7 @@
#ifdef STRONGSWAN_CONF
if (!settings)
{
- settings = STRONGSWAN_CONF;
+ settings = getenv("STRONGSWAN_CONF") ?: STRONGSWAN_CONF;
}
#endif
this->public.settings = settings_create(settings);
```