When copying the buildkit-qemu-emulator binary on systems with SELinux
enabled, the copy operation fails with "operation not supported" errors
when attempting to copy security.selinux xattrs.
This change adds an XAttrErrorHandler to the copy.Copy call that ignores
ENOTSUP errors, allowing the copy to succeed on SELinux-enabled systems.
Fixes#5544🤖 Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Refactor xattr error handler to be a simple function
Changed ignoreSELinuxXAttrErrorHandler from a function that returns
a function to a direct error handler function. This simplifies the
code while maintaining the same functionality.
🤖 Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Add tests for xattr error handling in exec_binfmt
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Update xattr error handling to ignore ENOTSUP for security.selinux only
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Refactor xattr error handling in exec_binfmt to use a single error handler function
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Convert usages of `github.com/docker/docker/pkg/idtools` to
`github.com/moby/sys/user` in order to break the dependency between
buildkit and docker.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Switch to use github.com/containerd/platforms module, because containerd's
platforms package has moved to a separate module. This allows updating the
platforms parsing independent of the containerd module itself.
The package in containerd is deprecated, but kept as an alias to provide
compatibility between codebases.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Trivially created by looking for every reference to .Variant and adding
OSVersion and OSFeatures, except the ones related to the string
representation of a Platform instance.
I then went through and ensured every assignment of OSFeatures that
might leak out, i.e., not local-only or for marhsalling purposes, uses
the append-to-nil idiom to avoid sharing the slice storage and allowing
accidental mutation after-the-fact.
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Working with strings is error-prone because a platform
can be in multiple string forms and less flexible.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Instead of doing a direct string comparison we should
use `platforms.Only` so that we can also detect the
variants that are compatible but don’t match directly.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>