X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fgss%2Flsupport.c;h=e93c4e96966eaedaba5861a81cebb19e68c0dffe;hb=b0797d7ed4e6551d229620b45295d9387b3202bd;hp=0f5d8697f3f3d579b8fa1d3425b6715846546bd1;hpb=e3a7c58aebafce40323db54bf6056029e5af4a70;p=fs%2Flustre-release.git diff --git a/lustre/utils/gss/lsupport.c b/lustre/utils/gss/lsupport.c index 0f5d869..e93c4e9 100644 --- a/lustre/utils/gss/lsupport.c +++ b/lustre/utils/gss/lsupport.c @@ -15,17 +15,15 @@ * * 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 */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2014, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -45,6 +43,7 @@ #include #include +#include #include #include #include @@ -57,10 +56,9 @@ #include #include #include -#ifdef HAVE_GETHOSTBYNAME +#ifdef HAVE_NETDB_H # include #endif - #ifdef _NEW_BUILD_ # include "lgss_utils.h" #else @@ -258,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; } @@ -293,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])) @@ -349,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; @@ -434,12 +428,6 @@ static int read_mapping_db(void) while ((line = fgets(linebuf, MAX_LINE_LEN, f)) != NULL) { char *name; - if (strlen(line) >= MAX_LINE_LEN) { - printerr(0, "invalid mapping db: line too long (%d)\n", - strlen(line)); - continue; - } - if (sscanf(line, "%s %s %s", princ, nid_str, dest) != 3) { printerr(0, "mapping db: syntax error\n"); continue;