git: 7a606eb844e3 - 2023Q1 - sysutils/e2fsprogs: bugfix update to 1.46.6

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Thu, 02 Feb 2023 23:49:55 UTC
The branch 2023Q1 has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7a606eb844e301ef51a1d209015fbf99dfe2c37d

commit 7a606eb844e301ef51a1d209015fbf99dfe2c37d
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2023-02-02 23:25:53 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2023-02-02 23:49:52 +0000

    sysutils/e2fsprogs: bugfix update to 1.46.6
    
    ChangeLog: https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.46.6
    
    Add patch to make m_offset reliable. Due to some race conditions on the
    pipeline between FreeBSD's yes a, which emits 8190-long writes on
    13-STABLE, and GNU dd (gdd), which it pipes its output into, gdd can
    sometimes receive short reads occasionally, and because the count=
    normally is the number of read(2) calls dispatched, this then leads to a
    shorter reference "file system" that we crcsum, and that causes false
    negative test results.  gdd warns that iflag=fullblock would avoid
    effects of short reads, but this warning is discarded in the test
    script.  Anyways, patch m_offset to use dd's and gdd's iflag=fullblock,
    which causes (g)dd to call read(2) again until the block is full for
    each nominal block, so we definitely read the desired output size 512 kB
    no matter what shorter blocks might travel through the pipeline.
    
    MFH:            2023Q1
    (cherry picked from commit 594ba3e582e75df1ad69e7b039dadb16e164e843)
---
 misc/e2fsprogs-libblkid/Makefile                   |  2 +-
 misc/e2fsprogs-libuuid/Makefile                    |  2 +-
 sysutils/e2fsprogs-core/Makefile                   |  4 +-
 sysutils/e2fsprogs-core/distinfo                   |  6 +--
 sysutils/e2fsprogs-core/files/patch-CVE-2022-1304  | 57 ----------------------
 sysutils/e2fsprogs-core/files/patch-ZZZ-g8535250a  | 26 ----------
 .../files/patch-tests_m__offset_script             | 11 +++++
 sysutils/e2fsprogs-core/pkg-plist                  |  1 +
 sysutils/e2fsprogs/Makefile                        |  4 +-
 9 files changed, 21 insertions(+), 92 deletions(-)

diff --git a/misc/e2fsprogs-libblkid/Makefile b/misc/e2fsprogs-libblkid/Makefile
index 40e8a7e25a15..2d50de7e985e 100644
--- a/misc/e2fsprogs-libblkid/Makefile
+++ b/misc/e2fsprogs-libblkid/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION=	2
+PORTREVISION=	0
 CATEGORIES=	misc devel
 PKGNAMESUFFIX=	-libblkid
 
diff --git a/misc/e2fsprogs-libuuid/Makefile b/misc/e2fsprogs-libuuid/Makefile
index 98e76cf896a3..129c636e3acb 100644
--- a/misc/e2fsprogs-libuuid/Makefile
+++ b/misc/e2fsprogs-libuuid/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION=	1
+PORTREVISION=	0
 CATEGORIES=	misc devel
 PKGNAMESUFFIX=	-libuuid
 
diff --git a/sysutils/e2fsprogs-core/Makefile b/sysutils/e2fsprogs-core/Makefile
index 484310867d13..16957df9fc08 100644
--- a/sysutils/e2fsprogs-core/Makefile
+++ b/sysutils/e2fsprogs-core/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	e2fsprogs
-PORTVERSION=	1.46.5
-PORTREVISION?=	5
+PORTVERSION=	1.46.6
+PORTREVISION?=	0
 CATEGORIES?=	sysutils
 MASTER_SITES=	KERNEL_ORG/linux/kernel/people/tytso/${PORTNAME}/v${PORTVERSION}
 
