]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Power Ops: Attempt to execute file path only
authorKruti <kpendharkar@vmware.com>
Fri, 23 Feb 2024 10:25:10 +0000 (02:25 -0800)
committerKruti <kpendharkar@vmware.com>
Fri, 23 Feb 2024 10:25:10 +0000 (02:25 -0800)
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
open-vm-tools/scripts/common/statechange.sh

index 156f5cc2eb378afee29004b0e587e2cc789367e3..98c86fd6ce5fea8d359765bc761c315d0fbfbaa5 100644 (file)
@@ -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
index 40732519aaf6f2555810a41cf2739fe3deff8892..b3f16f8ce9334d061064889eb9d0ce23aae8c4d3 100644 (file)
@@ -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