spiegel_podman/pkg/specgen
Giuseppe Scrivano 458fcaa1ba
specgen: fix pod mount options leaking between mounts
Replace the JSON marshal/unmarshal round-trip in Inherit() with
copier.Copy. json.Unmarshal reuses existing slice backing arrays
and does not zero struct fields absent from the JSON (omitempty),
so mount options like "ro" from one mount would leak into another
mount at the same backing-array position.

Fixes the case where running:
  podman run --pod mypod \
    --mount type=bind,src=/a,target=/mylog \
    --mount type=bind,src=/b,target=/mytmp,ro=true \
    alpine touch /mylog/a

incorrectly fails with "Read-only file system" because /mylog
inherits "ro" from /mytmp.

Fixes: https://issues.redhat.com/browse/RHEL-154348

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-03-10 09:14:38 +01:00
..
generate specgen: fix pod mount options leaking between mounts 2026-03-10 09:14:38 +01:00
container_validate.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
namespaces.go Remove CNI-specific code paths from libpod 2026-01-27 16:32:38 +05:30
namespaces_test.go Switch common, storage and image to monorepo. 2025-09-01 12:33:04 +02:00
pod_validate.go enable gofumpt formatter 2025-11-11 12:32:46 +01:00
podspecgen.go pkg/specgen: Remove deprecated CNINetworks 2025-11-12 15:35:29 -05:00
resources_freebsd.go lint: reenable revive unused-parameter check 2025-10-01 10:42:08 -04:00
resources_linux.go vendor: update common, image, storage to main 2025-11-21 14:24:29 +01:00
specgen.go libpod: Implement --log-opt label=LABEL=Value 2026-03-06 10:59:31 +02:00
specgen_local.go Switch common, storage and image to monorepo. 2025-09-01 12:33:04 +02:00
specgen_remote.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_test.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
utils.go lint: reenable revive unused-parameter check 2025-10-01 10:42:08 -04:00
utils_linux.go pkg/specgen: error out when a block device isn't 2025-06-10 13:50:02 -07:00
volumes.go Bump Go version to v6 2025-10-23 11:00:15 -04:00
volumes_linux_test.go fix: mounting issue with single character volume on windows 2025-03-26 17:57:52 +01:00
volumes_windows_test.go [Fixes: #27571] Fix 'shouldResolveWinPaths' returning 'false' on Windows 2025-11-21 15:32:39 +03:00
winpath.go Introduce podman machine cp command 2025-02-28 09:56:46 -05:00
winpath_linux.go [Fixes: #27571] Fix 'shouldResolveWinPaths' returning 'false' on Windows 2025-11-21 15:32:39 +03:00
winpath_unsupported.go lint: reenable revive unused-parameter check 2025-10-01 10:42:08 -04:00
winpath_windows.go lint: reenable revive unused-parameter check 2025-10-01 10:42:08 -04:00