From 834415d1090d88f555d4af918a9b3086be68e841 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 13 Dec 2017 13:00:24 -0500 Subject: [PATCH] Conditionally reload kernel interface on SIGHUP --- ...ly-reload-kernel-interface-on-SIGHUP.patch | 59 +++++++++++++++++++ gssproxy.spec | 6 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 Conditionally-reload-kernel-interface-on-SIGHUP.patch diff --git a/Conditionally-reload-kernel-interface-on-SIGHUP.patch b/Conditionally-reload-kernel-interface-on-SIGHUP.patch new file mode 100644 index 0000000..4495bc1 --- /dev/null +++ b/Conditionally-reload-kernel-interface-on-SIGHUP.patch @@ -0,0 +1,59 @@ +From 70d500d0dcc26ff3a87c1dd4bd6ab0c591ed4cf9 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Mon, 26 Jun 2017 17:04:16 -0400 +Subject: [PATCH] Conditionally reload kernel interface on SIGHUP + +Signed-off-by: Alexander Scheel +[rharwood@redhat.com: Simplified logic, rewrote commit message] +Reviewed-by: Robbie Harwood +Resolves: #193 +Merges: #201 +(cherry picked from commit 938af94b8f33c227dcdd6a53ed42de418578d29d) +--- + proxy/src/gp_init.c | 4 +++- + proxy/src/gssproxy.c | 3 +++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c +index e69934d..6a2b047 100644 +--- a/proxy/src/gp_init.c ++++ b/proxy/src/gp_init.c +@@ -145,6 +145,7 @@ void init_proc_nfsd(struct gp_config *cfg) + char buf[] = "1"; + bool enabled = false; + int fd, ret; ++ static int poked = 0; + + /* check first if any service enabled kernel support */ + for (int i = 0; i < cfg->num_svcs; i++) { +@@ -154,7 +155,7 @@ void init_proc_nfsd(struct gp_config *cfg) + } + } + +- if (!enabled) { ++ if (!enabled || poked) { + return; + } + +@@ -173,6 +174,7 @@ void init_proc_nfsd(struct gp_config *cfg) + LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); + } + ++ poked = 1; + close(fd); + if (ret != 0) { + goto fail; +diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c +index 94a6a61..5fc4f8d 100644 +--- a/proxy/src/gssproxy.c ++++ b/proxy/src/gssproxy.c +@@ -140,6 +140,9 @@ static void hup_handler(verto_ctx *vctx, verto_ev *ev UNUSED) + exit(ret); + } + ++ /* conditionally reload kernel interface */ ++ init_proc_nfsd(gpctx->config); ++ + free_config(&old_config); + + GPDEBUG("New config loaded successfully.\n"); diff --git a/gssproxy.spec b/gssproxy.spec index e52d9ea..663379b 100644 --- a/gssproxy.spec +++ b/gssproxy.spec @@ -1,6 +1,6 @@ Name: gssproxy Version: 0.7.0 -Release: 28%{?dist} +Release: 29%{?dist} Summary: GSSAPI Proxy Group: System Environment/Libraries @@ -48,6 +48,7 @@ Patch35: Simplify-setting-NONBLOCK-on-socket.patch Patch36: Fix-handling-of-non-EPOLLIN-EPOLLOUT-events.patch Patch37: Fix-error-handling-in-gpm_send_buffer-gpm_recv_buffe.patch Patch38: Emit-debug-on-queue-errors.patch +Patch39: Conditionally-reload-kernel-interface-on-SIGHUP.patch ### Dependencies ### Requires: krb5-libs >= 1.12.0 @@ -145,6 +146,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart gssproxy.service %changelog +* Wed Dec 13 2017 Robbie Harwood - 0.7.0-29 +- Conditionally reload kernel interface on SIGHUP + * Tue Dec 12 2017 Robbie Harwood - 0.7.0-28 - Fixup previous