diff --git a/srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch b/srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch deleted file mode 100644 index aab0e9612bf23a..00000000000000 --- a/srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch +++ /dev/null @@ -1,103 +0,0 @@ ---- a/support/nfsidmap/libnfsidmap.c -+++ b/support/nfsidmap/libnfsidmap.c -@@ -430,11 +430,17 @@ - - nobody_user = conf_get_str("Mapping", "Nobody-User"); - if (nobody_user) { -- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ size_t buflen = 1024; /*value on my gentoo glibc system that has _SC_GETPW_R_SIZE_MAX*/ - struct passwd *buf; - struct passwd *pw = NULL; - int err; - -+ /*sysconf can return -1 when _SC_GETPW_R_SIZE_MAX is not defined, like on musl systems, if cast to size_t this will lead -+ to an integer overflow, which leads to a buffer overflow and crashes svcgssd */ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; -+ - buf = malloc(sizeof(*buf) + buflen); - if (buf) { - err = getpwnam_r(nobody_user, buf, ((char *)buf) + sizeof(*buf), buflen, &pw); -@@ -451,10 +457,16 @@ - - nobody_group = conf_get_str("Mapping", "Nobody-Group"); - if (nobody_group) { -- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ size_t buflen = 1024; /*value on my gentoo glibc system that has _SC_GETGR_R_SIZE_MAX*/ - struct group *buf; - struct group *gr = NULL; - int err; -+ -+ /*sysconf can return -1 when _SC_GETGR_R_SIZE_MAX is not defined, like on musl systems, if cast to size_t this will lead -+ to an integer overflow, which leads to a buffer overflow and crashes svcgssd */ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; - - buf = malloc(sizeof(*buf) + buflen); - if (buf) { ---- a/support/nfsidmap/static.c -+++ b/support/nfsidmap/static.c -@@ -98,10 +98,14 @@ - { - struct passwd *pw; - struct pwbuf *buf; -- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ size_t buflen = 1024; - char *localname; - int err; - -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; -+ - buf = malloc(sizeof(*buf) + buflen); - if (!buf) { - err = ENOMEM; -@@ -149,9 +153,13 @@ - { - struct group *gr; - struct grbuf *buf; -- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ size_t buflen = 1024; - char *localgroup; - int err; -+ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; - - buf = malloc(sizeof(*buf) + buflen); - if (!buf) { ---- a/support/nfsidmap/nss.c -+++ b/support/nfsidmap/nss.c -@@ -91,9 +91,13 @@ - struct passwd *pw = NULL; - struct passwd pwbuf; - char *buf; -- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ size_t buflen = 1024; - int err = -ENOMEM; - -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; -+ - buf = malloc(buflen); - if (!buf) - goto out; -@@ -119,8 +123,12 @@ - struct group *gr = NULL; - struct group grbuf; - char *buf; -- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ size_t buflen = 1024; - int err; -+ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; - - if (domain == NULL) - domain = get_default_domain(); diff --git a/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch b/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch deleted file mode 100644 index df4c2db84341de..00000000000000 --- a/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch +++ /dev/null @@ -1,38 +0,0 @@ -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 -+ - #include - #include - -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 - - /* diff --git a/srcpkgs/nfs-utils/template b/srcpkgs/nfs-utils/template index 60da30200b697b..2a393e9cd9d511 100644 --- a/srcpkgs/nfs-utils/template +++ b/srcpkgs/nfs-utils/template @@ -1,6 +1,6 @@ # Template file for 'nfs-utils' pkgname=nfs-utils -version=2.7.1 +version=2.8.2 revision=1 build_style=gnu-configure configure_args="--with-statduser=nobody --enable-gss --enable-nfsv4 @@ -13,14 +13,14 @@ maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://www.linux-nfs.org/" distfiles="${KERNEL_SITE}/utils/${pkgname}/${version}/${pkgname}-${version}.tar.xz" -checksum=885c948a84a58bca4148f459588f9a7369dbb40dcc466f04e455c6b10fd0aa48 +checksum=a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15 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 - libxml2-devel" + libxml2-devel libnl3-devel" depends="rpcbind" python_version=3 conf_files="/etc/exports"