[pve-devel] applied: [PATCH pve-manager] Nodes: Check if target node even exists before sending WOL packet

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 21 16:51:22 CET 2019


On 1/18/19 10:12 AM, Christian Ebner wrote:
> Checks if the specified target node even exists before trying to read its MAC
> address from the config and sending the wake on LAN magic packet.
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>  PVE/API2/Nodes.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> index 7f829b29..40ec6ee4 100644
> --- a/PVE/API2/Nodes.pm
> +++ b/PVE/API2/Nodes.pm
> @@ -489,6 +489,7 @@ __PACKAGE__->register_method({
>      code => sub {
>  	my ($param) = @_;
>  
> +	PVE::Cluster::check_node_exists($param->{node});
>  	my $config = PVE::NodeConfig::load_config($param->{node});
>  	my $mac_addr = $config->{wakeonlan};
>  	if (!defined($mac_addr)) {
> 

applied, thanks! Added a followup which checks if the node parameter
is the current local node.




More information about the pve-devel mailing list