diff options
author | Robbie Harwood <rharwood@redhat.com> | 2015-10-09 16:29:21 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-10-09 16:35:42 -0400 |
commit | 0dae2c75f774519507c90bd4c3e4a860e1c84ab8 (patch) | |
tree | 42c526cca234f73b265a40043df4cec2a8b8fd28 | |
parent | 614a46cd1adb4e175eb4fa74f61e03a0f2b5610c (diff) | |
download | gss-proxy-0dae2c75f774519507c90bd4c3e4a860e1c84ab8.tar.gz gss-proxy-0dae2c75f774519507c90bd4c3e4a860e1c84ab8.tar.xz gss-proxy-0dae2c75f774519507c90bd4c3e4a860e1c84ab8.zip |
Log useful message on kernel interface failure
Also, cause all failures on accessing this interface to exit GSS-Proxy similar
to config file errors.
Ticket: https://fedorahosted.org/gss-proxy/ticket/126
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
-rw-r--r-- | proxy/src/gp_init.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c index 3430c90..bb7ba6b 100644 --- a/proxy/src/gp_init.c +++ b/proxy/src/gp_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 the GSS-PROXY contributors, see COPYING for license */ +/* Copyright (C) 2011,2015 the GSS-PROXY contributors, see COPYING for license */ #include <stdlib.h> #include <sys/types.h> @@ -161,26 +161,29 @@ void init_proc_nfsd(struct gp_config *cfg) fd = open(LINUX_PROC_USE_GSS_PROXY_FILE, O_RDWR); if (fd == -1) { ret = errno; - GPDEBUG("Failed to open %s: %d (%s)\n", + fprintf(stderr, "GSS-Proxy is not supported by this kernel since " + "file %s could not be found: %d (%s)\n", LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); - return; + exit(1); } ret = write(fd, buf, 1); if (ret != 1) { ret = errno; - GPDEBUG("Failed to write to %s: %d (%s)\n", + fprintf(stderr, "Failed to write to %s: %d (%s)\n", LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); + exit(1); } ret = close(fd); if (ret == -1) { ret = errno; - GPDEBUG("Failed to close %s: %d (%s)\n", + fprintf(stderr, "Failed to close %s: %d (%s)\n", LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); + exit(1); } } |