mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +04:00
nfs-kernel-server: update to v2.8.2
Update to latest release and change URL to official upstream mirror. Removed upstreamed patch: 130-musl-svcgssd-sysconf.patch Added new patch to correct host build error as we do not build with gss enabled anyway: 100-fix-host-build.patch Build system: x86/64 Build-tested: bcm27xx/bcm2712 Run-tested: bcm27xx/bcm2712 Signed-off-by: John Audia <therealgraysky@proton.me>
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nfs-kernel-server
|
||||
PKG_VERSION:=2.6.2
|
||||
PKG_RELEASE:=4
|
||||
PKG_HASH:=26d46448982252e9e2c8346d10cf13e1143e7089c866f53e25db3359f3e9493c
|
||||
PKG_VERSION:=2.8.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_HASH:=a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15
|
||||
|
||||
PKG_SOURCE_URL:=@SF/nfs
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/nfs-utils/$(PKG_VERSION)
|
||||
PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.xz
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/nfs-utils-$(PKG_VERSION)
|
||||
@@ -32,9 +32,8 @@ define Package/nfs-kernel-server/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Filesystem
|
||||
DEPENDS:=+libblkid +libuuid +libtirpc
|
||||
DEPENDS:=+libblkid +libuuid +libtirpc +lsqlite3 +libxml2 +libnl
|
||||
URL:=http://nfs.sourceforge.net/
|
||||
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
|
||||
endef
|
||||
|
||||
define Package/nfs-kernel-server
|
||||
@@ -72,7 +71,6 @@ define Package/nfs-utils/Default
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS+= +NFS_KERNEL_SERVER_V4:libkeyutils +NFS_KERNEL_SERVER_V4:libdevmapper
|
||||
URL:=http://nfs.sourceforge.net/
|
||||
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
|
||||
endef
|
||||
|
||||
define Package/nfs-utils
|
||||
@@ -115,7 +113,8 @@ CONFIGURE_ARGS += \
|
||||
--enable-static \
|
||||
--with-rpcgen=internal \
|
||||
$(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv4 \
|
||||
$(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv41
|
||||
$(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv41 \
|
||||
$(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv42
|
||||
|
||||
ifeq ($(CONFIG_IPV6),n)
|
||||
CONFIGURE_ARGS += --disable-ipv6
|
||||
@@ -142,7 +141,10 @@ HOST_CONFIGURE_ARGS += \
|
||||
--disable-gss \
|
||||
--disable-nfsv4 \
|
||||
--disable-nfsv41 \
|
||||
--disable-nfsrahead \
|
||||
--disable-nfsdctl \
|
||||
--without-tcp-wrappers \
|
||||
--disable-junction \
|
||||
--with-rpcgen=internal
|
||||
|
||||
HOST_CONFIGURE_VARS += \
|
||||
@@ -158,6 +160,7 @@ HOST_CONFIGURE_VARS += \
|
||||
ac_cv_func_getrpcbynumber=yes \
|
||||
ac_cv_func_getrpcbynumber_r=yes \
|
||||
enable_ipv6=no \
|
||||
enable_nfsdctl=no \
|
||||
GSSGLUE_CFLAGS=" " \
|
||||
GSSGLUE_LIBS=" " \
|
||||
RPCSECGSS_CFLAGS=" " \
|
||||
|
||||
22
net/nfs-kernel-server/patches/100-fix-host-build.patch
Normal file
22
net/nfs-kernel-server/patches/100-fix-host-build.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -359,9 +359,6 @@ CPPFLAGS="${nfsutils_save_CPPFLAGS}"
|
||||
AC_CHECK_HEADER(uuid/uuid.h, ,
|
||||
AC_MSG_ERROR([Cannot find needed header file uuid/uuid.h. Install libuuid-devel]))
|
||||
|
||||
-dnl check for libevent libraries and headers
|
||||
-AC_LIBEVENT
|
||||
-
|
||||
dnl Check for sqlite3
|
||||
AC_SQLITE3_VERS
|
||||
|
||||
@@ -441,9 +438,6 @@ if test "$enable_gss" = yes; then
|
||||
dnl 'gss' requires getnameinfo - at least for gssd_proc.c
|
||||
AC_CHECK_FUNC([getnameinfo], , [AC_MSG_ERROR([GSSAPI support requires 'getnameinfo' function])])
|
||||
|
||||
- dnl check for libevent libraries and headers
|
||||
- AC_LIBEVENT
|
||||
-
|
||||
dnl Check for Kerberos V5
|
||||
AC_KERBEROS_V5
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
--- a/support/nfsidmap/libnfsidmap.c
|
||||
+++ b/support/nfsidmap/libnfsidmap.c
|
||||
@@ -452,11 +452,17 @@ int nfs4_init_name_mapping(char *conffil
|
||||
|
||||
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);
|
||||
@@ -473,11 +479,17 @@ int nfs4_init_name_mapping(char *conffil
|
||||
|
||||
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) {
|
||||
err = getgrnam_r(nobody_group, buf, ((char *)buf) + sizeof(*buf), buflen, &gr);
|
||||
--- a/support/nfsidmap/static.c
|
||||
+++ b/support/nfsidmap/static.c
|
||||
@@ -98,10 +98,14 @@ static struct passwd *static_getpwnam(co
|
||||
{
|
||||
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,10 +153,14 @@ static struct group *static_getgrnam(con
|
||||
{
|
||||
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) {
|
||||
err = ENOMEM;
|
||||
--- a/support/nfsidmap/nss.c
|
||||
+++ b/support/nfsidmap/nss.c
|
||||
@@ -91,9 +91,13 @@ static int nss_uid_to_name(uid_t uid, ch
|
||||
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,9 +123,13 @@ static int nss_gid_to_name(gid_t gid, ch
|
||||
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();
|
||||
|
||||
@@ -192,12 +200,13 @@ static struct passwd *nss_getpwnam(const
|
||||
{
|
||||
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 = ENOMEM;
|
||||
|
||||
- if (buflen > UINT_MAX)
|
||||
- goto err;
|
||||
+ if (scbuflen > 0)
|
||||
+ buflen = (size_t)scbuflen;
|
||||
|
||||
buf = malloc(sizeof(*buf) + buflen);
|
||||
if (buf == NULL)
|
||||
@@ -301,7 +310,8 @@ static int _nss_name_to_gid(char *name,
|
||||
struct group *gr = NULL;
|
||||
struct group grbuf;
|
||||
char *buf, *domain;
|
||||
- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
+ size_t buflen = 1024;
|
||||
int err = -EINVAL;
|
||||
char *localname = NULL;
|
||||
char *ref_name = NULL;
|
||||
@@ -327,8 +337,8 @@ static int _nss_name_to_gid(char *name,
|
||||
}
|
||||
|
||||
err = -ENOMEM;
|
||||
- if (buflen > UINT_MAX)
|
||||
- goto out_name;
|
||||
+ if (scbuflen > 0)
|
||||
+ buflen = (size_t)scbuflen;
|
||||
|
||||
do {
|
||||
buf = malloc(buflen);
|
||||
@@ -0,0 +1,36 @@
|
||||
From e29f6e549b7c42ebdf181bb079020c736fce1311 Mon Sep 17 00:00:00 2001
|
||||
From: Joshua Kaldon <joshua@kaldon.com>
|
||||
Date: Wed, 15 Jan 2025 04:51:03 -0500
|
||||
Subject: [PATCH] Patch for broken libnfsimapd static and regex plugins.
|
||||
|
||||
It appears that the makefile does not add nfsidmap_common.c in the
|
||||
sources. nfs-utils (1:2.8.2-1.1~0.1) UNRELEASED; urgency=medium .
|
||||
Non-maintainer upload. Fix issue with static and regex plugins
|
||||
missing symbol get_grnam_buflen.
|
||||
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
support/nfsidmap/Makefile.am | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/support/nfsidmap/Makefile.am
|
||||
+++ b/support/nfsidmap/Makefile.am
|
||||
@@ -40,15 +40,15 @@ nsswitch_la_SOURCES = nss.c nfsidmap_com
|
||||
nsswitch_la_LDFLAGS = -module -avoid-version
|
||||
nsswitch_la_LIBADD = ../../support/nfs/libnfsconf.la
|
||||
|
||||
-static_la_SOURCES = static.c
|
||||
+static_la_SOURCES = static.c nfsidmap_common.c
|
||||
static_la_LDFLAGS = -module -avoid-version
|
||||
static_la_LIBADD = ../../support/nfs/libnfsconf.la
|
||||
|
||||
-regex_la_SOURCES = regex.c
|
||||
+regex_la_SOURCES = regex.c nfsidmap_common.c
|
||||
regex_la_LDFLAGS = -module -avoid-version
|
||||
regex_la_LIBADD = ../../support/nfs/libnfsconf.la
|
||||
|
||||
-umich_ldap_la_SOURCES = umich_ldap.c
|
||||
+umich_ldap_la_SOURCES = umich_ldap.c nfsidmap_common.c
|
||||
umich_ldap_la_LDFLAGS = -module -avoid-version
|
||||
umich_ldap_la_LIBADD = -lldap $(KRB5_GSS_LIB) ../../support/nfs/libnfsconf.la
|
||||
|
||||
Reference in New Issue
Block a user