#include <sys/param.h>
#include <sys/stat.h>
+#include <inttypes.h>
#include <pwd.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
#include "svcgssd.h"
#include "gss_util.h"
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)
}
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;
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) {
} 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;
}
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));
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;
}