Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxd: Prevent conversion from OVA file format #13877

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

MusicDin
Copy link
Member

@MusicDin MusicDin commented Aug 5, 2024

Prevents conversion from OVA file format. On the server side we check whether the file is a tarball when the file is uploaded.

To prevent file from being uploaded in the first place, we also use the same check in lxd-migrate.

An OVA (Open Virtualization Appliance) file is not a virtual disk format like VMDK and QCOW2.
Instead, it is an archive format used for distributing virtual appliances.

Since qemu-img info detects it as raw image format, we cannot use that to detect OVA files.
Instead we need to check whether the uploaded file is a tar archive (contains a tar header).

Note that we need to reset the file's read pointer after the file is uploaded and also open
file with read permission (in addition to already requested write permission).

Signed-off-by: Din Music <[email protected]>
@MusicDin MusicDin force-pushed the fix/conversion-ova branch from 98f4798 to 5befe3d Compare August 5, 2024 17:18
@MusicDin MusicDin marked this pull request as ready for review August 5, 2024 19:53
@MusicDin MusicDin requested a review from tomponline August 5, 2024 19:54
@tomponline tomponline merged commit c1e264d into canonical:main Aug 5, 2024
29 checks passed
@MusicDin MusicDin deleted the fix/conversion-ova branch August 5, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants