gofumpt is a superset of gofmt, enabling some more code formatting
rules.
This commit is brought to you by
gofumpt -w .
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Almost all the code can be shared between Linux, FreeBSD and Darwin with
the only different in the handling of lchmod. On FreeBSD and Darwin (and
probably other BSDs) we can access lchmod functionality via
unix.Fchmodat.
Signed-off-by: Doug Rabson <dfr@rabson.org>
Force the mode for whiteouts that have been converted from overlay
format (produced by overlay native diff) to aufs format to 0x0, to match
the permissions we assign to whiteouts we create when using naive diff.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
See comment for the situation that arises, we've seen this with images
generated by very old dockers (and possibly others?).
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
unprivileged users cannot use the trusted.* xattrs. Since for
rootless we always mount overlay with userxattr, we can just check if
running in rootless mode and use user.* instead of trusted.*.
Closes: https://github.com/containers/podman/issues/9936
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if force mask is configured, store the original permissions in the
'user.containers.override_stat` xattr.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Some platforms store s.Rdev as unit32, translate to unit64 so it
will compile.
Also add function to make it clear that the object is a whiteout object.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
if os.[Lc,C]hown are failing with EINVAL, it might be related to an
UID/GID not mapped in the user namespace we are currently using.
It could be possible to detect this issue by inspecting
/proc/self/uid_map or /proc/self/gid_map, but that won't be possible
when we are pulling a new image and extracting it from a chroot where
/proc is not mounted.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
If the overlay filesystem implements an optimization that landed in
97c684cc911060ba7f97c0925eaf842f159a39e8, and in the mainline kernel in
4.10, directories created in merged directories are marked as opaque by
the kernel to let the kernel know that it needn't bother looking at
other layers when reading the contents of that directory.
This means that, when generating a diff for an upper directory, we can't
treat the presence of an opaque attribute as enough of an indication
that a layer diff needs to include whiteout for a directory of the same
name from a lower layer.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.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>
Rename the library module and CLI wrapper.
Rename daemon/graphdriver to drivers.
Catch up vendoring to match modules we've pruned.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Currently when overlay creates a whiteout file then the overlay2 layer is archived,
the correct tar header will be created for the whiteout file, but the tar logic will then attempt to open the file causing a failure.
When tar encounters such failures the file is skipped and excluded for the archive, causing the whiteout to be ignored.
By skipping the copy of empty files, no open attempt will be made on whiteout files.
Fixes#23863
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)