mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-03 22:50:10 +00:00
api: qga file-write: drop the check for base64
it's potentially expensive to check and the user already needs to explicitly turn auto-encoding off, besides QEMU/QGA should handle that and just error out gracefully on bogus base64 values. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
2b607ad1ab
commit
4d47a9f510
@ -488,11 +488,8 @@ __PACKAGE__->register_method({
|
||||
my ($param) = @_;
|
||||
|
||||
my $vmid = $param->{vmid};
|
||||
my $encode = $param->{encode} // 1;
|
||||
|
||||
my $buf = $encode ? encode_base64($param->{content}) : $param->{content};
|
||||
die "content is not base64 encoded\n"
|
||||
if !$encode && $buf !~ m@^(?:[A-Z0-9+/]{4})*(?:[A-Z0-9+/]{2}==|[A-Z0-9+/]{3}=)?$@mi;
|
||||
my $buf = ($param->{encode} // 1) ? encode_base64($param->{content}) : $param->{content};
|
||||
|
||||
my $qgafh = agent_cmd($vmid, "file-open", { path => $param->{file}, mode => 'wb' }, "can't open file");
|
||||
my $write = agent_cmd($vmid, "file-write", { handle => $qgafh, 'buf-b64' => $buf }, "can't write to file");
|
||||
|
Loading…
Reference in New Issue
Block a user