forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/coolsnowwolf/lede: tools/patch: apply patch for EACCES on xattr copy (coolsnowwolf#10469)
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tools/patch/patches/070-don-t-fail-hard-on-EACCES-when-copying-xattrs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From f42cbe1a91a3a6f79d1eec594ce7c72aec79179b Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <[email protected]> | ||
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) | ||
{ |