Whamcloud - gitweb
LU-14093 gss: gcc10 fixes for GSS 63/44363/4
authorJames Simmons <jsimmons@infradead.org>
Wed, 21 Jul 2021 16:41:10 +0000 (12:41 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 31 Jul 2021 06:39:25 +0000 (06:39 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/44363
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/gss/gss_util.h
lustre/utils/gss/gssd.h
lustre/utils/gss/gssd_main_loop.c
lustre/utils/gss/gssd_proc.c
lustre/utils/gss/svcgssd.h

index 7a2a6b5..e7cc128 100644 (file)
@@ -34,7 +34,7 @@
 #include <stdlib.h>
 #include "write_bytes.h"
 
 #include <stdlib.h>
 #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,
 extern gss_cred_id_t   gssd_creds;
 
 void pgsserr(char *msg, u_int32_t maj_stat, u_int32_t min_stat,
index b66fdf9..86cd658 100644 (file)
@@ -70,8 +70,6 @@ extern char *ccachedir;
 extern char gethostname_ex[PATH_MAX];
 extern int use_memcache;
 
 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;
 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);
 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;
 
 
 extern int lgssd_mutex_downcall;
 
index bb20538..ccb5515 100644 (file)
@@ -70,7 +70,7 @@ scan_poll_results(int ret)
        int                     i;
        struct clnt_info        *clp;
 
        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) {
        {
                i = clp->krb5_poll_index;
                if (i >= 0 && pollarray[i].revents) {
index 9d3f3e9..0aa13e8 100644 (file)
@@ -99,6 +99,8 @@
  *      and rescan the whole {pipefs_nfsdir} when this happens.
  */
 
  *      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) */
 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));
 }
 
        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
 /*
  * This is run after a DNOTIFY signal, and should clear up any
  * directories that are no longer around, and re-scan any existing
index 6133589..4d8bc13 100644 (file)
@@ -35,8 +35,6 @@
 #include <sys/queue.h>
 #include <gssapi/gssapi.h>
 
 #include <sys/queue.h>
 #include <gssapi/gssapi.h>
 
-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);
 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);