summaryrefslogtreecommitdiff
path: root/linux_priv.c
diff options
context:
space:
mode:
authorStanisław Pitucha <viraptor@gmail.com>2018-04-12 20:59:29 +1000
committerStanisław Pitucha <viraptor@gmail.com>2018-04-12 21:29:06 +1000
commit51b55661923411998008c66aea7020d3b7057eaf (patch)
tree1b0913f00f91f6de0d5f567c4e944e3374551d25 /linux_priv.c
parent95e6469bd2ceef92bcaaf140e2724fc73d556185 (diff)
downloadmemcached-51b55661923411998008c66aea7020d3b7057eaf.tar.gz
Fail loudly if seccomp setup fails
Diffstat (limited to 'linux_priv.c')
-rw-r--r--linux_priv.c10
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);
}