Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libstore: return ENOTSUP for getxattr functions #11206

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

tie
Copy link
Member

@tie tie commented Jul 28, 2024

Motivation

This change updates the seccomp profile to return ENOTSUP for getxattr functions family. This reflects the behavior of filesystems that don’t support extended attributes (or have an option to disable them), e.g. ext2.

Context

The current behavior is confusing for some programs because we can read extended attributes, but only get to know that they are not supported when setting them. In addition to that, ACLs on Linux are implemented via extended attributes internally and if we don’t return ENOTSUP, acl library converts file mode to ACL.
https://git.savannah.nongnu.org/cgit/acl.git/tree/libacl/acl_get_file.c?id=d9bb1759d4dad2f28a6dcc8c1742ff75d16dd10d#n69

In practice, this affects programs like xar that support ACLs/EAs as file metadata in archives (see NixOS/nixpkgs#329721, patch 0016-Do-not-set-property-for-empty-ACL.patch in particular).

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This change updates the seccomp profile to return ENOTSUP for getxattr
functions family. This reflects the behavior of filesystems that don’t
support extended attributes (or have an option to disable them), e.g.
ext2.

The current behavior is confusing for some programs because we can read
extended attributes, but only get to know that they are not supported
when setting them. In addition to that, ACLs on Linux are implemented
via extended attributes internally and if we don’t return ENOTSUP, acl
library converts file mode to ACL.
https://git.savannah.nongnu.org/cgit/acl.git/tree/libacl/acl_get_file.c?id=d9bb1759d4dad2f28a6dcc8c1742ff75d16dd10d#n69
@tie tie requested a review from Ericson2314 as a code owner July 28, 2024 10:29
@roberth roberth added the derivation-build The process of building an individual derivation (see also sandbox label) label Jul 28, 2024
@edolstra edolstra merged commit 9e2bed7 into NixOS:master Jul 29, 2024
13 checks passed
@tie tie deleted the getxattr-enotsup branch July 29, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
derivation-build The process of building an individual derivation (see also sandbox label)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants