下面这段可以直接发到 [Ubuntu Bug
#2166326](https://bugs.launchpad.net/ubuntu/+source/tar/+bug/2166326):
---
I can reproduce this on an amd64 Ubuntu 26.04 machine running under
OrbStack/Rosetta on Apple Silicon.
Environment:
- tar: `1.35+dfsg-4ubuntu0.4`
- libc6: `2.43-2ubuntu2.4`
- Guest kernel: `7.2.12-orbstack-00394-gbecdd6130068`
A direct `openat2` syscall test returns `ENOSYS` (`errno=38, Function
not implemented`), both with `resolve=0` and with `RESOLVE_BENEATH`.
This breaks source extraction during a Buildroot build. For example:
```text
tar: Documentation/.gitignore: Cannot open: Function not implemented
tar: Documentation/ABI: Cannot mkdir: Function not implemented
```
I tested a local rebuild from the Ubuntu `1.35+dfsg-4ubuntu0.4` source
package, keeping its security patches and configuring with:
```text
ac_cv_func_openat2=no
```
This enables the bundled gnulib implementation, which attempts the
syscall and falls back when it returns `ENOSYS`.
Enabling that code path also exposed a declaration mismatch in
`gnu/fcntl.in.h`: the added `openat2` declaration passes four arguments
to `_GL_FUNCDECL_SYS`, while the bundled macro accepts three. I adapted
the declaration to the existing macro signature:
```c
_GL_FUNCDECL_SYS (openat2, int,
(int fd, char const *file, struct open_how const *how,
size_t size)
_GL_ARG_NONNULL ((2, 3)));
```
With this local rebuild:
- All 39 tests selected by `TESTSUITEFLAGS='-k extract'` passed.
- Nested directory extraction passed.
- ACL and user extended attribute preservation passed.
- A test archive attempting to write outside the extraction directory through a
symlink was rejected.
These results support restoring a runtime fallback when libc provides
`openat2` but the execution environment returns `ENOSYS`. The configure
override above is a tested local workaround; it is not an automatic
detection fix.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2166326
Title:
tar hard-fails with ENOSYS on kernels < 5.6 in Ubuntu 26.04
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tar/+bug/2166326/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs