-
Notifications
You must be signed in to change notification settings - Fork 262
add support for unpacking layers with xattrs set on FreeBSD #2170
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
add support for unpacking layers with xattrs set on FreeBSD #2170
Conversation
@dfr PTAL |
9e03882
to
6f059fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A drive-by comment without really reading or understanding the code:
Could this be done without the run-time string comparison of GOOS
(for every file)? That seems rather expensive, and it is not the idiomatic Go way.
I’d expect this to rely on Go build tags — maybe to have the setPlatformSpecificXattr
function have a Linux/FreeBSD/unsupported variant; and for that function to both set the attribute and to make the decision whether to ignore the error.
573b448
to
6085ac5
Compare
LGTM - thanks for working on this |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kimminss0, nalind The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally LGTM.
There are other calls to Lsetxattr
; does that matter? At least SetContainersOverrideXattr
seems to be reachable. Maybe that’s not directly related to this PR and shouldn’t block it.
Cc: @giuseppe
6085ac5
to
b08c63f
Compare
This commit introduces wrappers for FreeBSD’s `extattr` system calls, enabling support for extended file attributes. Note that the `extattr` functionality on FreeBSD is analogous to Linux’s `xattr`. Signed-off-by: Minseo Kim <kimminss0@outlook.kr>
…npacking This commit enables applying extended file attributes (xattr) to files during the unpacking of layers. The implementation mimics how FreeBSD's linux compatibility layer and BSD tar handles xattr using extattr system calls. Linux and FreeBSD supports different namespaces for extended attributes: - Linux: security, system, trusted, user - FreeBSD: system, user The `system` and `user` namespaces are directly mapped between the two systems. For unsupported namespaces on FreeBSD, such as `security` and `trusted`, the attributes are just dropped. Signed-off-by: Minseo Kim <kimminss0@outlook.kr>
b08c63f
to
28548e9
Compare
/lgtm |
Closes #2168
This PR implements system call wrappers for
extattr
on FreeBSD, and adds support for unpacking layers with external attributes(xattr
). The implementation mimics how FreeBSD's linux compatibility layer and BSD tar handles xattr using extattr system calls, while both has some limitations that only two of the namespacesuser
andsystem
are supported among the four – the rest,trusted
andsecurity
remain unsupported.