spiegel_podman/pkg/api
Madhosh Yagnik 94b0c1df14 pkg/api/handlers/libpod: close quadlet files per iteration and prevent duplicates
processMultipartQuadlets previously deferred closing each multipart part
and file inside the loop, leaking descriptors until the handler returned.
It also opened files with os.Create, silently overwriting earlier files if
a request contained parts with duplicate names.

Align processMultipartQuadlets with the manifests multipart upload handler:
- Wrap each part processing in a closure so part and file descriptors close
  immediately on each loop iteration.
- Use os.OpenFile with os.O_CREATE|os.O_EXCL|os.O_WRONLY (0600) so duplicate
  filenames return an error instead of silently overwriting.
- Sanitize filenames using filepath.Base to prevent directory traversal.
- Add unit tests verifying multiple file extraction, duplicate name rejection,
  and path traversal sanitization.

Fixes: #29752
Signed-off-by: Madhosh Yagnik <madhosh1yagnik@gmail.com>
2026-09-14 23:55:57 +05:30
..
grpcpb pkg/api/grpcpb: auto-format generated protobuf files 2026-05-07 13:30:23 -04:00
handlers pkg/api/handlers/libpod: close quadlet files per iteration and prevent duplicates 2026-09-14 23:55:57 +05:30
server Merge pull request #29656 from hkwi/fix-compat-stats-http-status 2026-09-04 15:17:42 +02:00
types set !remote build tags where needed 2024-08-19 11:41:28 +02:00
Makefile RUN-4539: Change podman module paths 2026-04-22 14:02:25 -05:00
tags.yaml [docs] Refactor Artifact API documentation 2025-08-19 10:22:00 +10:00