]> git.proxmox.com Git - pve-common.git/commit
tools: add download_file_from_url
authorLorenz Stechauner <l.stechauner@proxmox.com>
Mon, 14 Jun 2021 09:05:51 +0000 (11:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Jun 2021 08:21:24 +0000 (10:21 +0200)
commita3327ea6fb4bc60409e650868d6accf9e63c04c1
tree8fd8f648972f4f6f4792fa8b1137a08e7e376c1d
parentbc885c89b6124c235796232f3182708c3f1c4f4c
tools: add download_file_from_url

adds a common function to download arbitrary files from urls.

code is based on
manager:PVE/API2/Nodes.pm:aplinfo

Security notice: this function does not perform any permission
checking. The callee has to make sure, that only authorized users may
use this function.

Caution: This function is able to download files from internal
networks (which would not be visible/accessible from outside), the
callee needs to ensure that unprivileged (e.g., non root@pam or the
like) can only pass OK URLs (e.g., resolving to public routable IPs)

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Tools.pm