tomaswolf commented on issue #397:
URL: https://github.com/apache/mina-sshd/issues/397#issuecomment-1646207499
At first I was inclined to agree that the normalization should be re-added.
But actually that's not right either. If it was re-added, it would be possible
to do `sftp.mkdir("/does_not_exist/../somedir")` and `/somedir` would be
created. Normalization would remove "/does_not_exist/..".
So I now think that the current behavior is nearly correct, but commands
should check earlier whether the path ends with a slash, and remove it if it is
not significant for the operation. Unfortunately that depends on the operation.
In Unix:
* `mkdir foo/` is the same as `mkdir foo`, but not as `mkdir foo/.` (fails)
and `mkdir does_not_exist/../foo` fails, too.
* `ls -al foo` and `ls -al foo/` are not the same if `foo` is a symlink
pointing to a directory. The first shows information about the symlink, the
second lists the directory contents. (As does `ls -al cfg2/.`)
So fixing the problem reported needs to be done much more carefully.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]