Allow strongSwan to be spawned as non-root user
authorMicah Morton <mortonm@chromium.org>
Tue, 17 Apr 2018 20:29:03 +0000 (13:29 -0700)
committerTobias Brunner <tobias@strongswan.org>
Mon, 14 May 2018 13:50:01 +0000 (15:50 +0200)
commitb9fcc619912859d48020ffb1b1e1096030df7f02
tree2f53c7b278b48b2ac5ba562ba22deb2d0981761f
parent0d2e18a189fc01274022dc0d09fb6ac763b953ea
Allow strongSwan to be spawned as non-root user

This patch allows for giving strongSwan only the runtime capabilities it
needs, rather than full root privileges.

Adds preprocessor directives which allow strongSwan to be configured to
 1) start up as a non-root user
 2) avoid modprobe()'ing IPsec kernel modules into the kernel, which
    would normally require root or CAP_SYS_MODULE

Additionally, some small mods to charon/libstrongswan ensure that charon
fully supports starting as a non-root user.

Tested with strongSwan 5.5.3.
src/charon/charon.c
src/libstrongswan/networking/streams/stream_service_unix.c
src/libstrongswan/utils/capabilities.c
src/libstrongswan/utils/capabilities.h
src/starter/starter.c