Hi,
OpenSSH resolves symlinks for SSH_FXP_REALPATH calls (without failing if the symlink is broken), see here.
We simply return a cleaned path without resolving any symbolic links. This is what the v3 specs literally say (v6 has more details):
The SSH_FXP_REALPATH request can be used to have the server
canonicalize any given path name to an absolute path. This is useful
for converting path names containing ".." components or relative
pathnames without a leading slash into absolute paths
If we want to behave like OpenSSH I think we can use os.Lstat and os.Readlink for our server implementation.
For request-server it is more tricky, we would have to generate Lstat and Readlink calls ourself. Maybe we can just document our realpath behaviour and remove the depracation notice from RealPathFileLister. Request server users can implement RealPathFileLister if they want to resolve symlinks. What do you think about? Thanks
Hi,
OpenSSH resolves symlinks for
SSH_FXP_REALPATHcalls (without failing if the symlink is broken), see here.We simply return a cleaned path without resolving any symbolic links. This is what the v3 specs literally say (v6 has more details):
If we want to behave like OpenSSH I think we can use
os.Lstatandos.Readlinkfor our server implementation.For request-server it is more tricky, we would have to generate
LstatandReadlinkcalls ourself. Maybe we can just document our realpath behaviour and remove the depracation notice from RealPathFileLister. Request server users can implement RealPathFileLister if they want to resolve symlinks. What do you think about? Thanks