Bump the timeout to 60 minutes. We already bumped to 40 minutes a while
ago in commit 623cb5f but it seems this is not enough.
The x86_64 test needs only 25 minutes so I am confused why aarch64 got
so much slower, they used to be around the same time.
Of course our tests should not take that long so we really need to
figure out what is actually causing this slow down.
Looking at logs a test that boots and stops a VM takes 30s on x86_64
while it takes 50s on aarch64.
However at the same time the aarch64 test on the macs with libkrun and
applehv are quite fast (15-17m) so it seems unlikely to me that it is
something inside the aarch64 machine image that causes but rather
related to the host side.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 938d677ad9)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
The server already does validate this so this is not strictly needed and
the client must trust the server no matter what.
But adding an extra check here does not hurt and may help prevent future
bugs.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 12bec19426)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Just as additional hardening.
Note chrootarchive does not work on macos/windows, in that case it still
falls back to the regular pkg/archive.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 25aee24cbd)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Under normal circumstances this is not a problem as the archive file
created podman container checkpoint will no create symlinks.
However if a user passes a custom archive they could contain symlinks
that point outside our root. To resolve them within the root use
securejoin.
Note this is not a security problem because the full archive must be
trusted by a user to begin with as it contain the full container config.
Fixes: #27977
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit abb5120624)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
The go std os package to will always make sure to use O_CLOEXEC, however
in cases where we directly call unix.Open() we need to pass that flag
explicitly.
I looked at this as there was a report of a leaked fd on the pasta list,
though I am not sure this will address it.
But anyway doing this should be rather safe and avoid leaks into other
processes.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit d20933df02)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Verify that creating a secret with driver=shell and no --driver-opts
does not inherit the file driver's default path option. Before the fix,
this produced "invalid shell driver option"; after, it correctly fails
with "missing config value" for unconfigured shell commands.
Signed-off-by: Joe Doss <joe@solidadmin.com>
(cherry picked from commit 8b905613b5)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
When creating a secret with driver=shell via the API, the file driver's
default DriverOpts (including path) were applied because DriverOpts was
empty. The shell driver rejects path as an unknown option, making it
impossible to create shell-driver secrets via the REST API or
podman-remote.
Only apply default DriverOpts from config when the requested driver
matches the configured default driver.
Signed-off-by: Joe Doss <joe@solidadmin.com>
(cherry picked from commit 667f55c2ce)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
ExecContainerHTTP returns attachChan to its caller before attachExecHTTP
finishes. The caller's deferred close(holdConnOpen) can therefore fire
while attachExecHTTP is still running (including its own deferred
cleanups), which races with the goroutine inside attachExecHTTP that
reads deferredErr after <-holdConnOpen unblocks.
Fix this by introducing an errCh channel: deferred functions write
deferredErr into it, and the goroutine reads from it after
<-holdConnOpen unblocks, ensuring the read happens-after all writes to
the named return value.
Fixes: #28277
Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
(cherry picked from commit 497185c14b)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
In the SystemCheck HTTP handler, when parsing the
unreferenced_layer_max_age query parameter fails, the error response is
sent but execution continues to `unreferencedLayerMaximumAge = &duration`
where `duration` is the zero value. This causes the system check to run
with a zero duration instead of returning the 400 error to the client.
Add the missing `return` after the error response.
Fixes#28350
Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
(cherry picked from commit 29d80a26af)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Podman uses this env toi do various things, we don't want the external
env to affect our tests here.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 7e3caaed84)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This prevents a nil pointer crash when running network=host containers
on a FreeBSD host using podman-remote.
Fixes: #28289
Signed-off-by: Doug Rabson <dfr@rabson.org>
(cherry picked from commit 9a10cefd18)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Setting Entrypoint= (empty value) in a quadlet .container file should
produce --entrypoint "" in the generated podman command, which clears
the image's default entrypoint. Previously this was silently ignored
because lookupAndAddString skips empty values.
Move the Entrypoint key out of the generic stringKeys map and handle
it separately so that an empty value is passed through.
Closes#28213
Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
(cherry picked from commit 926f562bd5)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Recommend the reboot option instead if users cannot shut down all podman
commands. Also update the wording that users MUST shut down commands for
correct migration.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Mention the reboot which should be safer and that in order for the
command the user has to ensure they are no parallel commands.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
If the sqlite file exists make sure we always use that db and no longer
botldb. There are known race conditions in the db migration logic that
might make it so that both database files exists at once.
In order to ensure we use the correctly migrated one we must prefer
sqlite here.
see https://github.com/containers/podman/issues/28216
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Once we have the alive lock and do not refresh check again if another
process migrated the state after we opened the db initially.
This is required to ensure parallel commands notice the migration and
correctly only use sqlite.
see https://github.com/containers/podman/issues/28219
Signed-off-by: Paul Holzinger <pholzing@redhat.com>