AtomicWriteFile truly is atomic, it only changes the file
on success. So there's no point notifying other processes about
a changed file if we failed, they are going to see the same JSON data.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
If the backing filesystem is not supported with OverlayFS as a container
storage driver/or graph driver then do not continue.
In this context, report the incompatibility by notifying the user of an
unsupported configuration. The filesystem type/or ID that is returned by
the statfs(2) system call is reported too, to assist further
troubleshooting efforts. It can be used to deduce the actual filesystem
used for the container storage graph directory.
Signed-off-by: Aaron Tomlin <atomlin@redhat.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>
In the context of github.com/containers/storage/drivers.GetFSMagic()
when log-level debug is enabled show the filesystem type/or ID that is
returned by the statfs(2) system call in particular when the ID is not
known to podman. This might suggest an unsupported configuration.
Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
Follow up to https://github.com/containers/storage/pull/1357
Podman tests suggest that do not need to use XDG_CONFIG_HOME if
storage.conf does not exists. In that case we fall back to
/etc/containers/storage.conf and /usr/share/containers/storage.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
These are testing things like /etc/os-release and cgroups which are
linux-only. Note: /etc/os-release does exist on FreeBSD but
GetOperatingSystem is implemented using uname.
Signed-off-by: Doug Rabson <dfr@rabson.org>
This fixes a failure in TestApplyLayer caused by different modes on the
symlinks in the test due to the test setup using a different umask from
ApplyLayer. FreeBSD actually has an lchmod syscall and supports changing
the mode on symlinks so we can use that.
Signed-off-by: Doug Rabson <dfr@rabson.org>
On FreeBSD, the link syscall follows symlinks which makes
TestUntarHardlinkToSymlink fail. We can match the expected semantics on
FreeBSD using linkat.
Signed-off-by: Doug Rabson <dfr@rabson.org>
This avoids code having to cast the value returned by Mkdev and coding
in assuptions on the type of Mknod's dev argument.
Signed-off-by: Doug Rabson <dfr@rabson.org>
This was setting the time to 1970-1-1 00:00 in the local timezone
instead of UTC which causes test failures if the local timezone has a
positive offset from UTC. Fixes#1365.
Signed-off-by: Doug Rabson <dfr@rabson.org>
All the other integration tests pass on FreeBSD with the zfs driver.
Some of them fail with the vfs driver but those also fail on Linux.
Signed-off-by: Doug Rabson <dfr@rabson.org>
HPC Customers noticed that storage was attempting to read files in /usr
and /etc, even though they set XDG_CONFIG_HOME, they expect to only read
config files in this directory.
Fixes: https://github.com/containers/podman/issues/15680
(Actually partial fixes), need to look at other config files.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
There was a possibility to panic due to such behavior:
attempted to update last-writer in lockfile without the write lock
Fixes: https://github.com/containers/storage/issues/1324
Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
The code was passing timespec arguments to lutimes which expects timeval
arguments. This likely only ever 'worked' because the nanoseconds field
is nearly always zero.
Signed-off-by: Doug Rabson <dfr@rabson.org>