From f0295863c40b11dc01fc0011afc3de9957005671 Mon Sep 17 00:00:00 2001 From: tangyuchen Date: Mon, 17 Apr 2023 15:33:08 +0800 Subject: [PATCH] Backport a patch that improves error handling in POSIX ACL conversions Signed-off-by: tangyuchen --- ...e-error-handling-in-POSIX-ACL-conver.patch | 43 +++++++++++++++++++ e2fsprogs.spec | 6 ++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0054-libext2fs-improve-error-handling-in-POSIX-ACL-conver.patch diff --git a/0054-libext2fs-improve-error-handling-in-POSIX-ACL-conver.patch b/0054-libext2fs-improve-error-handling-in-POSIX-ACL-conver.patch new file mode 100644 index 0000000..dfe7a68 --- /dev/null +++ b/0054-libext2fs-improve-error-handling-in-POSIX-ACL-conver.patch @@ -0,0 +1,43 @@ +From ea30eb29bac9b8ed7adca43024232069e1da0103 Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Fri, 28 May 2021 22:14:04 -0500 +Subject: [PATCH] libext2fs: improve error handling in POSIX ACL conversions + +When encoding a POSIX ACL to the EXT4 ACL format, if an unknown tag +is encountered, that entry is silently ignored. It would be better +to return an error to inform the user that the ACL is incompatible. + +Also fix the mismatched indentation in the opposite function. + +Signed-off-by: Samuel Holland + +diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c +index 8a7a17c..b882170 100644 +--- a/lib/ext2fs/ext_attr.c ++++ b/lib/ext2fs/ext_attr.c +@@ -572,6 +572,8 @@ static errcode_t convert_posix_acl_to_disk_buffer(const void *value, size_t size + e += sizeof(ext4_acl_entry); + s += sizeof(ext4_acl_entry); + break; ++ default: ++ return EINVAL; + } + } + *size_out = s; +@@ -625,10 +627,9 @@ static errcode_t convert_disk_buffer_to_posix_acl(const void *value, size_t size + cp += sizeof(ext4_acl_entry); + size -= sizeof(ext4_acl_entry); + break; +- default: +- ext2fs_free_mem(&out); +- return EINVAL; +- break; ++ default: ++ ext2fs_free_mem(&out); ++ return EINVAL; + } + entry++; + } +-- +2.33.0 + diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 2d496b0..aac77bc 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,6 +1,6 @@ Name: e2fsprogs Version: 1.45.6 -Release: 18 +Release: 19 Summary: Second extended file system management tools License: GPLv2 and LGPLv2 and GPLv2+ URL: http://e2fsprogs.sourceforge.net/ @@ -60,6 +60,7 @@ Patch50: 0050-mmp-fix-wrong-comparison-in-ext2fs_mmp_stop.patch Patch51: 0051-misc-fsck.c-Processes-may-kill-other-processes.patch Patch52: 0052-append_pathname-check-the-value-returned-by-realloc.patch Patch53: 0053-argv_parse-check-return-value-of-malloc-in-argv_pars.patch +Patch54: 0054-libext2fs-improve-error-handling-in-POSIX-ACL-conver.patch BuildRequires: gcc pkgconfig texinfo BuildRequires: fuse-devel libblkid-devel libuuid-devel @@ -181,6 +182,9 @@ exit 0 %{_mandir}/man8/* %changelog +* Mon Apr 17 tangyuchen - 1.45.6-19 +- backport 1 patch, improving error-handling in POSIX-ACL + * Fri Apr 14 tangyuchen - 1.45.6-18 - backport 2 patches -- Gitee