Commit Graph

7292 Commits

Author SHA1 Message Date
Matt Heon
e5f484964a Merge pull request #28495 from Honny1/fix-device-compat-api
Fix Docker API DeviceMapping for CDI devices
2026-04-14 08:42:26 -04:00
Ygal Blum
8059539425 Quadlet - Support empty source for Mount key
Fixes: #28497

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2026-04-13 17:28:33 -04:00
Jan Rodák
f374f2c95b Fix Docker API DeviceMapping for CDI devices
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-13 20:56:37 +02:00
Paul Holzinger
05ff49a103 Merge pull request #27828 from lsm5/podman6-no-slirp-new
Podman6: Remove slirp
2026-04-13 19:24:28 +02:00
Paul Holzinger
571c842bd3 hyperV: fix powershell path escape
To avoid special chars from being interpreted.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-13 19:01:49 +02:00
Lokesh Mandvekar
9ff3f4cb1e Clean up outdated slirp4netns references in comments
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 09:05:09 -04:00
Lokesh Mandvekar
42a98a5a82 Remove slirp4netns from CLI and completions
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 09:04:41 -04:00
Lokesh Mandvekar
cefb944647 Remove slirp4netns setup functions (preserve RLK)
Remove all slirp4netns-specific setup and helper functions while
preserving the RootlessRLK port mapping functions that are still
used by pasta and bridge networking.

Rename networking_slirp4netns.go to networking_rootlessport.go.
Convert the slirp4netns compose test to use pasta instead.
Remove rootlessSlirpSyncR/W fields from container struct and
getSlirp4netnsIP stub from FreeBSD networking.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 09:04:41 -04:00
Lokesh Mandvekar
e81328e2a2 Remove Slirp network mode constant and error on usage
Using --network=slirp4netns now returns a hard error directing
users to pasta and `podman system migrate`.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 08:22:36 -04:00
Lokesh Mandvekar
3317eb9abb Set pasta as default when default_rootless_network_cmd is unset
Previously, when default_rootless_network_cmd was empty, podman
would fall back to slirp4netns. Change this to default to pasta
instead. Remove the now-unused slirp4netns import.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 08:22:36 -04:00
Mario Loriedo
e3b5d0f1ad Merge pull request #27932 from lstocchi/i27627
Propose running init/rm command on hyperv machine in elevated mode when required
2026-04-10 18:21:20 +02:00
Paul Holzinger
5ae63471cf Merge pull request #28469 from Luap99/fixes
some small fixes
2026-04-09 13:36:36 +02:00
Paul Holzinger
12bec19426 bindings: artifact extract reject invalid names
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>
2026-04-08 19:58:08 +02:00
Paul Holzinger
25aee24cbd use chrootarchive over plain archive package
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>
2026-04-08 19:58:07 +02:00
Paul Holzinger
abb5120624 fix symlink handling in checkpoint restore
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>
2026-04-08 19:57:02 +02:00
Paul Holzinger
3f2886556b Merge pull request #28356 from Honny1/fix-remote-build
Remote build: `nTar` secrets with relative paths and ignore bypass
2026-04-08 19:49:48 +02:00
Tom Sweeney
12c656234c Merge pull request #28430 from Honny1/fix-containerignore
Fix .containerignore patterns with leading/trailing slashes
2026-04-03 17:32:29 -04:00
lstocchi
a9a9eda883 rename ErrRelaunchAttempt to ErrRelaunchSucceeded and fix elevated error handling
The old ErrRelaunchAttempt name was ambiguous — it reads as though the
relaunch attempt failed, when it actually signals success. Rename to
ErrRelaunchSucceeded and update comments at every call site to clarify
that this is not a real error but a sentinel indicating the elevated
child process completed the operation successfully.

Also fix a bug in WSL's launchElevate where a failed elevated process
was incorrectly wrapped with the sentinel, causing callers to treat the
failure as success and print "Machine init complete."

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 18:37:24 +02:00
lstocchi
8e5fde01c6 propose running init/rm command on hyperv machine in elevated mode
This commit adds automatic UAC elevation prompts for HyperV machine
init/rm actions when administrator privileges are required.
Previously, users had to manually run Podman as administrator
when creating the first machine or removing the last machine, which
requires Windows Registry modifications.

