X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Futils%2Fgss%2Flsupport.c;h=7bc291bda5a4c7a4edafebba2c989cd9056ef4a6;hb=14db26a85c52561d186b5c400981a0025d45864a;hp=b8c7e8e55bcf7f47a2a0b0c39eeff69f7de46e08;hpb=fdd5596593050d22feef05ecba6ba53c65cb3397;p=fs%2Flustre-release.git diff --git a/lustre/utils/gss/lsupport.c b/lustre/utils/gss/lsupport.c index b8c7e8e..7bc291b 100644 --- a/lustre/utils/gss/lsupport.c +++ b/lustre/utils/gss/lsupport.c @@ -15,11 +15,7 @@ * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. + * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ @@ -27,11 +23,10 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2014, Intel Corporation. + * Copyright (c) 2014, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. */ #ifndef _GNU_SOURCE @@ -47,6 +42,7 @@ #include #include +#include #include #include #include @@ -62,7 +58,6 @@ #ifdef HAVE_NETDB_H # include #endif -#include #ifdef _NEW_BUILD_ # include "lgss_utils.h" #else @@ -73,9 +68,9 @@ const char * lustre_svc_name[] = { - [LUSTRE_GSS_SVC_MGS] = "MGS", - [LUSTRE_GSS_SVC_MDS] = "MDS", - [LUSTRE_GSS_SVC_OSS] = "OSS", + [LUSTRE_GSS_SVC_MGS] = "MGS", + [LUSTRE_GSS_SVC_MDS] = "MDS", + [LUSTRE_GSS_SVC_OSS] = "OSS", }; /**************************************** @@ -250,6 +245,7 @@ int external_nid2hostname(char *lnd, uint32_t net, uint32_t addr, head = fgets(buf, bufsize, fghn); if (head == NULL) { printerr(0, "can't read from %s\n", gethostname_ex); + pclose(fghn); return -1; } if (pclose(fghn) == -1) @@ -260,7 +256,7 @@ int external_nid2hostname(char *lnd, uint32_t net, uint32_t addr, head++; tail = head + strlen(head); - if (tail <= head) { + if (tail <= head) { printerr(0, "no output from %s\n", gethostname_ex); return -1; } @@ -295,15 +291,11 @@ struct convert_struct { }; static struct convert_struct converter[] = { - [0] = { "UNUSED0", NULL}, - [QSWLND] = { "QSWLND", external_nid2hostname}, - [SOCKLND] = { "SOCKLND", ipv4_nid2hostname }, - [GMLND] = { "GMLND", external_nid2hostname}, - [PTLLND] = { "PTLLND", external_nid2hostname }, - [O2IBLND] = { "O2IBLND", ipv4_nid2hostname }, - [LOLND] = { "LOLND", lolnd_nid2hostname }, - [RALND] = { "RALND", external_nid2hostname }, - [MXLND] = { "MXLND", external_nid2hostname }, + [0] = { .name = "UNUSED0" }, + [SOCKLND] = { .name = "SOCKLND", .nid2name = ipv4_nid2hostname }, + [O2IBLND] = { .name = "O2IBLND", .nid2name = ipv4_nid2hostname }, + [LOLND] = { .name = "LOLND", .nid2name = lolnd_nid2hostname }, + [PTL4LND] = { .name = "PTL4LND", .nid2name = external_nid2hostname } }; #define LND_MAX (sizeof(converter) / sizeof(converter[0])) @@ -351,7 +343,7 @@ struct user_mapping { struct user_map_item *items; }; -static struct user_mapping mapping = {0, NULL}; +static struct user_mapping mapping; /* FIXME to be finished: monitor change of mapping database */ static int mapping_mtime = 0;