Repository navigation
uucore/fsxattr: continue applying xattrs after an unsupported one - #16052
lunatic1hero wants to merge 2 commits into
Conversation
Merging this PR will not alter performance1 warning, 1 note
Comparing Footnotes
|
| match apply_xattrs_fd(dest, xattrs) { | ||
| Err(e) if is_xattr_unsupported(&e) => Ok(()), | ||
| res => res, | ||
| use xattr::FileExt; |
There was a problem hiding this comment.
please add a test, a unit test here is enough:
an unknown namespace like foo.x gets EOPNOTSUPP from the kernel, so apply it with a few user.* and check those are set
| match apply_xattrs_fd(dest, xattrs) { | ||
| Err(e) if is_xattr_unsupported(&e) => Ok(()), | ||
| res => res, | ||
| use xattr::FileExt; |
There was a problem hiding this comment.
the doc comment above still says it maps ENOTSUP to Ok(()), please update it to say it skips the unsupported attributes
| for (attr, value) in xattrs { | ||
| match dest.set_xattr(&attr, &value) { | ||
| Err(e) if is_xattr_unsupported(&e) => {} | ||
| res => res?, |
There was a problem hiding this comment.
res => res? reads a bit odd, Err(e) => return Err(e), Ok(()) => {} is clearer, no?
|
Will do it for sure pc under repair, iam new to opensrc any suggestions?
…On Fri, 30 Oct, 2026, 11:21 pm Sylvestre Ledru, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/uucore/src/lib/features/fsxattr.rs
<#16052 (comment)>:
> @@ -241,10 +241,14 @@ pub fn apply_xattrs_fd_ignore_unsupported(
dest: &std::fs::File,
xattrs: FxHashMap<OsString, Vec<u8>>,
) -> std::io::Result<()> {
- match apply_xattrs_fd(dest, xattrs) {
- Err(e) if is_xattr_unsupported(&e) => Ok(()),
- res => res,
+ use xattr::FileExt;
+ for (attr, value) in xattrs {
+ match dest.set_xattr(&attr, &value) {
+ Err(e) if is_xattr_unsupported(&e) => {}
+ res => res?,
res => res? reads a bit odd, Err(e) => return Err(e), Ok(()) => {} is
clearer, no?
—
Reply to this email directly, view it on GitHub
<#16052?email_source=notifications&email_token=BAIPFEZI3SHEDPA4IU7PABT5WTIK3A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNZRGYZTSMRVGU3KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5716392556>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAIPFE6TDS4UPDSN5H7WZT35WTIK3AVCNFSNUABEKJSXA33TNF2G64TZHMYTCOBUG42TAMB3JFZXG5LFHM3DCMJWGA4TSMZRGGQXMAQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…dual unsupported attributes
75b6d6c to
96a97c4
Compare
|
thanks for this PR! |
sorry for the delay, had made the required changes before only, but was facing issues writing the test , as this is my first contribution, open for suggestions. |
Fixes #15814
apply_xattrs_fd_ignore_unsupported() stopped at the first xattr the
destination refused with ENOTSUP and returned Ok(()). In a cross-device
directory move, this meant system.posix_acl_access was never applied
if a user.* attribute was tried first, so the ACL was silently dropped.
This changes the helper to iterate the attributes, skip only the
unsupported ones, and still return the first other error.
I used an AI assistant for guidance on the contribution workflow; I
applied and reviewed the change myself.