Lukas Waldmann commented on SSHD-730:

Lyor, I really can't agree

if you have directories defined as /a/b/c and /a/b/d where c is file and d is 
link "../b/c" than path /a/b/d clearly translates to /a/b/../b/c which equals 
to /a/b/c. There is nothing really elusive about it.

As you said there is no "cwd" so server should always operates on absolute path 
and ".." than still translate to absolute path.

Anyhow, regular unix servers I have tried didn't show the behaviour I see here. 
I will try to write a test so you can try it for yourself




> Relative symbolic links with .. is not resolved properly by sftp readLink
> -------------------------------------------------------------------------
>                 Key: SSHD-730
>                 URL: https://issues.apache.org/jira/browse/SSHD-730
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.2.0, 1.3.0
>            Reporter: Lukas Waldmann
>            Assignee: Goldstein Lyor
>            Priority: Minor
> Using sftp to resolve symbolic links doesn't return proper resolution in case 
> symbolic link contains ..
> Since version 1.1 the sendLink function of SftpSubsystem uses
> normalizedPath = SelectorUtils.normalizePath(unixPath, "/");
> to normalize path
> This function however return invalid path in case link contains ".."
> So for example if link is "../test/file" than normalizePath returns 
> "test/file" which is invalid because in can not be resolved properly in the 
> context of the current directory which symbolic link is referring to.

This message was sent by Atlassian JIRA

Reply via email to