When the HyperV command gets relaunched as elevated, the error of the
elevated process is saved on a file to be displayed by the caller. The
implementation is the same as that used by WSL.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 18:37:08 +02:00
lstocchi
5b0ec91c54 move wsl' util_windows to windows package so it can be reused by hyperv
Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 14:32:09 +02:00
Paul Holzinger
d20933df02 add missing O_CLOEXEC to open calls
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>
2026-04-02 15:06:37 +02:00
Jan Rodák
c57f9f49a3 Fix .containerignore patterns with leading/trailing slashes
Fixes: https://github.com/containers/podman/issues/25458

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-01 20:19:37 +02:00
Matt Heon
75d68ea174 Merge pull request #28414 from Honny1/fix-quadlet-lookup-strip
Fix Quadlet `Lookup()` stripping unmatched quotes
2026-03-31 11:14:47 -04:00
Jan Rodák
66c4c9c6b5 Merge pull request #28390 from crawfordxx/fix-docker-compat-stopped-state-28359
compat: map internal states to Docker equivalents in LibpodToContainer
2026-03-31 11:59:23 +02:00
Jan Rodák
cf6404f387 Fix Quadlet Lookup() stripping unmatched quotes
Fixes: https://github.com/containers/podman/issues/28409

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-31 10:27:39 +02:00
Matt Heon
9bea6e759a Merge pull request #28382 from himgov/issue/28369
Add a Status filter to podman quadlet list #28369
2026-03-30 13:25:04 -04:00
Joe Doss
667f55c2ce Fix shell driver DriverOpts cross-contamination in secret creation
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>
2026-03-30 00:56:45 -05:00
crawfordxx
fdf663b079 compat: map internal states to Docker equivalents in LibpodToContainer
The Docker compat /containers/json endpoint was leaking podman-internal
container states ("stopped", "stopping") that are not valid Docker API
states. Docker clients that strictly validate the State field against
the documented set ("created", "running", "paused", "restarting",
"exited", "removing", "dead") would fail with deserialization errors.

LibpodToContainerJSON already performs this mapping correctly:
- "stopped" → "exited"
- "stopping" → "running"

Apply the same remapping in LibpodToContainer using a switch statement
so the list endpoint behaves consistently with the inspect endpoint.

Add a test assertion to the compat /containers/json test to verify
that a stopped container is reported with State="exited".

Fixes #28359

Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
2026-03-29 12:04:46 +08:00
Himanshu Jaiswal
04935fe867 Add a Status filter to podman quadlet list
Adds --filter status=<value> support to podman quadlet list.
Also adds shell completion for the status filter values.

Signed-off-by: Himanshu Jaiswal <himanshu.bw5@gmail.com>
2026-03-28 12:05:46 +00:00
EDuToit
e58ec4dc07 Address seccomp profile todo:
- resolve seccomp profile from config default
- assign profile if default path is not defined

