From cf934ca27ee251d6928691fd334b2da3bed1e979 Mon Sep 17 00:00:00 2001 From: Walt Howd Date: Thu, 12 Feb 2026 17:21:50 +0000 Subject: [PATCH] Execute WP CLI commands inside the chroot --- remote/remote.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/remote/remote.go b/remote/remote.go index 5fdbbbe..6376519 100644 --- a/remote/remote.go +++ b/remote/remote.go @@ -698,10 +698,11 @@ func runWpCliCmdRemote(conn net.Conn, GUID string, rows uint16, cols uint16, wpC cmdArgs = append(cmdArgs, cleanArgs...) - cmd := exec.Command(remoteConfig.wpCLIPath, cmdArgs...) + chrootArgs := append([]string{"/chroot", remoteConfig.wpCLIPath}, cmdArgs...) + cmd := exec.Command("chroot", chrootArgs...) cmd.Env = append(os.Environ(), "TERM=xterm-256color", "LESSSECURE=1") - log.Printf("launching %s - rows: %d, cols: %d, args: %s\n", GUID, rows, cols, strings.Join(cmdArgs, " ")) + log.Printf("launching %s - rows: %d, cols: %d, chroot /chroot %s %s\n", GUID, rows, cols, remoteConfig.wpCLIPath, strings.Join(cmdArgs, " ")) logFileName := fmt.Sprintf("/tmp/wp-cli-%s", GUID)