mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-20 22:57:49 +00:00
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> |
||
|---|---|---|
| .. | ||
| grpcpb | ||
| handlers | ||
| server | ||
| types | ||
| Makefile | ||
| tags.yaml | ||