update fix deadcode, security
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Services\vCenter;
|
||||
|
||||
use App\Support\Cache\CacheKey;
|
||||
use App\Support\PowerShellEscaper;
|
||||
use App\Support\TlsHttpClientFactory;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -72,7 +73,7 @@ class SnapshotService
|
||||
Log::channel('Custom')->info("===================================================================");
|
||||
Log::channel('Custom')->info("Create Snapshot with VirtualMachine Name - $vmName - Snap #$name");
|
||||
|
||||
$command = "& 'C:\CLISave\createsnapshot.ps1' -vm_name '$vmName' -name '$name'";
|
||||
$command = "& 'C:\CLISave\createsnapshot.ps1' -vm_name " . PowerShellEscaper::singleQuote($vmName) . ' -name ' . PowerShellEscaper::singleQuote($name);
|
||||
Log::channel('Custom')->info($command);
|
||||
|
||||
$cmdResult = $this->powerShellService->executePowerCLI($command);
|
||||
@@ -309,7 +310,7 @@ class SnapshotService
|
||||
Log::channel('Custom')->info("Remove Snapshot with VirtualMachine Name - $vmware_name - Snap #$snap");
|
||||
Log::channel('Custom')->info("\r\n");
|
||||
|
||||
$Command = "& 'C:\CLISave\deletesnap.ps1' -vm_name '$vmware_name' -name '$snap'";
|
||||
$Command = "& 'C:\CLISave\deletesnap.ps1' -vm_name " . PowerShellEscaper::singleQuote($vmware_name) . ' -name ' . PowerShellEscaper::singleQuote((string) $snap);
|
||||
|
||||
Log::channel('Custom')->info("$Command");
|
||||
|
||||
@@ -376,7 +377,7 @@ class SnapshotService
|
||||
Log::channel('Custom')->info("Revert Snapshot with VirtualMachine Name - $vmware_name - Snap #$snap");
|
||||
Log::channel('Custom')->info("\r\n");
|
||||
|
||||
$Command = "& 'C:\CLISave\backSnap.ps1' -vm_name '$vmware_name' -name '$snap'";
|
||||
$Command = "& 'C:\CLISave\backSnap.ps1' -vm_name " . PowerShellEscaper::singleQuote($vmware_name) . ' -name ' . PowerShellEscaper::singleQuote((string) $snap);
|
||||
|
||||
Log::channel('Custom')->info("$Command");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user