From c199ccedd3fd8417c0d58b4ca1d3675224d8ac48 Mon Sep 17 00:00:00 2001 From: Kruti Date: Fri, 23 Feb 2024 02:25:10 -0800 Subject: [PATCH] Power Ops: Attempt to execute file path only Adding a check to verify that the path to execute is a file only and not a directory. Pull request: https://github.com/vmware/open-vm-tools/pull/689 --- open-vm-tools/AUTHORS | 3 +++ open-vm-tools/scripts/common/statechange.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/open-vm-tools/AUTHORS b/open-vm-tools/AUTHORS index 156f5cc2e..98c86fd6c 100644 --- a/open-vm-tools/AUTHORS +++ b/open-vm-tools/AUTHORS @@ -91,3 +91,6 @@ Dirk Mueller Detect the proto files for containerd grpc client on SUSE like s Jan Engelhardt Fix build problems with grpc (at least) 1.54 - https://github.com/vmware/open-vm-tools/pull/664 + +Yun Zheng Hu Power Ops: Attempt to execute file path only + - https://github.com/vmware/open-vm-tools/pull/689 diff --git a/open-vm-tools/scripts/common/statechange.sh b/open-vm-tools/scripts/common/statechange.sh index 40732519a..b3f16f8ce 100644 --- a/open-vm-tools/scripts/common/statechange.sh +++ b/open-vm-tools/scripts/common/statechange.sh @@ -88,7 +88,7 @@ RunScripts() { if [ -d "$scriptDir" ]; then for scriptFile in "$scriptDir"/*; do - if [ -x "$scriptFile" ]; then + if [ -f "$scriptFile" -a -x "$scriptFile" ]; then "$scriptFile" $powerOp exitCode=`expr $exitCode \| $?` fi