diff options
author | Stanisław Pitucha <viraptor@gmail.com> | 2018-07-08 21:01:34 +1000 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-08-28 14:36:03 -0700 |
commit | ec34cb718b64dccb91ba440846eafa97aa5ca5db (patch) | |
tree | 4108c0b7d2689294bf0dff421a36c9b512e418a4 /memcached.c | |
parent | 05693047c81a7ace8111d5e541d47f74b1d884a7 (diff) | |
download | memcached-ec34cb718b64dccb91ba440846eafa97aa5ca5db.tar.gz |
Add a handler for seccomp crashes
When seccomp causes a crash, use a SIGSYS action and handle it to print
out an error. Most functions are not allowed at that point (no buffered
output, no ?printf functions, no abort, ...), so the implementation is
as minimal as possible.
Print out a message with the syscall number and exit the process (all
threads).
Diffstat (limited to 'memcached.c')
-rw-r--r-- | memcached.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/memcached.c b/memcached.c index 9f66573..c68781a 100644 --- a/memcached.c +++ b/memcached.c @@ -8227,6 +8227,10 @@ int main (int argc, char **argv) { slabs_prefill_global(); } #endif + + if (settings.drop_privileges) { + setup_privilege_violations_handler(); + } /* * ignore SIGPIPE signals; we can use errno == EPIPE if we * need that information |