summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-06-05 12:50:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-06-05 12:50:15 -0400
commit1c13c9814dc11374e361f2af2e07e7e419418e76 (patch)
tree4d140ad70f92294f1512a2e551655d2de8b17846
parent43c3dce6504595edf9b496062e9733c90f4c9f2d (diff)
webapp: Include ssh port in mangled hostname.
This avoids a collision if different ssh ports are used on the same host for some reason. Note that it's ok to change the format of the mangled hostname; unmangling only extracts the hostname from it, and once ssh is configured for a mangled hostname, that config is not changed.
-rw-r--r--Assistant/Ssh.hs3
-rw-r--r--debian/changelog1
2 files changed, 3 insertions, 1 deletions
diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs
index 4dd32f7d9..e1a78cd00 100644
--- a/Assistant/Ssh.hs
+++ b/Assistant/Ssh.hs
@@ -312,7 +312,7 @@ setSshConfig sshdata config = do
{- This hostname is specific to a given repository on the ssh host,
- so it is based on the real hostname, the username, and the directory.
-
- - The mangled hostname has the form "git-annex-realhostname-username_dir".
+ - The mangled hostname has the form "git-annex-realhostname-username-port_dir".
- The only use of "-" is to separate the parts shown; this is necessary
- to allow unMangleSshHostName to work. Any unusual characters in the
- username or directory are url encoded, except using "." rather than "%"
@@ -324,6 +324,7 @@ mangleSshHostName sshdata = "git-annex-" ++ T.unpack (sshHostName sshdata)
where
extra = intercalate "_" $ map T.unpack $ catMaybes
[ sshUserName sshdata
+ , Just $ T.pack $ show $ sshPort sshdata
, Just $ sshDirectory sshdata
]
safe c
diff --git a/debian/changelog b/debian/changelog
index 0de7c25f8..dd2583e3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ git-annex (5.20140530) UNRELEASED; urgency=medium
an already existing remote.
* assistant: Make sanity checker tmp dir cleanup code more robust.
* unused: Avoid checking view branches for unused files.
+ * webapp: Include ssh port in mangled hostname.
-- Joey Hess <joeyh@debian.org> Thu, 29 May 2014 20:10:59 -0400