The lgetxattr(2), lsetxattr(2), and llistxattr(2) syscalls on Linux
return ENOTSUP instead of EOPNOTSUPP. The same applies to getxattr(2),
setxattr(2), and listxattr(2) on macOS.
Note that EOPNOTSUPP and ENOTSUP have the same value in Linux (refer to
errno(3)).
Signed-off-by: Minseo Kim <kimminss0@outlook.kr>
This way the error messages are more informative.
Convert all the users accordingly (assuming there are no users outside
of this repo).
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The current code
* is hard to read (at least for me, that is);
* is suboptimal (always calls unix.Llistxattr() twice);
* doesn't handle the condition when attributes size
is changed in between the two calls to unix.Llistxattr()
(see the detailed description in previous patch)
Fix all three issues by reusing the logic from Lgetxattr().
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
lgetxattr(2) man page says:
> If size is specified as zero, these calls return the current size of
> the named extended attribute (and leave value unchanged). This can be
> used to determine the size of the buffer that should be supplied in a
> subsequent call. (But, bear in mind that there is a possibility that
> the attribute value may change between the two calls, so that it is
> still necessary to check the return status from the second call.)
The current code does not handle the "bear in mind" case, i.e. when
the size changes between the two calls, and the new size is larger.
Fix the above problem, and slightly simplify the code.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Types unix.Errno and syscall.Errno are identical
(as x/sys/unix says "type Errno = syscall.Errno"),
so we can use unix.Errno and save a line in imports.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This should avoid the following panic in Lgetxattr:
panic: runtime error: makeslice: len out of range
Fixes: 0da4bc60b3 ("pkg/archive: strictly handle errors reading xattrs")
See: https://travis-ci.org/containers/buildah/jobs/617652963
Signed-off-by: Zac Medico <zmedico@gmail.com>
Preservation of user.* xattrs is supported by most (if not all) other
drivers, and it's especially useful for containers that run under a
PaX kernel where "user.pax.flags" is used to store PaX flags.
Signed-off-by: Zac Medico <zmedico@gmail.com>
Had to vendor in a new version of golang.org/x/net to build
Also had to make some changes to drivers to handle
archive.Reader -> io.Reader
archive.Archive -> io.ReadCloser
Also update .gitingore to ignore emacs files, containers-storage.*
and generated man pages.
Also no longer test travis against golang 1.7, cri-o, moby have also
done this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This is a package for generic system calls etc that for some reason
is not yet supported by "syscall", or where it is different enough
for the different ports to need portability wrappers.
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)