nfs-utils: update to 2.7.1

This commit is contained in:
Mateusz Sylwestrzak 2024-09-02 15:44:43 +02:00 committed by classabbyamp
parent c0bc3b40e2
commit 19297a1064
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
4 changed files with 261 additions and 26 deletions

View File

@ -0,0 +1,218 @@
--- 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;
}

View File

@ -1,22 +0,0 @@
diff -ur a/support/reexport/fsidd.c b/support/reexport/fsidd.c
--- a/support/reexport/fsidd.c 2023-11-21 09:11:42.660255810 -0500
+++ b/support/reexport/fsidd.c 2023-11-21 09:12:36.536375957 -0500
@@ -7,6 +7,7 @@
#include <dlfcn.h>
#endif
#include <event2/event.h>
+#include <unistd.h>
#include "conffile.h"
#include "reexport_backend.h"
diff -ur a/support/reexport/reexport.c b/support/reexport/reexport.c
--- a/support/reexport/reexport.c 2023-11-21 09:11:42.660255810 -0500
+++ b/support/reexport/reexport.c 2023-11-21 09:12:13.654324929 -0500
@@ -8,6 +8,7 @@
#include <sys/types.h>
#include <sys/vfs.h>
#include <errno.h>
+#include <unistd.h>
#include "nfsd_path.h"
#include "conffile.h"

View File

@ -0,0 +1,38 @@
diff --git a/support/junction/path.c b/support/junction/path.c
index 13a14386..dd0f59a0 100644
--- a/support/junction/path.c
+++ b/support/junction/path.c
@@ -23,6 +23,12 @@
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
+/* For musl */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <limits.h>
+
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/support/include/junction.h b/support/include/junction.h
index 7257d80b..d127dd55 100644
--- a/support/include/junction.h
+++ b/support/include/junction.h
@@ -26,6 +26,16 @@
#ifndef _NFS_JUNCTION_H_
#define _NFS_JUNCTION_H_
+/* For musl, refered to glibc's sys/cdefs.h */
+#ifndef __attribute_malloc__
+#define __attribute_malloc__ __attribute__((__malloc__))
+#endif
+
+/* For musl, refered to glibc's sys/stat.h */
+#ifndef ALLPERMS
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
+#endif
+
#include <stdint.h>
/*

View File

@ -1,25 +1,26 @@
# Template file for 'nfs-utils'
pkgname=nfs-utils
version=2.6.4
version=2.7.1
revision=1
build_style=gnu-configure
configure_args="--with-statduser=nobody --enable-gss --enable-nfsv4
--with-statedir=/var/lib/nfs --enable-libmount-mount --enable-svcgss
--enable-uuid --enable-ipv6 --without-tcp-wrappers
--with-tirpcinclude=$XBPS_CROSS_BASE/usr/include/tirpc
--with-krb5=$XBPS_CROSS_BASE --disable-static"
--with-krb5=$XBPS_CROSS_BASE --disable-static --enable-junction"
short_desc="Network File System utilities"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.linux-nfs.org/"
distfiles="${KERNEL_SITE}/utils/${pkgname}/${version}/${pkgname}-${version}.tar.xz"
checksum=01b3b0fb9c7d0bbabf5114c736542030748c788ec2fd9734744201e9b0a1119d
checksum=885c948a84a58bca4148f459588f9a7369dbb40dcc466f04e455c6b10fd0aa48
replaces="rpcgen>=0"
hostmakedepends="pkg-config libtirpc-devel rpcsvc-proto mit-krb5-devel"
makedepends="libblkid-devel libmount-devel libtirpc-devel
keyutils-devel libevent-devel mit-krb5-devel
device-mapper-devel libcap-devel sqlite-devel"
device-mapper-devel libcap-devel sqlite-devel
libxml2-devel"
depends="rpcbind"
python_version=3
conf_files="/etc/exports"