mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
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
This commit is contained in:
parent
827aa05a67
commit
70a82017b3
1 changed files with 1 additions and 14 deletions
|
@ -77,20 +77,7 @@ final class DrydockPreallocatedHostBlueprintImplementation
|
||||||
|
|
||||||
$cmd = $lease->getInterface('command');
|
$cmd = $lease->getInterface('command');
|
||||||
|
|
||||||
if ($v_platform !== 'windows') {
|
$cmd->execx('mkdir %s', $full_path);
|
||||||
$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);
|
|
||||||
}
|
|
||||||
|
|
||||||
$lease->setAttribute('path', $full_path);
|
$lease->setAttribute('path', $full_path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue