Commit Graph

7059 Commits

Author SHA1 Message Date
0xdvc
35c602bfbb fix: improve userns validation when joining pods
- remove old CLI validation that only checked --pod flag
- add validation in namespaces.go to catch all paths (cli, quadlet, api)
- block userns mixing for all pods with infra, not just ipc/net
- update error message to be clearer
- fix test cleanup to use PodmanExitCleanly()
- use dynamic pod names in system tests to avoid conflicts

fixes #26848

Signed-off-by: 0xdvc <neilohene@gmail.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2026-02-06 15:36:47 -05:00
Vyacheslav Bespalov
d6c79580f8 [Fixes: #27571] Fix 'shouldResolveWinPaths' returning 'false' on Windows
Signed-off-by: Vyacheslav Bespalov <vbespalov@ptsecurity.com>
2026-02-06 15:36:47 -05:00
axel7083
243b623629 fix(api/compat): typo in the remove secret handle
Fixes https://github.com/containers/podman/issues/27548

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2026-02-06 15:36:47 -05:00
Aaron Ang
8423b3bbd0 Clamp rootless rlimits to host on format
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2026-02-06 15:36:47 -05:00
Aaron Ang
58a15f1500 Add ulimits to podman update API
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2026-02-06 15:36:47 -05:00
ryanmccann1024
484858710c feat(exec): Add --no-session flag for improved performance
Fixes: #26588

For use cases like HPC, where `podman exec` is called in rapid succession, the standard exec process can become a bottleneck due to container locking and database I/O for session tracking.

This commit introduces a new `--no-session` flag to `podman exec`. When used, this flag invokes a new, lightweight backend implementation that:

- Skips container locking, reducing lock contention
- Bypasses the creation, tracking, and removal of exec sessions in the database
- Executes the command directly and retrieves the exit code without persisting session state
- Maintains consistency with regular exec for container lookup, TTY handling, and environment setup
- Shares implementation with health check execution to avoid code duplication

The implementation addresses all performance bottlenecks while preserving compatibility with existing exec functionality including --latest flag support and proper exit code handling.

Changes include:
- Add --no-session flag to cmd/podman/containers/exec.go
- Implement lightweight execution path in libpod/container_exec.go
- Ensure consistent container validation and environment setup
- Add comprehensive exit code testing including signal handling (exit 137)
- Optimize configuration to skip unnecessary exit command setup

Signed-off-by: Ryan McCann <ryan_mccann@student.uml.edu>
Signed-off-by: ryanmccann1024 <ryan_mccann@student.uml.edu>
2026-02-06 15:36:47 -05:00
flouthoc
790f21d355 quadlet install: multiple quadlets from single file should share app
Quadlets installed from `.quadlet` file now belongs to a single
application, anyone file removed from this application removes all the
other files as well.

Assited by: claude-4-sonnet

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2026-02-06 15:36:47 -05:00
flouthoc
ed79cdfd6a quadlet: add support for multiple quadlets in a single file
Enable installing multiple quadlets from one file using '---' delimiters.
Each section requires '# FileName=<name>' comment for custom naming.
Single quadlet files remain unchanged for backward compatibility.

Assited by: claude-4-sonnet

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2026-02-06 15:36:47 -05:00
xiaolinny
e8c334f3cb chore: fix the inconsistent method names in the comments
Signed-off-by: xiaolinny <xiaolincode@outlook.com>
2026-02-06 15:36:47 -05:00
Alessandro Verzicco
d45377c6c8 Ignore auth header with empty JSON object
Signed-off-by: Alessandro Verzicco <152161683+alessandro-verzicco@users.noreply.github.com>
2026-02-06 15:36:47 -05:00
Byounguk Lee
f1dcf63a91 Fixes #27421 aritfact push and pull with authfile
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
2026-02-06 15:36:47 -05:00
shiavm006
87bb060531 Fix remote client rejecting empty --detach-keys string
The remote client (podman --remote) was incorrectly throwing an error
when --detach-keys="" was specified for attach, run, or start commands.
According to documentation and the v1.7.0 release notes, specifying an
empty string should disable detaching, not cause an error.

Fixes: #27414

Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
2026-02-06 15:36:47 -05:00
Dmitry Konishchev
8b8390522b Escape RequiresMountsFor value
Signed-off-by: Dmitry Konishchev <konishchev@gmail.com>
2026-02-06 15:36:47 -05:00
Lewis Denny
f76be2a94d [play_kube] Add validation to container image field
Fixes: #27784

Signed-off-by: Lewis Denny <lewisdenny@me.com>
2026-02-06 15:36:47 -05:00
shiavm006
6c1378be44 extract shared TTY handling code into helper function
Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
2026-02-06 15:36:47 -05:00
MayorFaj
8eacbd8464 fix: correct env/envFrom precedence in kube play
Fixes: #27287

Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-02-06 13:46:37 -05:00
Gregor Dschung
9e965498aa Fix interfering escaping of commas and spaces in no_proxy variable
Signed-off-by: Gregor Dschung <gregor@chkpnt.de>
2026-02-06 13:46:37 -05:00
Gregor Dschung
4ea22f1b29 Write DefaultEnvironment proxy values to /etc/systemd/user.conf.d/default-env.conf
Otherwise, the proxy values aren't passed to rootless podman.

Signed-off-by: Gregor Dschung <gregor@chkpnt.de>
2026-02-06 13:46:37 -05:00
Gregor Dschung
0e4dc26c05 Fix test proxyenv/env_test.go for systems that use proxy variables
Signed-off-by: Gregor Dschung <gregor@chkpnt.de>
2026-02-06 13:46:37 -05:00
Mayowa Fajobi
eb118bafb4 Fix healthcheck argument with spaces split in Docker API (#27818)
Fixes: #26519

Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-02-06 13:46:37 -05:00
givensuman
0747179589 Add AppArmor key to quadlet .container files
Fixes: #27095
Signed-off-by: givensuman <givensuman@duck.com>
2026-02-06 13:46:36 -05:00
MayorFaj
dac1e82710 fix(logs): add tests for nanosecond precision in log timestamps
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-02-06 13:46:36 -05:00
MayorFaj
d3bda38309 fix(logs): improve timestamp precision in container logs
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-02-06 13:46:36 -05:00
Colin Walters
06fe9b21c1 Fix missing newlines in stderr error messages
I happened to run `podman run --config=/path/to/file` and got
an error without a trailing newline, which was a bit jarring.

Fix the instances I noticed.

Assisted-by: OpenCode (Claude Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-02-06 13:46:36 -05:00
Jan Rodák
7ae6813dfc [v5.8] artifact: Skip AddLocal optimization on WSL
The local API path optimization is ineffective on WSL because of NTFS mounting overhead.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
(cherry picked from commit d889aeb6af)
2026-02-05 19:33:51 +01:00
Jan Rodák
3918d4ca75 [v5.8] Require absolute path for local API
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
(cherry picked from commit 2f7094c0de)
2026-02-05 19:33:51 +01:00
Jan Rodák
6465c07d21 [v5.8] Add local artifact add API endpoint
Fixes: https://issues.redhat.com/browse/RUN-3385
Fixes: https://github.com/containers/podman/issues/26321

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
(cherry picked from commit 91af437471)
2026-02-05 19:33:46 +01:00
Nicola Sella
bae88e1e5e Add GET /quadlets/{name}/exists
Fixes: https://issues.redhat.com/browse/RUN-4068

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-02-05 14:56:03 +01:00
Nicola Sella
d6023e431f Add DELETE /libpod/quadlets
Fixes: https://issues.redhat.com/browse/RUN-3742

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-02-05 14:55:46 +01:00
Nicola Sella
f2fcc7f09c Add POST /libpod/quadlets
Fixes: https://issues.redhat.com/browse/RUN-3743

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-02-05 14:53:34 +01:00
Nicola Sella
01e0db2931 Add GET /quadlets/{name}/file
Fixes: https://issues.redhat.com/browse/RUN-3716

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-02-05 14:52:30 +01:00
Christophe Fergeau
d0558385ec kube play: Fix fd leak when handling symlinks
The `*os.File` returned by `pathrs.OpenatInRoot` needs to
be closed before returning from `openSymlinkPath`

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2025-12-09 18:29:38 +00:00
Mikhail Dmitrichenko
ba6e527289 fix: check err returned by newGenericDecompressor
There is a couple of newGenericDecompressor function usages, where
returned possibly non-nil `err` is not checked before dereferencing
returned decompressor. It may lead to nil ptr dereferencing.

This commit adds check for `err` to prevent dereferencing potentially
nullable decompressor.

Found by Linux Verification Center (linuxtesting.org) with SVACE

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
2025-12-09 09:50:13 -05:00
Doug Rabson
68022802fc pkg/specgen/generate: Fix adding host devices on FreeBSD
This was not working when emulating Linux container images on FreeBSD.
The code to handle host devices on FreeBSD relies on the container
having a devfs mount. Unfortunately, the Linux emulation code which adds
this was happening after the host device handling. This changes the
logic so that host device management happens after Linux emulation.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2025-12-09 09:47:22 -05:00
Mario Loriedo
a27cc24f80 Replace FindExecutablePeer with FindHelperBinary
The WSL machine start was using the function FindExecutablePeer that
ignores user configuration (helper_binaries_dir). FindHelperBinary
instead is used when starting the machine for the rest of the providers
and honors user configuration.

This commit requires 4877783c37

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-12-08 14:42:36 +01:00
openshift-merge-bot[bot]
140893c2cb Merge pull request #27611 from openshift-cherrypick-robot/cherry-pick-27604-to-v5.7
[v5.7] podman system migrate fixes when pause process and conmon got killed
2025-11-26 19:42:31 +00:00
Paul Holzinger
9538a7d976 rootless_linux.c: use shortcut for system commands
There doesn't seem any reason why the system commands should not join
the userns. In particular the main commands use ParentNSRequired and
UnshareNSRequired when they don't want to be joined to the main userns.
Since the system command don't set these the go code does the join and
re-exec anyway so might as well use the shortcut to speed that up.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-26 10:18:30 +00:00
Paul Holzinger
0647387bfe SetupRootless handle case where conmon pid are not valid
When trying to join the conmon pid to recreate the pause process based
on the namespace it can be that the pid is no longer valid, i.e. when
conmon crashed or was killed.

Currently we have a big issue that can be reproduced using:
$ podman run -d quay.io/libpod/testimage:20241011 sleep 100
$ killall -9 conmon
$ killall catatonit

All commands would fail as we keep trying to rejoin the namespace of the
non existing conmon process.

So to address that fall back to creating a new namespace if we fail to
join the conmon pids.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-26 10:18:30 +00:00
Paul Holzinger
118ec04065 preallocate paths in SetupRootless
Just a minor improvement as we know the size needed for the slice we can
allocate it only once instead of the append having to resize it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-26 10:18:30 +00:00
Paul Holzinger
6a9ce66e5c fix noMoveProcess in SetupRootless
Based on the description in commit 63ef557 this was added so that the
migrate command does not move the pause process into a separate cgroup.

It should however not disable the rejoining of the userns when the pause
process join failed. BEcause of this we end up calling migrate without a
userns and that then can fail if there are actual contianer it tries to
cleanup.

Fixes: 63ef5576ed ("command: migrate doesn't move process to cgroup")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-26 10:18:30 +00:00
Paul Holzinger
973ab34078 use return error handling in SetupRootless
There is no good reason to use logrus and os.Exit() here, other parts of
this function already return the error so do the same. The main podman
process will exit then with the normal formatted error message.

And also log an error about the last return which should never happen as
we should have exited above if the re-exec worked or errored out.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-26 10:18:30 +00:00
Paul Holzinger
363665a456 pkg/machine: make mount units hook into local-fs
The virtiofs mount points do not actually are network mounts so we can
mount them earlier and using multi-user.target to enable them was wrong.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-25 20:27:47 +00:00
Paul Holzinger
97ad660c0c [v5.7] fix lint issues with github.com/cyphar/filepath-securejoin
The old location is deprecated and has been removed in v0.6.0 even. I
did this as extra commit to make cherry-picking easier.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-11-07 10:58:16 -05:00
Mario Loriedo
fb8644d551 Fix cache misses when pulling WSL machine image
Fixes a regression introduced by b2e6d53 that made always failing the
match of the WSL image from the registry with the image in the local
cache. The result was that the WSL machine image was always pulled from
quay.io even if an identical image was in the local cache.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-11-05 11:53:57 +00:00
openshift-merge-bot[bot]
bc3b910276 Merge pull request #27340 from axel7083/feature/quadlet/kube-support-multiple-yaml
feat(quadlet: kube): support multiple Yaml entries
2025-10-22 20:32:58 +00:00
openshift-merge-bot[bot]
08c670b232 Merge pull request #27263 from Honny1/fix-docs
docs: add missing manifest parameter to build API endpoints
2025-10-22 15:14:14 +00:00
axel7083
8e013c0012 feat(quadlet: kube): support multiple Yaml entries
fixes https://github.com/containers/podman/issues/26274

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2025-10-22 16:09:47 +02:00
Celso Henrique Souza Silva
0ea4eaee70 cmd/podman: add replace flag to quadlet install
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
Fixes: #26930
2025-10-21 14:03:23 -03:00
openshift-merge-bot[bot]
b342596e1c Merge pull request #27269 from Honny1/fix-unmarshal-prunereport
fix: system prune JSON unmarshalling error in remote client
2025-10-21 15:15:57 +00:00
openshift-merge-bot[bot]
9146ef6ac0 Merge pull request #27302 from arsenalzp/podman_26396
Add option to remove Pod name prefix in resulting container name
2025-10-20 23:47:40 +00:00