From 70a82017b3b9ca43f38178a09f0269bb3d039676 Mon Sep 17 00:00:00 2001 From: J Rhodes Date: Fri, 19 Jun 2015 15:06:32 +1000 Subject: [PATCH] Drop Windows-specific escaping in preallocated host Summary: This drops the Windows-specific escaping code for the creation of directories when acquiring a lease. This is basically the change from D10378 without the other, no longer necessary changes. Test Plan: This code hasn't been run in a production environment for a while (any instances of Phabricator using Drydock / Harbormaster with Windows have had this code removed by the D10378 patch for a while). Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Projects: #drydock Differential Revision: https://secure.phabricator.com/D13341 --- ...ockPreallocatedHostBlueprintImplementation.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php index af6a9e5f2f..9e5d3a2320 100644 --- a/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php @@ -77,20 +77,7 @@ final class DrydockPreallocatedHostBlueprintImplementation $cmd = $lease->getInterface('command'); - if ($v_platform !== 'windows') { - $cmd->execx('mkdir %s', $full_path); - } else { - // Windows is terrible. The mkdir command doesn't even support putting - // the path in quotes. IN QUOTES. ARGUHRGHUGHHGG!! Do some terribly - // inaccurate sanity checking since we can't safely escape the path. - if (preg_match('/^[A-Z]\\:\\\\[a-zA-Z0-9\\\\\\ ]/', $full_path) === 0) { - throw new Exception( - pht( - 'Unsafe path detected for Windows platform: "%s".', - $full_path)); - } - $cmd->execx('mkdir %C', $full_path); - } + $cmd->execx('mkdir %s', $full_path); $lease->setAttribute('path', $full_path); }