Skip to content

Commit f2591c8

Browse files
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/coolsnowwolf/lede: tools/patch: apply patch for EACCES on xattr copy (coolsnowwolf#10469)
2 parents cf6dacf + 9cd6f16 commit f2591c8

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

tools/patch/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
88

99
PKG_NAME:=patch
1010
PKG_VERSION:=2.7.6
11-
PKG_RELEASE:=6
11+
PKG_RELEASE:=7
1212
PKG_CPE_ID:=cpe:/a:gnu:patch
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From f42cbe1a91a3a6f79d1eec594ce7c72aec79179b Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <[email protected]>
3+
Date: Wed, 9 Nov 2022 05:08:22 +0100
4+
Subject: [PATCH] don't fail hard on EACCES when copying xattrs
5+
6+
On btrfs the xattr "btrfs.compressed" requires privileges to set,
7+
otherwise EACCES is returned.
8+
When patch tries to do copy this attribute it receives the error and
9+
aborts.
10+
---
11+
src/util.c | 4 ++--
12+
1 file changed, 2 insertions(+), 2 deletions(-)
13+
14+
--- a/src/util.c
15+
+++ b/src/util.c
16+
@@ -182,7 +182,7 @@ copy_attr_error (struct error_context *c
17+
int err = errno;
18+
va_list ap;
19+
20+
- if (err != ENOSYS && err != ENOTSUP && err != EPERM)
21+
+ if (err != ENOSYS && err != ENOTSUP && err != EPERM && err != EACCES)
22+
{
23+
/* use verror module to print error message */
24+
va_start (ap, fmt);
25+
@@ -284,7 +284,7 @@ set_file_attributes (char const *to, enu
26+
}
27+
if (attr & FA_XATTRS)
28+
if (copy_attr (from, to) != 0
29+
- && errno != ENOSYS && errno != ENOTSUP && errno != EPERM)
30+
+ && errno != ENOSYS && errno != ENOTSUP && errno != EPERM && errno != EACCES)
31+
fatal_exit (0);
32+
if (attr & FA_MODE)
33+
{

0 commit comments

Comments
 (0)