From: Kruti Date: Fri, 23 Feb 2024 10:25:10 +0000 (-0800) Subject: Power Ops: Attempt to execute file path only X-Git-Tag: stable-12.4.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c199ccedd3fd8417c0d58b4ca1d3675224d8ac48;p=thirdparty%2Fopen-vm-tools.git 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 --- 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