diff --git a/sysutils/e2fsprogs-core/distinfo b/sysutils/e2fsprogs-core/distinfo
index 0f7dd34cc74b..cf4610cb1968 100644
--- a/sysutils/e2fsprogs-core/distinfo
+++ b/sysutils/e2fsprogs-core/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1643233594
-SHA256 (e2fsprogs-1.46.5.tar.xz) = 2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e
-SIZE (e2fsprogs-1.46.5.tar.xz) = 7040672
+TIMESTAMP = 1675376753
+SHA256 (e2fsprogs-1.46.6.tar.xz) = a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
+SIZE (e2fsprogs-1.46.6.tar.xz) = 7051160
diff --git a/sysutils/e2fsprogs-core/files/patch-CVE-2022-1304 b/sysutils/e2fsprogs-core/files/patch-CVE-2022-1304
deleted file mode 100644
index dec6e97b76be..000000000000
--- a/sysutils/e2fsprogs-core/files/patch-CVE-2022-1304
+++ /dev/null
@@ -1,57 +0,0 @@
-From:   Lukas Czerner <lczerner@redhat.com>
-To:     linux-ext4@vger.kernel.org
-Cc:     tytso@mit.edu, Nils Bars <nils_bars@t-online.de>
-Subject: [PATCH] e2fsprogs: add sanity check to extent manipulation
-Date:   Thu, 21 Apr 2022 19:31:48 +0200
-Message-Id: <20220421173148.20193-1-lczerner@redhat.com>
-List-ID: <linux-ext4.vger.kernel.org>
-X-Mailing-List: linux-ext4@vger.kernel.org
-
-It is possible to have a corrupted extent tree in such a way that a leaf
-node contains zero extents in it. Currently if that happens and we try
-to traverse the tree we can end up accessing wrong data, or possibly
-even uninitialized memory. Make sure we don't do that.
-
-Additionally make sure that we have a sane number of bytes passed to
-memmove() in ext2fs_extent_delete().
-
-Note that e2fsck is currently unable to spot and fix such corruption in
-pass1.
-
-Signed-off-by: Lukas Czerner <lczerner@redhat.com>
-Reported-by: Nils Bars <nils_bars@t-online.de>
-Addressess: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
----
- lib/ext2fs/extent.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
-index b324c7b0..1a206a16 100644
---- ./lib/ext2fs/extent.c
-+++ b/lib/ext2fs/extent.c
-@@ -495,6 +495,10 @@ retry:
- 			ext2fs_le16_to_cpu(eh->eh_entries);
- 		newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
- 
-+		/* Make sure there is at least one extent present */
-+		if (newpath->left <= 0)
-+			return EXT2_ET_EXTENT_NO_DOWN;
-+
- 		if (path->left > 0) {
- 			ix++;
- 			newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
-@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags)
- 
- 	cp = path->curr;
- 
-+	/* Sanity check before memmove() */
-+	if (path->left < 0)
-+		return EXT2_ET_EXTENT_LEAF_BAD;
-+
- 	if (path->left) {
- 		memmove(cp, cp + sizeof(struct ext3_extent_idx),
- 			path->left * sizeof(struct ext3_extent_idx));
--- 
-2.35.1
-
-
diff --git a/sysutils/e2fsprogs-core/files/patch-ZZZ-g8535250a b/sysutils/e2fsprogs-core/files/patch-ZZZ-g8535250a
deleted file mode 100644
index 72820e4b67e6..000000000000
--- a/sysutils/e2fsprogs-core/files/patch-ZZZ-g8535250a
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 8535250a8eeeb441cf466124cc420724935022eb
-Author: Theodore Ts'o <tytso@mit.edu>
-Date:   Mon Jan 3 22:45:37 2022 -0500
-
-    tests: support older versions of timeout in r_corrupt_fs
-    
-    Older versions of the timeout program in coreutils don't support the
-    -v option.  (This is apparently still in use in the GNU/FreeBSD Debain
-    port since coreutils hasn't built successfully since Coreutils version
-    8.28.)
-    
-    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-
-diff --git a/tests/r_corrupt_fs/script b/tests/r_corrupt_fs/script
-index 08af91ed..f6d3a89d 100644
---- ./tests/r_corrupt_fs/script
-+++ b/tests/r_corrupt_fs/script
-@@ -17,7 +17,7 @@ $MKE2FS -q -F -t ext4 -o Linux -b 1024 $TMPFILE 32M >> $OUT.new 2>&1
- echo debugfs -w -R \"set_bg 1 free_blocks_count 65536\" /tmp/foo.img >> $OUT.new
- $DEBUGFS -w -R "set_bg 1 free_blocks_count 65536" $TMPFILE > /dev/null 2>&1
- 
--if type timeout > /dev/null 2>&1 ; then
-+if timeout -v 1s true > /dev/null 2>&1 ; then
-    TIMEOUT="timeout -v 30s"
- else
-    TIMEOUT=
diff --git a/sysutils/e2fsprogs-core/files/patch-tests_m__offset_script b/sysutils/e2fsprogs-core/files/patch-tests_m__offset_script
new file mode 100644
index 000000000000..9cc4232eec3a
--- /dev/null
+++ b/sysutils/e2fsprogs-core/files/patch-tests_m__offset_script
@@ -0,0 +1,11 @@
+--- tests/m_offset/script.orig	2023-02-02 15:57:32 UTC
++++ tests/m_offset/script
+@@ -13,7 +13,7 @@ $MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" 1024 >>
+ # compute crc of the first and last 512 1k blocks
+ crc_first2=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`
+ crc_last2=`$DD if="$TMPFILE" bs=1k count=512 skip=1536 2>/dev/null | $CRCSUM`
+-crc_exp=`yes a | $DD bs=1k count=512 2>/dev/null | $CRCSUM`
++crc_exp=`yes a | $DD bs=1k count=512 iflag=fullblock 2>/dev/null | $CRCSUM`
+ # a warning should be only emitted by the first mke2fs call
+ warning=`grep -c "offset specified without an explicit file system size." \
+ 	"$OUT"`
diff --git a/sysutils/e2fsprogs-core/pkg-plist b/sysutils/e2fsprogs-core/pkg-plist
index 2a9455717727..c2ca3765b12b 100644
--- a/sysutils/e2fsprogs-core/pkg-plist
+++ b/sysutils/e2fsprogs-core/pkg-plist
@@ -108,6 +108,7 @@ sbin/tune2fs
 %%NLS%%share/locale/es/LC_MESSAGES/e2fsprogs.mo
 %%NLS%%share/locale/fi/LC_MESSAGES/e2fsprogs.mo
 %%NLS%%share/locale/fr/LC_MESSAGES/e2fsprogs.mo
+%%NLS%%share/locale/fur/LC_MESSAGES/e2fsprogs.mo
 %%NLS%%share/locale/hu/LC_MESSAGES/e2fsprogs.mo
 %%NLS%%share/locale/id/LC_MESSAGES/e2fsprogs.mo
 %%NLS%%share/locale/it/LC_MESSAGES/e2fsprogs.mo
diff --git a/sysutils/e2fsprogs/Makefile b/sysutils/e2fsprogs/Makefile
index a59f478893cd..7b30953515d3 100644
--- a/sysutils/e2fsprogs/Makefile
+++ b/sysutils/e2fsprogs/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	e2fsprogs
 CATEGORIES=	sysutils
-PORTVERSION=	1.46.5
-PORTREVISION=	5
+PORTVERSION=	1.46.6
+PORTREVISION=	0
 BUILD_DEPENDS=	e2fsprogs-core>=${PORTVERSION}:sysutils/e2fsprogs-core
 RUN_DEPENDS=	${BUILD_DEPENDS}
 DISTFILES=	# empty