[pve-devel] [PATCH pve-manager 1/1] fix #2634: if hook-script without permission, prints message, that the script not executable

Moayad Almalat m.almalat at proxmox.com
Thu Mar 12 12:18:18 CET 2020


Signed-off-by: Moayad Almalat <m.almalat at proxmox.com>
---
 PVE/VZDump.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index ada3681e..5f7f7725 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -571,6 +571,12 @@ sub run_hook_script {
 
     return if !$script;
 
+    if (!-x $script) {
+	    die "The hook-script '$script' is not executable.\n"
+    }
+
+
+
     my $cmd = "$script $phase";
 
     $cmd .= " $task->{mode} $task->{vmid}" if ($task);
-- 
2.20.1




More information about the pve-devel mailing list