From 3d16f16578cd786d81980309f8ca26a396cbd06c Mon Sep 17 00:00:00 2001
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
Date: Wed, 1 Jan 2020 16:18:42 +0100
Subject: [PATCH] patches/openwrt: tools/e2fsprogs: update to 1.45.4

---
 .../0004-tools-e2fsprogs-update-to-1454.patch | 254 ++++++++++++++++++
 1 file changed, 254 insertions(+)
 create mode 100644 patches/openwrt/backport/0004-tools-e2fsprogs-update-to-1454.patch

diff --git a/patches/openwrt/backport/0004-tools-e2fsprogs-update-to-1454.patch b/patches/openwrt/backport/0004-tools-e2fsprogs-update-to-1454.patch
new file mode 100644
index 000000000..cba0418f5
--- /dev/null
+++ b/patches/openwrt/backport/0004-tools-e2fsprogs-update-to-1454.patch
@@ -0,0 +1,254 @@
+From b7c2747756b659cb53d3a4950fb3640b28ff8b3c Mon Sep 17 00:00:00 2001
+From: Daniel Engberg <daniel.engberg.lists@pyret.net>
+Date: Sat, 14 Jul 2018 22:31:37 +0200
+Subject: [PATCH 1/6] tools/e2fsprogs: Update to 1.44.3
+
+Update e2fsprogs to 1.44.3
+
+Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
+---
+ tools/e2fsprogs/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
+index 783b315081..0e12cdd901 100644
+--- a/tools/e2fsprogs/Makefile
++++ b/tools/e2fsprogs/Makefile
+@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=e2fsprogs
+ PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
+-PKG_VERSION:=1.44.2
+-PKG_HASH:=8324cf0b6e81805a741d94087b00e99f7e16144f1ee5a413709a1fa6948b126c
++PKG_VERSION:=1.44.3
++PKG_HASH:=5d899f7d30f481cc0c6a049ebe26ebe145f1b524182ea1ecde4086162d4e4bb6
+ PKG_RELEASE:=1
+ 
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+-- 
+2.24.1
+
+
+From 9e46e27efd35471d623a28115fe3f2ccd14827be Mon Sep 17 00:00:00 2001
+From: Daniel Engberg <daniel.engberg.lists@pyret.net>
+Date: Wed, 29 Aug 2018 09:01:54 +0200
+Subject: [PATCH 2/6] tools/e2fsprogs: Update to 1.44.4
+
+Update e2fsprogs to 1.44.4
+
+Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
+---
+ tools/e2fsprogs/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
+index 0e12cdd901..fec6d83454 100644
+--- a/tools/e2fsprogs/Makefile
++++ b/tools/e2fsprogs/Makefile
+@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=e2fsprogs
+ PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
+-PKG_VERSION:=1.44.3
+-PKG_HASH:=5d899f7d30f481cc0c6a049ebe26ebe145f1b524182ea1ecde4086162d4e4bb6
++PKG_VERSION:=1.44.4
++PKG_HASH:=ee03b2f2180614c5ae5f6dd2666f8808de61c3d8b37d22ba86cc6daea25be55a
+ PKG_RELEASE:=1
+ 
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+-- 
+2.24.1
+
+
+From d1e2f5de0b0e2b314422bd6791feaf0a47a2d618 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@nbd.name>
+Date: Sat, 15 Sep 2018 15:49:31 +0200
+Subject: [PATCH 3/6] tools/e2fsprogs: fix build with clang
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+ tools/e2fsprogs/Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
+index fec6d83454..f11ce52ca0 100644
+--- a/tools/e2fsprogs/Makefile
++++ b/tools/e2fsprogs/Makefile
+@@ -20,6 +20,9 @@ HOST_BUILD_PARALLEL:=1
+ 
+ include $(INCLUDE_DIR)/host-build.mk
+ 
++ifneq ($(shell $(HOSTCC) --version | grep clang),)
++  HOST_CFLAGS += -D__GNUC_PREREQ\(...\)=0
++endif
+ HOST_CFLAGS += $(FPIC)
+ 
+ HOST_CONFIGURE_ARGS += \
+-- 
+2.24.1
+
+
+From 1bf9c37c5cfb7e92d6f43f70eb7e23bede4242d0 Mon Sep 17 00:00:00 2001
+From: Daniel Engberg <daniel.engberg.lists@pyret.net>
+Date: Mon, 24 Dec 2018 11:46:24 +0100
+Subject: [PATCH 4/6] tools/e2fsprogs: Update to 1.44.5
+
+Update e2fsprogs to 1.44.5
+
+Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
+---
+ tools/e2fsprogs/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
+index f11ce52ca0..db93c3beea 100644
+--- a/tools/e2fsprogs/Makefile
++++ b/tools/e2fsprogs/Makefile
+@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=e2fsprogs
+ PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
+-PKG_VERSION:=1.44.4
+-PKG_HASH:=ee03b2f2180614c5ae5f6dd2666f8808de61c3d8b37d22ba86cc6daea25be55a
++PKG_VERSION:=1.44.5
++PKG_HASH:=ba5eb3069d69160d96818bb9700de9ab5a8458d9add1fd85d427c0000d34c5b9
+ PKG_RELEASE:=1
+ 
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+-- 
+2.24.1
+
+
+From f2531b4fc2ca9e0d79762021a204f618b863e146 Mon Sep 17 00:00:00 2001
+From: Daniel Engberg <daniel.engberg.lists@pyret.net>
+Date: Sat, 15 Jun 2019 09:47:21 +0000
+Subject: [PATCH 5/6] tools/e2fsprogs: Update to 1.45.3
+
+Update e2fsprogs to 1.45.3
+Remove OpenBSD patch
+Remove Darwin patch, neither macports or brew patches these files
+Add patch to avoid crond detection on host OS
+
+Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
+---
+ tools/e2fsprogs/Makefile                      |  4 ++--
+ tools/e2fsprogs/patches/003-no-crond.patch    | 11 ++++++++++
+ .../patches/003-openbsd-compat.patch          | 12 ----------
+ .../e2fsprogs/patches/004-darwin-compat.patch | 22 -------------------
+ 4 files changed, 13 insertions(+), 36 deletions(-)
+ create mode 100644 tools/e2fsprogs/patches/003-no-crond.patch
+ delete mode 100644 tools/e2fsprogs/patches/003-openbsd-compat.patch
+ delete mode 100644 tools/e2fsprogs/patches/004-darwin-compat.patch
+
+diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
+index db93c3beea..a4523137ac 100644
+--- a/tools/e2fsprogs/Makefile
++++ b/tools/e2fsprogs/Makefile
+@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=e2fsprogs
+ PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
+-PKG_VERSION:=1.44.5
+-PKG_HASH:=ba5eb3069d69160d96818bb9700de9ab5a8458d9add1fd85d427c0000d34c5b9
++PKG_VERSION:=1.45.3
++PKG_HASH:=90d10066b815e27b0b4875f0d5e396c663e0bf55aa3ca10868978d10c6ffe595
+ PKG_RELEASE:=1
+ 
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+diff --git a/tools/e2fsprogs/patches/003-no-crond.patch b/tools/e2fsprogs/patches/003-no-crond.patch
+new file mode 100644
+index 0000000000..87b50bff2b
+--- /dev/null
++++ b/tools/e2fsprogs/patches/003-no-crond.patch
+@@ -0,0 +1,11 @@
++--- a/configure
+++++ b/configure
++@@ -14525,7 +14525,7 @@ $as_echo_n "checking for system crontab
++ 
++ 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
++ $as_echo "${crond_dir}" >&6; }
++-		have_crond="yes"
+++		have_crond="no"; with_crond_dir=""
++ 
++ else
++ 
+diff --git a/tools/e2fsprogs/patches/003-openbsd-compat.patch b/tools/e2fsprogs/patches/003-openbsd-compat.patch
+deleted file mode 100644
+index 492b8a8860..0000000000
+--- a/tools/e2fsprogs/patches/003-openbsd-compat.patch
++++ /dev/null
+@@ -1,12 +0,0 @@
+---- a/lib/blkid/getsize.c
+-+++ b/lib/blkid/getsize.c
+-@@ -29,6 +29,9 @@
+- #include <fcntl.h>
+- #ifdef HAVE_SYS_IOCTL_H
+- #include <sys/ioctl.h>
+-+#ifdef __OpenBSD__
+-+#include <sys/dkio.h>
+-+#endif
+- #endif
+- #ifdef HAVE_LINUX_FD_H
+- #include <linux/fd.h>
+diff --git a/tools/e2fsprogs/patches/004-darwin-compat.patch b/tools/e2fsprogs/patches/004-darwin-compat.patch
+deleted file mode 100644
+index d84aa121ca..0000000000
+--- a/tools/e2fsprogs/patches/004-darwin-compat.patch
++++ /dev/null
+@@ -1,22 +0,0 @@
+---- a/lib/blkid/blkid_types.h.in
+-+++ b/lib/blkid/blkid_types.h.in
+-@@ -9,6 +9,8 @@
+- 
+- @ASM_TYPES_HEADER@
+- 
+-+#include <stdint.h>
+-+
+- #ifndef HAVE___U8
+- #define HAVE___U8
+- #ifdef __U8_TYPEDEF
+---- a/lib/ext2fs/ext2_types.h.in
+-+++ b/lib/ext2fs/ext2_types.h.in
+-@@ -9,6 +9,8 @@
+- 
+- @ASM_TYPES_HEADER@
+- 
+-+#include <stdint.h>
+-+
+- #ifndef HAVE___U8
+- #define HAVE___U8
+- #ifdef __U8_TYPEDEF
+-- 
+2.24.1
+
+
+From 2b6cac0ec58b70ea7b419c7ae8beef0d201c07a7 Mon Sep 17 00:00:00 2001
+From: Josef Schlehofer <pepe.schlehofer@gmail.com>
+Date: Thu, 3 Oct 2019 21:23:00 +0200
+Subject: [PATCH 6/6] tools/e2fsprogs: Update to version 1.45.4
+
+Fixes CVE-2019-5094
+
+Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
+---
+ tools/e2fsprogs/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
+index a4523137ac..c7ccd4478f 100644
+--- a/tools/e2fsprogs/Makefile
++++ b/tools/e2fsprogs/Makefile
+@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=e2fsprogs
+ PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
+-PKG_VERSION:=1.45.3
+-PKG_HASH:=90d10066b815e27b0b4875f0d5e396c663e0bf55aa3ca10868978d10c6ffe595
++PKG_VERSION:=1.45.4
++PKG_HASH:=65faf6b590ca1da97440d6446bd11de9e0914b42553740ba5d9d2a796fa0dc02
+ PKG_RELEASE:=1
+ 
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+-- 
+2.24.1
+
-- 
GitLab