commit:     a1a54c963cdfcf3af6787a109fc5518c1fde14ef
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 12:52:31 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 12:52:31 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1a54c96

net-fs/nfs-utils: rev bump to add some patches

Bug: https://bugs.gentoo.org/688644
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 ...utils-2.4.2-Ensure-consistent-struct-stat.patch | 115 +++++++++++++++++++++
 ...2-mountd-Add-check-for-struct-file_handle.patch |  54 ++++++++++
 ...-mountd-Fix-compilation-for--disable-uuid.patch |  35 +++++++
 ...tils-2.4.2.ebuild => nfs-utils-2.4.2-r1.ebuild} |   3 +
 4 files changed, 207 insertions(+)

diff --git 
a/net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch 
b/net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch
new file mode 100644
index 00000000000..e64e2c6da38
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch
@@ -0,0 +1,115 @@
+From 1378280398ef9f5cd45f5542ae2945b9a360b132 Mon Sep 17 00:00:00 2001
+From: Doug Nazar <naz...@nazar.ca>
+Date: Sun, 17 Nov 2019 14:31:33 -0500
+Subject: [PATCH] Ensure consistent struct stat definition
+
+Although 2fbc62e2a13fc ("Fix include order between config.h and stat.h")
+reorganized those files that were already including config.h, not all
+files were including config.h.
+
+Fixes at least stack smashing crashes in mountd on 32-bit systems.
+
+Signed-off-by: Doug Nazar <naz...@nazar.ca>
+Signed-off-by: Steve Dickson <ste...@redhat.com>
+---
+ support/junction/junction.c | 4 ++++
+ support/misc/file.c         | 4 ++++
+ support/misc/mountpoint.c   | 4 ++++
+ support/nfs/cacheio.c       | 4 ++++
+ utils/mount/fstab.c         | 4 ++++
+ utils/nfsdcld/legacy.c      | 4 ++++
+ 6 files changed, 24 insertions(+)
+
+diff --git a/support/junction/junction.c b/support/junction/junction.c
+index ab6caa6..41cce26 100644
+--- a/support/junction/junction.c
++++ b/support/junction/junction.c
+@@ -23,6 +23,10 @@
+  *    http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ 
+diff --git a/support/misc/file.c b/support/misc/file.c
+index e7c3819..06f6bb2 100644
+--- a/support/misc/file.c
++++ b/support/misc/file.c
+@@ -18,6 +18,10 @@
+  * along with nfs-utils.  If not, see <http://www.gnu.org/licenses/>.
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <sys/stat.h>
+ 
+ #include <string.h>
+diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c
+index c6217f2..14d6731 100644
+--- a/support/misc/mountpoint.c
++++ b/support/misc/mountpoint.c
+@@ -3,6 +3,10 @@
+  * check if a given path is a mountpoint 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <string.h>
+ #include "xcommon.h"
+ #include <sys/stat.h>
+diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
+index 9dc4cf1..7c4cf37 100644
+--- a/support/nfs/cacheio.c
++++ b/support/nfs/cacheio.c
+@@ -15,6 +15,10 @@
+  *
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <nfslib.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c
+index eedbdda..8b0aaf1 100644
+--- a/utils/mount/fstab.c
++++ b/utils/mount/fstab.c
+@@ -7,6 +7,10 @@
+  * - Moved code to nfs-utils/support/nfs from util-linux/mount.
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <errno.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
+index 07f477a..3c6bea6 100644
+--- a/utils/nfsdcld/legacy.c
++++ b/utils/nfsdcld/legacy.c
+@@ -15,6 +15,10 @@
+  * Boston, MA 02110-1301, USA.
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <stdio.h>
+ #include <dirent.h>
+ #include <string.h>
+-- 
+1.8.3.1
+

diff --git 
a/net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Add-check-for-struct-file_handle.patch
 
