]> git.proxmox.com Git - pve-manager.git/commitdiff
Nodes: Check if target node even exists before sending WOL packet
authorChristian Ebner <c.ebner@proxmox.com>
Fri, 18 Jan 2019 09:12:56 +0000 (10:12 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 21 Jan 2019 15:22:12 +0000 (16:22 +0100)
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@proxmox.com>
PVE/API2/Nodes.pm

index 7f829b299886954ac8fe22604b6676dba7164b7b..40ec6ee4f4a1d2a5047b7ab493926086c1ba7b08 100644 (file)
@@ -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)) {