From 6a6275d4fa422023fad027b690cfc779722194ad Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 8 Dec 2023 17:08:02 +0100 Subject: [PATCH] revert --- app/Livewire/Project/Shared/ExecuteContainerCommand.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Livewire/Project/Shared/ExecuteContainerCommand.php b/app/Livewire/Project/Shared/ExecuteContainerCommand.php index ec8bcb340..06e48979b 100644 --- a/app/Livewire/Project/Shared/ExecuteContainerCommand.php +++ b/app/Livewire/Project/Shared/ExecuteContainerCommand.php @@ -106,12 +106,10 @@ class ExecuteContainerCommand extends Component { $this->validate(); try { - // Wrap command to prevent escaped execution in the host. - $cmd = 'sh -c "' . str_replace('"', '\"', $this->command) . '"'; if (!empty($this->workDir)) { - $exec = "docker exec -w {$this->workDir} {$this->container} {$cmd}"; + $exec = "docker exec -w {$this->workDir} {$this->container} {$this->command}"; } else { - $exec = "docker exec {$this->container} {$cmd}"; + $exec = "docker exec {$this->container} {$this->command}"; } $activity = remote_process([$exec], $this->server, ignore_errors: true); $this->dispatch('newMonitorActivity', $activity->id);