b/net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Add-check-for-struct-file_handle.patch
new file mode 100644
index 00000000000..2a89cc7665f
--- /dev/null
+++ 
b/net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Add-check-for-struct-file_handle.patch
@@ -0,0 +1,54 @@
+From f100d07d923b5db60d42dc2453485fa0dba69a79 Mon Sep 17 00:00:00 2001
+From: Petr Vorel <petr.vo...@gmail.com>
+Date: Mon, 18 Nov 2019 08:58:36 -0500
+Subject: [PATCH] mountd: Add check for 'struct file_handle'
+
+From: Maxime Hadjinlian <maxime.hadjinl...@gmail.com>
+
+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.
+
+Patch taken from buildroot distribution.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazz...@bootlin.com>
+[ pvorel: rebased from nfs-utils-1-3-4 ]
+Signed-off-by: Petr Vorel <petr.vo...@gmail.com>
+Signed-off-by: Maxime Hadjinlian <maxime.hadjinl...@gmail.com>
+Signed-off-by: Steve Dickson <ste...@redhat.com>
+---
+ configure.ac         | 1 +
+ utils/mountd/cache.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9ba9d4b..949ff9f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -510,6 +510,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 3861f84..31e9507 100644
+--- a/utils/mountd/cache.c
++++ b/utils/mountd/cache.c
+@@ -446,7 +446,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];
+-- 
+1.8.3.1
+

diff --git 
a/net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Fix-compilation-for--disable-uuid.patch
 
b/net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Fix-compilation-for--disable-uuid.patch
new file mode 100644
index 00000000000..3bb9f8b3c9b
--- /dev/null
+++ 
b/net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Fix-compilation-for--disable-uuid.patch
@@ -0,0 +1,35 @@
+From 31bb484b22c220c561f3a95c3b7ca3ea9b96cc9b Mon Sep 17 00:00:00 2001
+From: Petr Vorel <petr.vo...@gmail.com>
+Date: Mon, 18 Nov 2019 11:27:19 -0500
+Subject: [PATCH] mountd: Fix compilation for --disable-uuid
+
+Although code in configure.ac pretends to set USE_BLKID as 0
+via AC_DEFINE_UNQUOTED, it's actually not defined
+support/include/config.h.in
+support/include/config.h
+/* #undef USE_BLKID */
+
+Fixes: 8e643554 ("Allow disabling of libblkid usage.")
+
+Signed-off-by: Petr Vorel <petr.vo...@gmail.com>
+Signed-off-by: Steve Dickson <ste...@redhat.com>
+---
+ utils/mountd/cache.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
+index 31e9507..e5186c7 100644
+--- a/utils/mountd/cache.c
++++ b/utils/mountd/cache.c
+@@ -221,7 +221,7 @@ static void auth_unix_gid(int f)
+               xlog(L_ERROR, "auth_unix_gid: error writing reply");
+ }
+ 
+-#if USE_BLKID
++#ifdef USE_BLKID
+ static const char *get_uuid_blkdev(char *path)
+ {
+       /* We set *safe if we know that we need the
+-- 
+1.8.3.1
+

diff --git a/net-fs/nfs-utils/nfs-utils-2.4.2.ebuild 
b/net-fs/nfs-utils/nfs-utils-2.4.2-r1.ebuild
similarity index 96%
rename from net-fs/nfs-utils/nfs-utils-2.4.2.ebuild
rename to net-fs/nfs-utils/nfs-utils-2.4.2-r1.ebuild
index 4ff3af16fc9..9bfa0765d64 100644
--- a/net-fs/nfs-utils/nfs-utils-2.4.2.ebuild
+++ b/net-fs/nfs-utils/nfs-utils-2.4.2-r1.ebuild
@@ -68,6 +68,9 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.2.8-cross-build.patch
        "${FILESDIR}"/${PN}-2.4.2-no-werror.patch
        "${FILESDIR}"/${PN}-2.4.1-statx.patch #688644
+       "${FILESDIR}"/${P}-Ensure-consistent-struct-stat.patch
+       "${FILESDIR}"/${P}-mountd-Add-check-for-struct-file_handle.patch
+       "${FILESDIR}"/${P}-mountd-Fix-compilation-for--disable-uuid.patch
 )
 
 pkg_setup() {

Reply via email to