webapp: Fix bug setting up ssh repo if the user enters "~/" at the start of the path.

This commit is contained in:
Joey Hess 2013-06-25 15:43:46 -04:00
parent c8e6947693
commit f1fe8edbbb
3 changed files with 8 additions and 0 deletions

View file

@ -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. -}

2
debian/changelog vendored
View file

@ -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

View file

@ -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]]