diff options
author | Stanisław Pitucha <viraptor@gmail.com> | 2018-04-12 20:59:29 +1000 |
---|---|---|
committer | Stanisław Pitucha <viraptor@gmail.com> | 2018-04-12 21:29:06 +1000 |
commit | 51b55661923411998008c66aea7020d3b7057eaf (patch) | |
tree | 1b0913f00f91f6de0d5f567c4e944e3374551d25 /linux_priv.c | |
parent | 95e6469bd2ceef92bcaaf140e2724fc73d556185 (diff) | |
download | memcached-51b55661923411998008c66aea7020d3b7057eaf.tar.gz |
Fail loudly if seccomp setup fails
Diffstat (limited to 'linux_priv.c')
-rw-r--r-- | linux_priv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/linux_priv.c b/linux_priv.c index 5c696bc..3a046a7 100644 --- a/linux_priv.c +++ b/linux_priv.c @@ -58,8 +58,13 @@ void drop_privileges(void) { goto fail; } + seccomp_release(ctx); + return; + fail: seccomp_release(ctx); + fprintf(stderr, "Failed to set a seccomp profile on the main thread\n"); + exit(EXIT_FAILURE); } void drop_worker_privileges(void) { @@ -135,6 +140,11 @@ void drop_worker_privileges(void) { goto fail; } + seccomp_release(ctx); + return; + fail: seccomp_release(ctx); + fprintf(stderr, "Failed to set a seccomp profile on a worker thread\n"); + exit(EXIT_FAILURE); } |