From ca6da4c2befeaf47d84631141d5fe9aab60a2dcb Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 14 Apr 2016 10:07:11 -0700 Subject: [PATCH] When proxying the SVN protocol, don't mutate URIs in protocol frames if we're an intracluster proxy Summary: Ref T10809. Currently, both the proxy and target may mutate URIs (rewriting "svn+ssh://x/diffusion/Y/" to a path on disk). I believe this previously worked by fate/chance/luck since both URI variants contain the repository information, but the algorithms were tightened up recently with callsign removal. Stop rewriting them if we're the intracluster proxy -- they only need to be rewritten on the target host. Test Plan: - Checked out a proxied SVN repository, with and without a callsign. - Checked out an unproxied SVN repository, with and without a callsign. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10809 Differential Revision: https://secure.phabricator.com/D15712 --- .../ssh/DiffusionSubversionServeSSHWorkflow.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php index 4e591d318b..820a380856 100644 --- a/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php @@ -21,6 +21,7 @@ final class DiffusionSubversionServeSSHWorkflow private $externalBaseURI; private $peekBuffer; private $command; + private $isProxying; private function getCommand() { return $this->command; @@ -146,6 +147,7 @@ final class DiffusionSubversionServeSSHWorkflow if ($this->shouldProxy()) { $command = $this->getProxyCommand(); + $this->isProxying = true; } else { $command = csprintf( 'svnserve -t --tunnel-user=%s', @@ -372,6 +374,10 @@ final class DiffusionSubversionServeSSHWorkflow } private function makeInternalURI($uri_string) { + if ($this->isProxying) { + return $uri_string; + } + $uri = new PhutilURI($uri_string); $repository = $this->getRepository(); @@ -409,6 +415,10 @@ final class DiffusionSubversionServeSSHWorkflow } private function makeExternalURI($uri) { + if ($this->isProxying) { + return $uri; + } + $internal = $this->internalBaseURI; $external = $this->externalBaseURI;