X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-distro%2Frecipes-security%2Fgssproxy%2Ffiles%2FMake-proc-file-failure-loud-but-nonfatal.patch;fp=meta-starlingx%2Fmeta-stx-distro%2Frecipes-security%2Fgssproxy%2Ffiles%2FMake-proc-file-failure-loud-but-nonfatal.patch;h=0000000000000000000000000000000000000000;hb=6fc6934434f70595536a387ece31bc30141cafb5;hp=18a58df015d06efd38ed8fbaf4045310467ba1f9;hpb=eb1e26510491ba49de693ab3b0498edcb06be6c5;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-distro/recipes-security/gssproxy/files/Make-proc-file-failure-loud-but-nonfatal.patch b/meta-starlingx/meta-stx-distro/recipes-security/gssproxy/files/Make-proc-file-failure-loud-but-nonfatal.patch deleted file mode 100644 index 18a58df..0000000 --- a/meta-starlingx/meta-stx-distro/recipes-security/gssproxy/files/Make-proc-file-failure-loud-but-nonfatal.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 938bd1adc15342e8ebed3d4e135d862e362a619e Mon Sep 17 00:00:00 2001 -From: Robbie Harwood -Date: Thu, 25 May 2017 13:06:17 -0400 -Subject: [PATCH] Make proc file failure loud but nonfatal - -Signed-off-by: Robbie Harwood -Reviewed-by: Simo Sorce -Resolves: #190 -(cherry picked from commit 4f60bf02a1a68cbb26251e764357b753f80790f3) ---- - proxy/src/gp_init.c | 34 +++++++++++++++------------------- - 1 file changed, 15 insertions(+), 19 deletions(-) - -diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c -index bb7ba6b..d367f92 100644 ---- a/proxy/src/gp_init.c -+++ b/proxy/src/gp_init.c -@@ -144,11 +144,11 @@ void init_proc_nfsd(struct gp_config *cfg) - { - char buf[] = "1"; - bool enabled = false; -- int fd, i, ret; -+ int fd, ret; - - /* check first if any service enabled kernel support */ -- for (i = 0; i < cfg->num_svcs; i++) { -- if (cfg->svcs[i]->kernel_nfsd == true) { -+ for (int i = 0; i < cfg->num_svcs; i++) { -+ if (cfg->svcs[i]->kernel_nfsd) { - enabled = true; - break; - } -@@ -161,30 +161,26 @@ void init_proc_nfsd(struct gp_config *cfg) - fd = open(LINUX_PROC_USE_GSS_PROXY_FILE, O_RDWR); - if (fd == -1) { - ret = errno; -- 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)); -- exit(1); -+ GPDEBUG("Kernel doesn't support GSS-Proxy (can't open %s: %d (%s))\n", -+ LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); -+ goto fail; - } - - ret = write(fd, buf, 1); - if (ret != 1) { - ret = errno; -- fprintf(stderr, "Failed to write to %s: %d (%s)\n", -- LINUX_PROC_USE_GSS_PROXY_FILE, -- ret, gp_strerror(ret)); -- exit(1); -+ GPDEBUG("Failed to write to %s: %d (%s)\n", -+ LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); - } - -- ret = close(fd); -- if (ret == -1) { -- ret = errno; -- fprintf(stderr, "Failed to close %s: %d (%s)\n", -- LINUX_PROC_USE_GSS_PROXY_FILE, -- ret, gp_strerror(ret)); -- exit(1); -+ close(fd); -+ if (ret != 0) { -+ goto fail; - } -+ -+ return; -+fail: -+ GPDEBUG("Problem with kernel communication! NFS server will not work\n"); - } - - void write_pid(void)