From 39e4c97530c4657192e7c0d6a22ca30c90cdb6e4 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 21 Jul 2021 12:41:10 -0400 Subject: [PATCH] LU-14093 gss: gcc10 fixes for GSS Building with gcc10 reports the following issues when building GSS: gss_util.h:37: multiple definition of `this_realm'; gssd.h:73: multiple definition of `clnt_list'; svcgssd.h:38: multiple definition of `krb_enabled'; Properly scope these variables. Change-Id: I05fc298fb90d67314c6963273688c2577099188a Test-Parameters: env=SHARED_KEY=true testlist=sanity,recovery-small,sanity-sec Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/44363 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lustre/utils/gss/gss_util.h | 2 +- lustre/utils/gss/gssd.h | 4 +--- lustre/utils/gss/gssd_main_loop.c | 2 +- lustre/utils/gss/gssd_proc.c | 7 +++++++ lustre/utils/gss/svcgssd.h | 2 -- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lustre/utils/gss/gss_util.h b/lustre/utils/gss/gss_util.h index 7a2a6b5..e7cc128 100644 --- a/lustre/utils/gss/gss_util.h +++ b/lustre/utils/gss/gss_util.h @@ -34,7 +34,7 @@ #include #include "write_bytes.h" -char *this_realm; +extern char *this_realm; extern gss_cred_id_t gssd_creds; void pgsserr(char *msg, u_int32_t maj_stat, u_int32_t min_stat, diff --git a/lustre/utils/gss/gssd.h b/lustre/utils/gss/gssd.h index b66fdf9..86cd658 100644 --- a/lustre/utils/gss/gssd.h +++ b/lustre/utils/gss/gssd.h @@ -70,8 +70,6 @@ extern char *ccachedir; extern char gethostname_ex[PATH_MAX]; extern int use_memcache; -TAILQ_HEAD(clnt_list_head, clnt_info) clnt_list; - struct clnt_info { TAILQ_ENTRY(clnt_info) list; char *dirname; @@ -87,7 +85,7 @@ void init_client_list(void); int update_client_list(void); void handle_krb5_upcall(struct clnt_info *clp); void lgssd_run(void); - +struct clnt_info *clnt_list_first_entry(void); extern int lgssd_mutex_downcall; diff --git a/lustre/utils/gss/gssd_main_loop.c b/lustre/utils/gss/gssd_main_loop.c index bb20538..ccb5515 100644 --- a/lustre/utils/gss/gssd_main_loop.c +++ b/lustre/utils/gss/gssd_main_loop.c @@ -70,7 +70,7 @@ scan_poll_results(int ret) int i; struct clnt_info *clp; - for (clp = clnt_list.tqh_first; clp != NULL; clp = clp->list.tqe_next) + for (clp = clnt_list_first_entry(); clp != NULL; clp = clp->list.tqe_next) { i = clp->krb5_poll_index; if (i >= 0 && pollarray[i].revents) { diff --git a/lustre/utils/gss/gssd_proc.c b/lustre/utils/gss/gssd_proc.c index 9d3f3e9..0aa13e8 100644 --- a/lustre/utils/gss/gssd_proc.c +++ b/lustre/utils/gss/gssd_proc.c @@ -99,6 +99,8 @@ * and rescan the whole {pipefs_nfsdir} when this happens. */ +TAILQ_HEAD(clnt_list_head, clnt_info) clnt_list; + struct pollfd * pollarray; int pollsize; /* the size of pollaray (in pollfd's) */ @@ -255,6 +257,11 @@ init_client_list(void) pollarray = calloc(pollsize, sizeof(struct pollfd)); } +struct clnt_info *clnt_list_first_entry(void) +{ + return clnt_list.tqh_first; +} + /* * This is run after a DNOTIFY signal, and should clear up any * directories that are no longer around, and re-scan any existing diff --git a/lustre/utils/gss/svcgssd.h b/lustre/utils/gss/svcgssd.h index 6133589..4d8bc13 100644 --- a/lustre/utils/gss/svcgssd.h +++ b/lustre/utils/gss/svcgssd.h @@ -35,8 +35,6 @@ #include #include -int krb_enabled; - int handle_channel_request(FILE *f); void svcgssd_run(void); int gssd_prepare_creds(int must_srv_mgs, int must_srv_mds, int must_srv_oss); -- 1.8.3.1