summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-25 15:43:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-25 15:43:46 -0400
commit6236f2309c02804f51947619a261eef7d7afd086 (patch)
tree5f60151be491b99057a6f398874c78d6624a05ab
parentaff4690d1c6508b1a7d2311edabdeafc73049795 (diff)
webapp: Fix bug setting up ssh repo if the user enters "~/" at the start of the path.
-rw-r--r--Assistant/MakeRemote.hs1
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/Use_a_git_repository_on_the_server_don__39__t_work.mdwn5
3 files changed, 8 insertions, 0 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs
index 6cd542231..17020c62a 100644
--- a/Assistant/MakeRemote.hs
+++ b/Assistant/MakeRemote.hs
@@ -49,6 +49,7 @@ makeSshRemote forcersync sshdata mcost = do
h = sshHostName sshdata
d
| T.pack "/" `T.isPrefixOf` sshDirectory sshdata = sshDirectory sshdata
+ | T.pack "~/" `T.isPrefixOf` sshDirectory sshdata = T.concat [T.pack "/", sshDirectory sshdata]
| otherwise = T.concat [T.pack "/~/", sshDirectory sshdata]
{- Runs an action that returns a name of the remote, and finishes adding it. -}
diff --git a/debian/changelog b/debian/changelog
index b465fac5e..ee1e2100a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ git-annex (4.20130622) UNRELEASED; urgency=low
server.
* webapp: Ensure that ssh keys generated for different directories
on a server are always different.
+ * webapp: Fix bug setting up ssh repo if the user enters "~/" at the start
+ of the path.
-- Joey Hess <joeyh@debian.org> Fri, 21 Jun 2013 13:16:17 -0400
diff --git a/doc/bugs/Use_a_git_repository_on_the_server_don__39__t_work.mdwn b/doc/bugs/Use_a_git_repository_on_the_server_don__39__t_work.mdwn
index a2fa6a9e5..1bb985891 100644
--- a/doc/bugs/Use_a_git_repository_on_the_server_don__39__t_work.mdwn
+++ b/doc/bugs/Use_a_git_repository_on_the_server_don__39__t_work.mdwn
@@ -42,3 +42,8 @@ git and git-annex are available on the Remote Server
> `mangleSshHostName` would need to be changed to generate different mangled
> hostnames in all cases. Currently, it skips non-alpha-numeric
> characters in the directory. [[done]] --[[Joey]]
+> --[[Joey]]
+>
+> Additionally, just entering a path starting with "~/" would cause this
+> error, since the webapp tacks on "/~/" to make a relative path absolute.
+> I've also fixed that. [[done]] --[[Joey]]