From bb3c72b76cf14e557720e4bc8a77ec6be5e7bbb1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 16 Jul 2020 20:19:23 +0200 Subject: [PATCH] Revert "- nfs-utils: bump version to 2.4.3" This reverts commit 63b2e6949533df7357850512364d86abb0edfc79. --- make/target-tools.mk | 14 ++-- .../0001-nfs-utils-print-time-in-64-bit.patch | 84 ------------------- ...nfs-utils_01-Patch-taken-from-Gentoo.patch | 60 +++++++++++++ ...tch-legacy-index-in-favour-of-strchr.patch | 72 ++++++++++++++++ ...e-script-find-getrpcbynumber-in-libt.patch | 46 ++++++++++ ...ntd-Add-check-for-struct-file_handle.patch | 46 ++++++++++ ...-notify-use-sbin-instead-of-usr-sbin.patch | 35 ++++++++ 7 files changed, 268 insertions(+), 89 deletions(-) delete mode 100644 patches/nfs-utils/0001-nfs-utils-print-time-in-64-bit.patch create mode 100644 patches/nfs-utils_01-Patch-taken-from-Gentoo.patch create mode 100644 patches/nfs-utils_02-Switch-legacy-index-in-favour-of-strchr.patch create mode 100644 patches/nfs-utils_03-Let-the-configure-script-find-getrpcbynumber-in-libt.patch create mode 100644 patches/nfs-utils_04-mountd-Add-check-for-struct-file_handle.patch create mode 100644 patches/nfs-utils_05-sm-notify-use-sbin-instead-of-usr-sbin.patch diff --git a/make/target-tools.mk b/make/target-tools.mk index fde28b8e..ce7488e3 100644 --- a/make/target-tools.mk +++ b/make/target-tools.mk @@ -1360,7 +1360,7 @@ dosfstools: $(ARCHIVE)/$(DOSFSTOOLS_SOURCE) | $(TARGET_DIR) # ----------------------------------------------------------------------------- -NFS-UTILS_VER = 2.4.3 +NFS-UTILS_VER = 2.2.1 NFS-UTILS_TMP = nfs-utils-$(NFS-UTILS_VER) NFS-UTILS_SOURCE = nfs-utils-$(NFS-UTILS_VER).tar.bz2 NFS-UTILS_SITE = https://sourceforge.net/projects/nfs/files/nfs-utils/$(NFS-UTILS_VER) @@ -1368,7 +1368,11 @@ NFS-UTILS_SITE = https://sourceforge.net/projects/nfs/files/nfs-utils/$(NFS-UT $(ARCHIVE)/$(NFS-UTILS_SOURCE): $(DOWNLOAD) $(NFS-UTILS_SITE)/$(NFS-UTILS_SOURCE) -NFS-UTILS_PATCH = 0001-nfs-utils-print-time-in-64-bit.patch +NFS-UTILS_PATCH = nfs-utils_01-Patch-taken-from-Gentoo.patch +NFS-UTILS_PATCH += nfs-utils_02-Switch-legacy-index-in-favour-of-strchr.patch +NFS-UTILS_PATCH += nfs-utils_03-Let-the-configure-script-find-getrpcbynumber-in-libt.patch +NFS-UTILS_PATCH += nfs-utils_04-mountd-Add-check-for-struct-file_handle.patch +NFS-UTILS_PATCH += nfs-utils_05-sm-notify-use-sbin-instead-of-usr-sbin.patch NFS-UTILS_DEPS = rpcbind @@ -1378,7 +1382,7 @@ nfs-utils: $(NFS-UTILS_DEPS) $(ARCHIVE)/$(NFS-UTILS_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(NFS-UTILS_TMP) $(UNTAR)/$(NFS-UTILS_SOURCE) $(CHDIR)/$(NFS-UTILS_TMP); \ - $(call apply_patches, $(addprefix $(@F)/,$(NFS-UTILS_PATCH))); \ + $(call apply_patches, $(NFS-UTILS_PATCH)); \ export knfsd_cv_bsd_signals=no; \ autoreconf -fi; \ $(CONFIGURE) \ @@ -1387,15 +1391,15 @@ nfs-utils: $(NFS-UTILS_DEPS) $(ARCHIVE)/$(NFS-UTILS_SOURCE) | $(TARGET_DIR) --docdir=$(remove-docdir) \ --mandir=$(remove-mandir) \ --enable-maintainer-mode \ - --disable-nfsdcltrack \ --disable-nfsv4 \ --disable-nfsv41 \ --disable-gss \ --disable-uuid \ $(NFS-UTILS_CONF) \ --without-tcp-wrappers \ - --without-systemd \ --with-statedir=/var/lib/nfs \ + --with-rpcgen=internal \ + --without-systemd \ ; \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) diff --git a/patches/nfs-utils/0001-nfs-utils-print-time-in-64-bit.patch b/patches/nfs-utils/0001-nfs-utils-print-time-in-64-bit.patch deleted file mode 100644 index 5cee9898..00000000 --- a/patches/nfs-utils/0001-nfs-utils-print-time-in-64-bit.patch +++ /dev/null @@ -1,84 +0,0 @@ -From cb75ec49c0a92f55b2241eb1cd95a3fdf63f0dac Mon Sep 17 00:00:00 2001 -From: Rosen Penev -Date: Mon, 13 Apr 2020 14:14:45 -0400 -Subject: [PATCH] nfs-utils: print time in 64-bit - -musl 1.2.0 defines time_t as 64-bit, even under 32-bit OSes. - -Fixes -Wformat errors. - -Signed-off-by: Rosen Penev -Signed-off-by: Steve Dickson -Signed-off-by: Giulio Benetti ---- - support/nfs/cacheio.c | 3 ++- - utils/idmapd/idmapd.c | 11 ++++++----- - 2 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c -index 7c4cf373..126c1283 100644 ---- a/support/nfs/cacheio.c -+++ b/support/nfs/cacheio.c -@@ -20,6 +20,7 @@ - #endif - - #include -+#include - #include - #include - #include -@@ -238,7 +239,7 @@ cache_flush(int force) - stb.st_mtime > now) - stb.st_mtime = time(0); - -- sprintf(stime, "%ld\n", stb.st_mtime); -+ sprintf(stime, "%" PRId64 "\n", (int64_t)stb.st_mtime); - for (c=0; cachelist[c]; c++) { - int fd; - sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); -diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c -index c187e7d7..893159f1 100644 ---- a/utils/idmapd/idmapd.c -+++ b/utils/idmapd/idmapd.c -@@ -54,6 +54,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -172,7 +173,7 @@ flush_nfsd_cache(char *path, time_t now) - int fd; - char stime[32]; - -- sprintf(stime, "%ld\n", now); -+ sprintf(stime, "%" PRId64 "\n", (int64_t)now); - fd = open(path, O_RDWR); - if (fd == -1) - return -1; -@@ -625,8 +626,8 @@ nfsdcb(int UNUSED(fd), short which, void *data) - /* Name */ - addfield(&bp, &bsiz, im.im_name); - /* expiry */ -- snprintf(buf1, sizeof(buf1), "%lu", -- time(NULL) + cache_entry_expiration); -+ snprintf(buf1, sizeof(buf1), "%" PRId64, -+ (int64_t)time(NULL) + cache_entry_expiration); - addfield(&bp, &bsiz, buf1); - /* Note that we don't want to write the id if the mapping - * failed; instead, by leaving it off, we write a negative -@@ -653,8 +654,8 @@ nfsdcb(int UNUSED(fd), short which, void *data) - snprintf(buf1, sizeof(buf1), "%u", im.im_id); - addfield(&bp, &bsiz, buf1); - /* expiry */ -- snprintf(buf1, sizeof(buf1), "%lu", -- time(NULL) + cache_entry_expiration); -+ snprintf(buf1, sizeof(buf1), "%" PRId64, -+ (int64_t)time(NULL) + cache_entry_expiration); - addfield(&bp, &bsiz, buf1); - /* Note we're ignoring the status field in this case; we'll - * just map to nobody instead. */ --- -2.20.1 - diff --git a/patches/nfs-utils_01-Patch-taken-from-Gentoo.patch b/patches/nfs-utils_01-Patch-taken-from-Gentoo.patch new file mode 100644 index 00000000..47bf9db4 --- /dev/null +++ b/patches/nfs-utils_01-Patch-taken-from-Gentoo.patch @@ -0,0 +1,60 @@ +From 5796ca01e33596d4102dd714349c908fecc331c0 Mon Sep 17 00:00:00 2001 +From: Gustavo Zacarias +Date: Sat, 10 Nov 2012 18:56:12 +0100 +Subject: [PATCH] Patch taken from Gentoo + +Signed-off-by: Gustavo Zacarias +--- + tools/locktest/Makefile.am | 7 +++---- + tools/rpcgen/Makefile.am | 8 +++----- + 2 files changed, 6 insertions(+), 9 deletions(-) + +diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am +index 3156815..efe6fcd 100644 +--- a/tools/locktest/Makefile.am ++++ b/tools/locktest/Makefile.am +@@ -1,12 +1,11 @@ + ## Process this file with automake to produce Makefile.in + + CC=$(CC_FOR_BUILD) +-LIBTOOL = @LIBTOOL@ --tag=CC ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + + noinst_PROGRAMS = testlk + testlk_SOURCES = testlk.c +-testlk_CFLAGS=$(CFLAGS_FOR_BUILD) +-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) +-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD) + + MAINTAINERCLEANFILES = Makefile.in +diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am +index 8a9ec89..5a5b4d3 100644 +--- a/tools/rpcgen/Makefile.am ++++ b/tools/rpcgen/Makefile.am +@@ -1,7 +1,9 @@ + ## Process this file with automake to produce Makefile.in + + CC=$(CC_FOR_BUILD) +-LIBTOOL = @LIBTOOL@ --tag=CC ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + + noinst_PROGRAMS = rpcgen + rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \ +@@ -9,10 +11,6 @@ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \ + rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \ + rpc_scan.h rpc_util.h + +-rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD) +-rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD) +-rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD) +-rpcgen_LDADD=$(LIBTIRPC) + + MAINTAINERCLEANFILES = Makefile.in + +-- +2.1.0 + diff --git a/patches/nfs-utils_02-Switch-legacy-index-in-favour-of-strchr.patch b/patches/nfs-utils_02-Switch-legacy-index-in-favour-of-strchr.patch new file mode 100644 index 00000000..655d5342 --- /dev/null +++ b/patches/nfs-utils_02-Switch-legacy-index-in-favour-of-strchr.patch @@ -0,0 +1,72 @@ +From a1d45736286939b822fcc7b9c74843f6f90a747e Mon Sep 17 00:00:00 2001 +From: Gustavo Zacarias +Date: Sat, 10 Nov 2012 18:58:15 +0100 +Subject: [PATCH] Switch legacy index() in favour of strchr() Updated for 1.2.6 + from the previous patch by Frederik Pasch. + +Signed-off-by: Gustavo Zacarias +--- + support/nfs/nfs_mntent.c | 6 +++--- + utils/mount/error.c | 2 +- + utils/mountd/fsloc.c | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c +index a2118a2..7496ed6 100644 +--- a/support/nfs/nfs_mntent.c ++++ b/support/nfs/nfs_mntent.c +@@ -9,7 +9,7 @@ + */ + + #include +-#include /* for index */ ++#include /* for strchr */ + #include /* for isdigit */ + #include /* for umask */ + #include /* for ftruncate */ +@@ -172,7 +172,7 @@ nfs_getmntent (mntFILE *mfp) { + return NULL; + + mfp->mntent_lineno++; +- s = index (buf, '\n'); ++ s = strchr (buf, '\n'); + if (s == NULL) { + /* Missing final newline? Otherwise extremely */ + /* long line - assume file was corrupted */ +@@ -180,7 +180,7 @@ nfs_getmntent (mntFILE *mfp) { + fprintf(stderr, _("[mntent]: warning: no final " + "newline at the end of %s\n"), + mfp->mntent_file); +- s = index (buf, 0); ++ s = strchr (buf, 0); + } else { + mfp->mntent_errs = 1; + goto err; +diff --git a/utils/mount/error.c b/utils/mount/error.c +index e06f598..7bd1d27 100644 +--- a/utils/mount/error.c ++++ b/utils/mount/error.c +@@ -62,7 +62,7 @@ static int rpc_strerror(int spos) + char *tmp; + + if (estr) { +- if ((ptr = index(estr, ':'))) ++ if ((ptr = strchr(estr, ':'))) + estr = ++ptr; + + tmp = &errbuf[spos]; +diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c +index bc737d1..ddbe92f 100644 +--- a/utils/mountd/fsloc.c ++++ b/utils/mountd/fsloc.c +@@ -127,7 +127,7 @@ static struct servers *method_list(char *data) + bool v6esc = false; + + xlog(L_NOTICE, "method_list(%s)", data); +- for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++) ++ for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++) + ptr++; + list = malloc(listsize * sizeof(char *)); + copy = strdup(data); +-- +2.1.0 diff --git a/patches/nfs-utils_03-Let-the-configure-script-find-getrpcbynumber-in-libt.patch b/patches/nfs-utils_03-Let-the-configure-script-find-getrpcbynumber-in-libt.patch new file mode 100644 index 00000000..dca44f6d --- /dev/null +++ b/patches/nfs-utils_03-Let-the-configure-script-find-getrpcbynumber-in-libt.patch @@ -0,0 +1,46 @@ +From 87f88b28ac01b6449463f00b660fe7416d7f9a55 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 10 Nov 2012 18:53:03 +0100 +Subject: [PATCH] Let the configure script find getrpcbynumber in libtirpc + +The getrpcbynumber() function may not be available in the C library, +but only in the libtirpc library. Take this into account when checking +for the existence of getrpcbynumber() and getrpcbynumber_r(). + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 8e427e3..6e42c96 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -433,11 +433,23 @@ AC_FUNC_STAT + AC_FUNC_VPRINTF + AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \ + gethostbyaddr gethostbyname gethostname getmntent \ +- getnameinfo getrpcbyname getrpcbynumber getrpcbynumber_r getifaddrs \ ++ getnameinfo getrpcbyname getifaddrs \ + gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \ + ppoll realpath rmdir select socket strcasecmp strchr strdup \ + strerror strrchr strtol strtoul sigprocmask name_to_handle_at]) + ++save_CFLAGS=$CFLAGS ++save_LIBS=$LIBS ++CFLAGS="$CFLAGS $AM_CPPFLAGS" ++LIBS="$LIBS $LIBTIRPC" ++AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r]) ++CFLAGS=$save_CFLAGS ++LIBS=$save_LIBS ++ ++if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then ++ AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available]) ++fi ++ + dnl ************************************************************* + dnl Check for data sizes + dnl ************************************************************* +-- +2.1.0 + diff --git a/patches/nfs-utils_04-mountd-Add-check-for-struct-file_handle.patch b/patches/nfs-utils_04-mountd-Add-check-for-struct-file_handle.patch new file mode 100644 index 00000000..7aca2669 --- /dev/null +++ b/patches/nfs-utils_04-mountd-Add-check-for-struct-file_handle.patch @@ -0,0 +1,46 @@ +From 3c23b3ea7f5069e8fd4d5758704cd968504f1079 Mon Sep 17 00:00:00 2001 +From: Maxime Hadjinlian +Date: Tue, 2 Feb 2016 10:07:22 +0100 +Subject: [PATCH] mountd: Add check for 'struct file_handle' + +The code to check if name_to_handle_at() is implemented generates only a +warning but with some toolchain it doesn't fail to link (the function must be +implemented somewhere). +However the "struct file_handle" type is not available. + +So, this patch adds a check for this struct. + +Signed-off-by: Maxime Hadjinlian +--- + configure.ac | 1 + + utils/mountd/cache.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 25d2ba4..913a86f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -425,6 +425,7 @@ AC_TYPE_PID_T + AC_TYPE_SIZE_T + AC_HEADER_TIME + AC_STRUCT_TM ++AC_CHECK_TYPES([struct file_handle]) + + dnl ************************************************************* + dnl Check for functions +diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c +index 7847446..dc64f6d 100644 +--- a/utils/mountd/cache.c ++++ b/utils/mountd/cache.c +@@ -424,7 +424,7 @@ static int same_path(char *child, char *parent, int len) + if (count_slashes(p) != count_slashes(parent)) + return 0; + +-#if HAVE_NAME_TO_HANDLE_AT ++#if defined(HAVE_NAME_TO_HANDLE_AT) && defined(HAVE_STRUCT_FILE_HANDLE) + struct { + struct file_handle fh; + unsigned char handle[128]; +-- +2.7.0 + diff --git a/patches/nfs-utils_05-sm-notify-use-sbin-instead-of-usr-sbin.patch b/patches/nfs-utils_05-sm-notify-use-sbin-instead-of-usr-sbin.patch new file mode 100644 index 00000000..b3c5421b --- /dev/null +++ b/patches/nfs-utils_05-sm-notify-use-sbin-instead-of-usr-sbin.patch @@ -0,0 +1,35 @@ +From 117b5e420519c376228766f0fda7dbda5beb980f Mon Sep 17 00:00:00 2001 +Message-Id: <117b5e420519c376228766f0fda7dbda5beb980f.1492181441.git.gandharva@gmx.de> +From: gandharva +Date: Fri, 14 Apr 2017 16:50:27 +0200 +Subject: [PATCH] - sm-notify: use /sbin instead of /usr/sbin + +--- + utils/statd/statd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/utils/statd/statd.c b/utils/statd/statd.c +index 2b7a167..b2a251b 100644 +--- a/utils/statd/statd.c ++++ b/utils/statd/statd.c +@@ -194,7 +194,7 @@ static void run_sm_notify(int outport) + char *av[6]; + int ac = 0; + +- av[ac++] = "/usr/sbin/sm-notify"; ++ av[ac++] = "/sbin/sm-notify"; + if (run_mode & MODE_NODAEMON) + av[ac++] = "-d"; + if (outport) { +@@ -359,7 +359,7 @@ int main (int argc, char **argv) + } + + if (run_mode & MODE_NOTIFY_ONLY) { +- fprintf(stderr, "%s: -N deprecated, consider using /usr/sbin/sm-notify directly\n", ++ fprintf(stderr, "%s: -N deprecated, consider using /sbin/sm-notify directly\n", + name_p); + run_sm_notify(out_port); + } +-- +2.12.2 +