Files
openwrt-armor-g5/tools/patch/patches/070-don-t-fail-hard-on-EACCES-when-copying-xattrs.patch
domenico 27c9d80f51
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Initial commit
2025-06-24 12:51:15 +02:00

34 lines
1.1 KiB
Diff

From f42cbe1a91a3a6f79d1eec594ce7c72aec79179b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Wed, 9 Nov 2022 05:08:22 +0100
Subject: [PATCH] don't fail hard on EACCES when copying xattrs
On btrfs the xattr "btrfs.compressed" requires privileges to set,
otherwise EACCES is returned.
When patch tries to do copy this attribute it receives the error and
aborts.
---
src/util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/src/util.c
+++ b/src/util.c
@@ -182,7 +182,7 @@ copy_attr_error (struct error_context *c
int err = errno;
va_list ap;
- if (err != ENOSYS && err != ENOTSUP && err != EPERM)
+ if (err != ENOSYS && err != ENOTSUP && err != EPERM && err != EACCES)
{
/* use verror module to print error message */
va_start (ap, fmt);
@@ -284,7 +284,7 @@ set_file_attributes (char const *to, enu
}
if (attr & FA_XATTRS)
if (copy_attr (from, to) != 0
- && errno != ENOSYS && errno != ENOTSUP && errno != EPERM)
+ && errno != ENOSYS && errno != ENOTSUP && errno != EPERM && errno != EACCES)
fatal_exit (0);
if (attr & FA_MODE)
{