X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fgss%2Fsvcgssd_proc.c;h=588b524364d8dec483b18748fe361bb92d792fdf;hb=6ff417169a2ad84478cce1b0321e70a030ffed83;hp=a0ffa52d744c05ed8ebf09d9076e0655068dfe33;hpb=21d716e6c16424d9deb646456758ebbaa9c70fec;p=fs%2Flustre-release.git diff --git a/lustre/utils/gss/svcgssd_proc.c b/lustre/utils/gss/svcgssd_proc.c index a0ffa52..588b524 100644 --- a/lustre/utils/gss/svcgssd_proc.c +++ b/lustre/utils/gss/svcgssd_proc.c @@ -6,6 +6,8 @@ Copyright (c) 2002 Bruce Fields + Copyright (c) 2014, Intel Corporation. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -36,6 +38,7 @@ #include #include +#include #include #include #include @@ -43,7 +46,9 @@ #include #include #include -#include +#ifdef HAVE_NETDB_H +# include +#endif #include "svcgssd.h" #include "gss_util.h" @@ -269,15 +274,15 @@ print_hexl(int pri, unsigned char *cp, int length) printerr(pri, "\n"); for (i = 0; i < length; i += 0x10) { - printerr(pri, " %04x: ", (u_int)i); + printerr(pri, " %04x: ", (unsigned int)i); jm = length - i; jm = jm > 16 ? 16 : jm; for (j = 0; j < jm; j++) { if ((j % 2) == 1) - printerr(pri,"%02x ", (u_int)cp[i+j]); + printerr(pri, "%02x ", (unsigned int)cp[i+j]); else - printerr(pri,"%02x", (u_int)cp[i+j]); + printerr(pri, "%02x", (unsigned int)cp[i+j]); } for (; j < 16; j++) { if ((j % 2) == 1) @@ -322,7 +327,7 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred, } if (name.length >= 0xffff || /* be certain name.length+1 doesn't overflow */ !(sname = calloc(name.length + 1, 1))) { - printerr(0, "WARNING: get_ids: error allocating %d bytes " + printerr(0, "WARNING: get_ids: error allocating %zu bytes " "for sname\n", name.length + 1); gss_release_buffer(&min_stat, &name); return -1; @@ -399,9 +404,8 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred, cred->cr_uid = 0; cred->cr_usr_mds = 1; } else if (!strcmp(sname, GSSD_SERVICE_OSS)) { - printerr(0, "ERROR: MDS doesn't accept " - "user "GSSD_SERVICE_OSS"\n"); - break; + cred->cr_uid = 0; + cred->cr_usr_oss = 1; } else { pw = getpwnam(sname); if (pw != NULL) { @@ -436,8 +440,9 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred, } else if (!strcmp(sname, GSSD_SERVICE_MDS)) { cred->cr_uid = 0; cred->cr_usr_mds = 1; - } else { - printerr(0, "ERROR: svc %d doesn't accept user %s" + } + if (cred->cr_uid == -1) { + printerr(0, "ERROR: svc %d doesn't accept user %s " "from %016llx\n", lustre_svc, sname, nid); break; } @@ -507,7 +512,7 @@ handle_nullreq(FILE *f) { qword_get(&cp, (char *) &lustre_svc, sizeof(lustre_svc)); qword_get(&cp, (char *) &nid, sizeof(nid)); qword_get(&cp, (char *) &handle_seq, sizeof(handle_seq)); - printerr(2, "handling req: svc %u, nid %016llx, idx %llx\n", + printerr(2, "handling req: svc %u, nid %016llx, idx %"PRIx64"\n", lustre_svc, nid, handle_seq); get_len = qword_get(&cp, in_handle.value, sizeof(in_handle_buf)); @@ -535,7 +540,7 @@ handle_nullreq(FILE *f) { if (in_handle.length != 0) { /* CONTINUE_INIT case */ if (in_handle.length != sizeof(ctx)) { printerr(0, "WARNING: handle_nullreq: " - "input handle has unexpected length %d\n", + "input handle has unexpected length %zu\n", in_handle.length); goto out_err; }