From d5fd2e4b0720b960c302daef98d0c889f1c046ae Mon Sep 17 00:00:00 2001 From: reyk Date: Mon, 18 Aug 2014 09:43:02 +0000 Subject: [PATCH] Sync proc.c with httpd. httpd needs SIGUSR1 but iked will ignore it now instead of terminating the process. ok mikeb@ --- sbin/iked/iked.c | 7 ++++++- sbin/iked/iked.h | 3 ++- sbin/iked/proc.c | 9 +++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sbin/iked/iked.c b/sbin/iked/iked.c index 68a13b2fdd5..22bc0c5aec8 100644 --- a/sbin/iked/iked.c +++ b/sbin/iked/iked.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iked.c,v 1.21 2014/05/08 13:11:16 blambert Exp $ */ +/* $OpenBSD: iked.c,v 1.22 2014/08/18 09:43:02 reyk Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -160,12 +160,14 @@ main(int argc, char *argv[]) signal_set(&ps->ps_evsigchld, SIGCHLD, parent_sig_handler, ps); signal_set(&ps->ps_evsighup, SIGHUP, parent_sig_handler, ps); signal_set(&ps->ps_evsigpipe, SIGPIPE, parent_sig_handler, ps); + signal_set(&ps->ps_evsigusr1, SIGUSR1, parent_sig_handler, ps); signal_add(&ps->ps_evsigint, NULL); signal_add(&ps->ps_evsigterm, NULL); signal_add(&ps->ps_evsigchld, NULL); signal_add(&ps->ps_evsighup, NULL); signal_add(&ps->ps_evsigpipe, NULL); + signal_add(&ps->ps_evsigusr1, NULL); proc_listen(ps, procs, nitems(procs)); @@ -279,6 +281,9 @@ parent_sig_handler(int sig, short event, void *arg) case SIGPIPE: log_info("%s: ignoring SIGPIPE", __func__); break; + case SIGUSR1: + log_info("%s: ignoring SIGUSR1", __func__); + break; case SIGTERM: case SIGINT: die = 1; diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h index 0e240f62748..ad1e9818489 100644 --- a/sbin/iked/iked.h +++ b/sbin/iked/iked.h @@ -1,4 +1,4 @@ -/* $OpenBSD: iked.h,v 1.81 2014/05/09 06:37:24 markus Exp $ */ +/* $OpenBSD: iked.h,v 1.82 2014/08/18 09:43:02 reyk Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -532,6 +532,7 @@ struct privsep { struct event ps_evsigchld; struct event ps_evsighup; struct event ps_evsigpipe; + struct event ps_evsigusr1; struct iked *ps_env; }; diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c index 5fc1b6fdac9..fac0f9e7792 100644 --- a/sbin/iked/proc.c +++ b/sbin/iked/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.18 2014/07/12 14:15:04 reyk Exp $ */ +/* $OpenBSD: proc.c,v 1.19 2014/08/18 09:43:02 reyk Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter @@ -38,8 +38,6 @@ #include #include -#include - #include "iked.h" void proc_open(struct privsep *, struct privsep_proc *, @@ -163,7 +161,7 @@ proc_open(struct privsep *ps, struct privsep_proc *p, /* * Open socket pairs for our peers - */ + */ for (proc = 0; proc < nproc; proc++) { procs[proc].p_ps = ps; procs[proc].p_env = ps->ps_env; @@ -323,6 +321,7 @@ proc_sig_handler(int sig, short event, void *arg) case SIGCHLD: case SIGHUP: case SIGPIPE: + case SIGUSR1: /* ignore */ break; default: @@ -409,12 +408,14 @@ proc_run(struct privsep *ps, struct privsep_proc *p, signal_set(&ps->ps_evsigchld, SIGCHLD, proc_sig_handler, p); signal_set(&ps->ps_evsighup, SIGHUP, proc_sig_handler, p); signal_set(&ps->ps_evsigpipe, SIGPIPE, proc_sig_handler, p); + signal_set(&ps->ps_evsigusr1, SIGUSR1, proc_sig_handler, p); signal_add(&ps->ps_evsigint, NULL); signal_add(&ps->ps_evsigterm, NULL); signal_add(&ps->ps_evsigchld, NULL); signal_add(&ps->ps_evsighup, NULL); signal_add(&ps->ps_evsigpipe, NULL); + signal_add(&ps->ps_evsigusr1, NULL); proc_listen(ps, procs, nproc); -- 2.20.1