219 lines
7.5 KiB
Diff
219 lines
7.5 KiB
Diff
--- a/utils/gssd/gssd.c 2024-08-20 14:30:33.000000000 +0200
|
|
+++ b/utils/gssd/gssd.c 2024-09-08 13:01:06.098924979 +0200
|
|
@@ -65,6 +65,7 @@
|
|
#include <dirent.h>
|
|
#include <netdb.h>
|
|
#include <event2/event.h>
|
|
+#include <inttypes.h>
|
|
|
|
#include "gssd.h"
|
|
#include "err_util.h"
|
|
@@ -535,8 +536,8 @@
|
|
* upcall_thread_info from the list and free it.
|
|
*/
|
|
if (tret == PTHREAD_CANCELED)
|
|
- printerr(2, "watchdog: thread id 0x%lx cancelled successfully\n",
|
|
- info->tid);
|
|
+ printerr(2, "watchdog: thread id 0x%" PRIxPTR " cancelled successfully\n",
|
|
+ (uintptr_t)info->tid);
|
|
saveprev = info->list.tqe_prev;
|
|
TAILQ_REMOVE(&active_thread_list, info, list);
|
|
free(info);
|
|
@@ -552,15 +553,15 @@
|
|
*/
|
|
if (now.tv_sec >= info->timeout.tv_sec) {
|
|
if (cancel_timed_out_upcalls && !(info->flags & UPCALL_THREAD_CANCELED)) {
|
|
- printerr(0, "watchdog: thread id 0x%lx timed out\n",
|
|
- info->tid);
|
|
+ printerr(0, "watchdog: thread id 0x%" PRIxPTR " timed out\n",
|
|
+ (uintptr_t)info->tid);
|
|
pthread_cancel(info->tid);
|
|
info->flags |= (UPCALL_THREAD_CANCELED|UPCALL_THREAD_WARNED);
|
|
do_error_downcall(info->fd, info->uid, -ETIMEDOUT);
|
|
} else {
|
|
if (!(info->flags & UPCALL_THREAD_WARNED)) {
|
|
- printerr(0, "watchdog: thread id 0x%lx running for %lld seconds\n",
|
|
- info->tid,
|
|
+ printerr(0, "watchdog: thread id 0x%" PRIxPTR " running for %lld seconds\n",
|
|
+ (uintptr_t)info->tid,
|
|
(long long int)(now.tv_sec - info->timeout.tv_sec + upcall_timeout));
|
|
info->flags |= UPCALL_THREAD_WARNED;
|
|
}
|
|
@@ -580,8 +581,8 @@
|
|
break;
|
|
default:
|
|
/* EDEADLK, EINVAL, and ESRCH... none of which should happen! */
|
|
- printerr(0, "watchdog: attempt to join thread id 0x%lx returned %d (%s)!\n",
|
|
- info->tid, err, strerror(err));
|
|
+ printerr(0, "watchdog: attempt to join thread id 0x%" PRIxPTR " returned %d (%s)!\n",
|
|
+ (uintptr_t)info->tid, err, strerror(err));
|
|
break;
|
|
}
|
|
}
|
|
--- a/utils/gssd/gssd_proc.c 2024-08-20 14:30:33.000000000 +0200
|
|
+++ b/utils/gssd/gssd_proc.c 2024-09-08 13:19:02.841249423 +0200
|
|
@@ -73,6 +73,7 @@
|
|
#ifdef HAVE_TIRPC_GSS_SECCREATE
|
|
#include <rpc/rpcsec_gss.h>
|
|
#endif
|
|
+#include <inttypes.h>
|
|
|
|
#include "gssd.h"
|
|
#include "err_util.h"
|
|
@@ -170,8 +171,8 @@
|
|
pthread_t tid = pthread_self();
|
|
|
|
if (get_verbosity() > 1)
|
|
- printerr(2, "do_downcall(0x%lx): lifetime_rec=%s acceptor=%.*s\n",
|
|
- tid, sec2time(lifetime_rec), (int)acceptor->length, (char *)acceptor->value);
|
|
+ printerr(2, "do_downcall(0x%" PRIxPTR "): lifetime_rec=%s acceptor=%.*s\n",
|
|
+ (uintptr_t)tid, sec2time(lifetime_rec), (int)acceptor->length, (char *)acceptor->value);
|
|
buf_size = sizeof(uid) + sizeof(timeout) + sizeof(pd->pd_seq_win) +
|
|
sizeof(pd->pd_ctx_hndl.length) + pd->pd_ctx_hndl.length +
|
|
sizeof(context_token->length) + context_token->length +
|
|
@@ -197,7 +198,7 @@
|
|
return;
|
|
out_err:
|
|
free(buf);
|
|
- printerr(1, "do_downcall(0x%lx): Failed to write downcall!\n", tid);
|
|
+ printerr(1, "do_downcall(0x%" PRIxPTR "): Failed to write downcall!\n", (uintptr_t)tid);
|
|
return;
|
|
}
|
|
|
|
@@ -210,7 +211,7 @@
|
|
int zero = 0;
|
|
pthread_t tid = pthread_self();
|
|
|
|
- printerr(2, "do_error_downcall(0x%lx): uid %d err %d\n", tid, uid, err);
|
|
+ printerr(2, "do_error_downcall(0x%" PRIxPTR "): uid %d err %d\n", (uintptr_t)tid, uid, err);
|
|
|
|
if (WRITE_BYTES(&p, end, uid)) goto out_err;
|
|
if (WRITE_BYTES(&p, end, timeout)) goto out_err;
|
|
@@ -372,8 +373,8 @@
|
|
|
|
/* create an rpc connection to the nfs server */
|
|
|
|
- printerr(3, "create_auth_rpc_client(0x%lx): creating %s client for server %s\n",
|
|
- tid, clp->protocol, clp->servername);
|
|
+ printerr(3, "create_auth_rpc_client(0x%" PRIxPTR "): creating %s client for server %s\n",
|
|
+ (uintptr_t)tid, clp->protocol, clp->servername);
|
|
|
|
protocol = IPPROTO_TCP;
|
|
if ((strcmp(clp->protocol, "udp")) == 0)
|
|
@@ -416,8 +417,8 @@
|
|
if (!tgtname)
|
|
tgtname = clp->servicename;
|
|
|
|
- printerr(3, "create_auth_rpc_client(0x%lx): creating context with server %s\n",
|
|
- tid, tgtname);
|
|
+ printerr(3, "create_auth_rpc_client(0x%" PRIxPTR "): creating context with server %s\n",
|
|
+ (uintptr_t)tid, tgtname);
|
|
#ifdef HAVE_TIRPC_GSS_SECCREATE
|
|
memset(&req, 0, sizeof(req));
|
|
req.my_cred = sec.cred;
|
|
@@ -553,8 +554,8 @@
|
|
int err, resp = -1;
|
|
pthread_t tid = pthread_self();
|
|
|
|
- printerr(2, "krb5_not_machine_creds(0x%lx): uid %d tgtname %s\n",
|
|
- tid, uid, tgtname);
|
|
+ printerr(2, "krb5_not_machine_creds(0x%" PRIxPTR "): uid %d tgtname %s\n",
|
|
+ (uintptr_t)tid, uid, tgtname);
|
|
|
|
*chg_err = change_identity(uid);
|
|
if (*chg_err) {
|
|
@@ -602,8 +603,8 @@
|
|
int success = 0;
|
|
pthread_t tid = pthread_self();
|
|
|
|
- printerr(2, "krb5_use_machine_creds(0x%lx): uid %d tgtname %s\n",
|
|
- tid, uid, tgtname);
|
|
+ printerr(2, "krb5_use_machine_creds(0x%" PRIxPTR "): uid %d tgtname %s\n",
|
|
+ (uintptr_t)tid, uid, tgtname);
|
|
|
|
do {
|
|
gssd_refresh_krb5_machine_credential(clp->servername,
|
|
@@ -943,8 +944,8 @@
|
|
free(tinfo);
|
|
return ret;
|
|
}
|
|
- printerr(2, "start_upcall_thread(0x%lx): created thread id 0x%lx\n",
|
|
- tid, th);
|
|
+ printerr(2, "start_upcall_thread(0x%" PRIxPTR "): created thread id 0x%" PRIxPTR "\n",
|
|
+ (uintptr_t)tid, (uintptr_t)th);
|
|
|
|
tinfo->tid = th;
|
|
pthread_mutex_lock(&active_thread_list_lock);
|
|
@@ -1008,7 +1009,7 @@
|
|
}
|
|
lbuf[lbuflen-1] = 0;
|
|
|
|
- printerr(2, "\n%s(0x%lx): '%s' (%s)\n", __func__, tid,
|
|
+ printerr(2, "\n%s(0x%" PRIxPTR "): '%s' (%s)\n", __func__, (uintptr_t)tid,
|
|
lbuf, clp->relpath);
|
|
|
|
for (p = strtok(lbuf, " "); p; p = strtok(NULL, " ")) {
|
|
--- a/utils/gssd/krb5_util.c 2024-08-20 14:30:33.000000000 +0200
|
|
+++ b/utils/gssd/krb5_util.c 2024-09-08 13:25:58.884113095 +0200
|
|
@@ -123,6 +123,7 @@
|
|
|
|
#include <sys/types.h>
|
|
#include <fcntl.h>
|
|
+#include <inttypes.h>
|
|
|
|
#include "nfslib.h"
|
|
#include "gssd.h"
|
|
@@ -426,8 +427,8 @@
|
|
now += 300;
|
|
pthread_mutex_lock(&ple_lock);
|
|
if (ple->ccname && ple->endtime > now && !nocache && !force_renew) {
|
|
- printerr(3, "%s(0x%lx): Credentials in CC '%s' are good until %s",
|
|
- __func__, tid, ple->ccname, ctime((time_t *)&ple->endtime));
|
|
+ printerr(3, "%s(0x%" PRIxPTR "): Credentials in CC '%s' are good until %s",
|
|
+ __func__, (uintptr_t)tid, ple->ccname, ctime((time_t *)&ple->endtime));
|
|
code = 0;
|
|
pthread_mutex_unlock(&ple_lock);
|
|
goto out;
|
|
@@ -527,8 +528,8 @@
|
|
}
|
|
|
|
code = 0;
|
|
- printerr(2, "%s(0x%lx): principal '%s' ccache:'%s'\n",
|
|
- __func__, tid, pname, cc_name);
|
|
+ printerr(2, "%s(0x%" PRIxPTR "): principal '%s' ccache:'%s'\n",
|
|
+ __func__, (uintptr_t)tid, pname, cc_name);
|
|
out:
|
|
#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS
|
|
if (init_opts)
|
|
@@ -667,8 +668,8 @@
|
|
/* Get full target hostname */
|
|
retval = getaddrinfo(inhost, NULL, &hints, &addrs);
|
|
if (retval) {
|
|
- printerr(1, "%s(0x%lx): getaddrinfo(%s) failed: %s\n",
|
|
- __func__, tid, inhost, gai_strerror(retval));
|
|
+ printerr(1, "%s(0x%" PRIxPTR "): getaddrinfo(%s) failed: %s\n",
|
|
+ __func__, (uintptr_t)tid, inhost, gai_strerror(retval));
|
|
goto out;
|
|
}
|
|
strncpy(outhost, addrs->ai_canonname, outhostlen);
|
|
@@ -677,8 +678,8 @@
|
|
*c = tolower(*c);
|
|
|
|
if (get_verbosity() && strcmp(inhost, outhost))
|
|
- printerr(1, "%s(0x%0lx): inhost '%s' different than outhost '%s'\n",
|
|
- __func__, tid, inhost, outhost);
|
|
+ printerr(1, "%s(0x%" PRIxPTR "): inhost '%s' different than outhost '%s'\n",
|
|
+ __func__, (uintptr_t)tid, inhost, outhost);
|
|
|
|
retval = 0;
|
|
out:
|
|
@@ -1021,7 +1022,7 @@
|
|
tried_upper = 1;
|
|
}
|
|
} else {
|
|
- printerr(2, "find_keytab_entry(0x%lx): Success getting keytab entry for '%s'\n",tid, spn);
|
|
+ printerr(2, "find_keytab_entry(0x%" PRIxPTR "): Success getting keytab entry for '%s'\n", (uintptr_t)tid, spn);
|
|
retval = 0;
|
|
goto out;
|
|
}
|