From 9ebdb8612bf5957b821833c3e62d9e6ab7aa1f69 Mon Sep 17 00:00:00 2001 From: Elmar Pruesse Date: Wed, 29 Jan 2025 20:28:28 -0700 Subject: [PATCH] Use sh to parse and exec IPMI command - Fixes: #1663 Signed-off-by: Elmar Pruesse --- CHANGELOG.md | 1 + internal/pkg/power/ipmitool.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dec7286..3d0e5eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix default nodes.conf to use the new kernel command line list format. #1670 - Fix `make install` when `sudo` does not set `$PWD`. #1660 +- Use sh to parse and exec IPMI command. #1663 ## v4.6.0rc1, 2025-01-29 diff --git a/internal/pkg/power/ipmitool.go b/internal/pkg/power/ipmitool.go index 8e54eab0..1cc25f6c 100644 --- a/internal/pkg/power/ipmitool.go +++ b/internal/pkg/power/ipmitool.go @@ -67,7 +67,7 @@ func (ipmi *IPMI) Command() ([]byte, error) { if ipmi.ShowOnly { return []byte(cmdStr), nil } - ipmiCmd := exec.Command(cmdStr) + ipmiCmd := exec.Command("/bin/sh", "-c", cmdStr) return ipmiCmd.CombinedOutput() } @@ -76,7 +76,7 @@ func (ipmi *IPMI) InteractiveCommand() (err error) { if err != nil { return err } - ipmiCmd := exec.Command(cmdStr) + ipmiCmd := exec.Command("/bin/sh", "-c", cmdStr) ipmiCmd.Stdout = os.Stdout ipmiCmd.Stdin = os.Stdin ipmiCmd.Stderr = os.Stderr