Signed-off-by: EDuToit <eben.dutoit07@gmail.com>
2026-03-26 12:00:59 +01:00
Tom Sweeney
8c3af49bef Merge pull request #28347 from Honny1/machine-cpu-limits
Reject `--cpus` above host CPU count on podman machine init and set
2026-03-25 11:05:37 -04:00
Jan Rodák
7952067882 Merge pull request #28352 from crawfordxx/fix-system-check-missing-return-on-parse-error
api: fix missing return after error in SystemCheck handler
2026-03-25 15:15:29 +01:00
Jan Rodák
e18bb9ea8b Remote build: nTar secrets with relative paths and ignore bypass
When `podman-remote` tars the context, extra `podman-build-secret*` paths were
either dropped by `.dockerignore` (#25314) or archived as absolute paths so
`COPY . .` pulled host-shaped trees into the image (#28334).

Use relative names under the primary context for extra sources and do not apply
`.dockerignore` to those forced entries.

Fixes: https://github.com/containers/podman/issues/25314
Fixes: https://github.com/containers/podman/issues/28334

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-25 15:02:28 +01:00
Paul Holzinger
07aa62f82f Merge pull request #28232 from nickjwhite/distro-user-dir
Look for rootless quadlets in /usr/share/containers/systemd/users
2026-03-24 13:28:09 +01:00
Paul Holzinger
fb3bd08882 Merge pull request #28034 from baude/oswslerror
Error on WSL machine os apply|upgrade
2026-03-24 13:17:50 +01:00
Jan Rodák
5260bd37b6 Merge pull request #28224 from simonbrauner/libpod-pull-progress
Extend libpod pull API to show pull progress
2026-03-24 10:43:32 +01:00
crawfordxx
29d80a26af api: fix missing return after error in SystemCheck handler
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>
2026-03-24 12:12:19 +08:00
Jan Rodák
bb4dda4855 Reject --cpus above host CPU count on podman machine init and set
Fixes: https://github.com/containers/podman/issues/28322

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-23 18:22:14 +01:00
Brent Baude
48d36932e2 Error on WSL machine os apply|upgrade
Given that apply and upgrade do not work on WSL, we should error out
with an error as such.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-03-23 10:01:53 -05:00
Danish Prakash
acd5f94d84 specgenutil: remove special handling of 0.0.0.0 for netavark
Podman strips `0.0.0.0` to `""` because netavark handles both
of them differently. With `""` netavark binds dual stack, same as
docker.

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-03-20 13:54:50 +05:30
Danish Prakash
9565002257 feat: add support for changing default host IPs via containers.conf
Add support for `default_host_ips` in containers.conf to set default
host IP(s) if no IP is set when forwarding ports. Multiple IPs can be
configured, and passing explicit IP with -p will always override
the configured defaults.

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-03-20 13:54:48 +05:30
Paul Holzinger
0147339e8e Merge pull request #28202 from lsm5/podman6-no-cni-vendor
Podman6: Vendor update w/o CNI + additional cleanups
2026-03-19 21:44:01 +01:00
Paul Holzinger
46502be750 Merge pull request #28234 from Honny1/add-format-for-scp
Add `--format` to `podman image scp`
2026-03-19 19:50:16 +01:00
Paul Holzinger
5d7bc4e947 Merge pull request #28323 from giuseppe/detect-stale-pause-process
rootless: detect and remove stale pause.pid with recycled PIDs
2026-03-19 18:33:53 +01:00
Paul Holzinger
d2e7e8192e Merge pull request #28235 from Honny1/volume-prune-docker
`podman volume prune`: match Docker defaults, add `--all` flag
2026-03-19 17:53:18 +01:00
Jan Rodák
da3c4aa21a Add --format to image scp
Add --format (oci-archive, docker-archive) to pass through to podman save.
Default is unchanged (no --format) so podman save uses its own default.
Document that scp is not storage-to-storage and only archive formats
are supported.

Fixes: https://github.com/containers/podman/issues/28183
Fixes: https://issues.redhat.com/browse/RUN-4403

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-19 17:42:33 +01:00
Lokesh Mandvekar
7d50844922 test: remove CNI_CONFIG_DIR env var handling
The CNI_CONFIG_DIR environment variable is no longer relevant now
that CNI support has been removed.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-03-19 20:26:21 +05:30
Tom Sweeney
bb9d188d4a Merge pull request #28236 from Honny1/fix-unless-stopped
Fix `unless-stopped` containers not restarting after `podman-restart-service` stop them
2026-03-19 10:45:28 -04:00
Giuseppe Scrivano
a2db18f35c rootless: detect and remove stale pause.pid with recycled PIDs
When a pause process dies and its PID gets recycled by an unrelated
process, the stale pause.pid file causes join failures.  Detect this
by checking /proc/<pid>/environ for _PODMAN_PAUSE=1 after a failed
join attempt.

Closes: https://github.com/containers/podman/issues/28157

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-03-19 14:46:29 +01:00
Jan Rodák
d887a8146a Fix creating unnamed volumes as anonymous
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-19 13:40:47 +01:00