sftp - How does WinSCP know what a symlink links to when showing directory listings? -
when connect winscp directory contains symlink it'll show it's symlink using different icon. eg. instead of folder it'll folder arrow or such.
my question is... how winscp know symlink symlink folder?
when sftp directory client sends ssh_fxp_readdir
packet. server responds ssh_fxp_name
packet. in testing seems data in packet corresponds lstat - not stat. ie. if , permissions attribute 1111 0000 0000 0000
1010 0000 0000 0000
(symlink) instead of 0100 0000 0000 0000
(directory).
my guess winscp sends out ssh_fxp_stat
each of these symlinks maybe it's doing ssh_fxp_readlink
instead. if latter server respond ssh_fxp_name
- if former server respond ssh_fxp_attrs
(which pretty ssh_fxp_name
1 file instead of x files). again, maybe it's doing else entirely.
remembering winscp uses putty tried see 1 doing creating session putty had "session logging" set "ssh packets". tried connect session winscp no putty.log file created. didn't see in directory had ran putty update session nor did see in c:\program files (x86)\winscp
. have no idea is.
any ideas?
winscp sends both ssh_fxp_stat
, ssh_fxp_readlink
.
the ssh_fxp_stat
find out, if symlink points file or directory.
the ssh_fxp_readlink
find out link target.
see winscp log:
. 2015-07-20 11:00:15.837 listing directory "...". > 2015-07-20 11:00:15.837 type: ssh_fxp_opendir, size: 53, number: 11275 < 2015-07-20 11:00:15.894 type: ssh_fxp_handle, size: 13, number: 11275 > 2015-07-20 11:00:15.894 type: ssh_fxp_readdir, size: 13, number: 11532 < 2015-07-20 11:00:15.950 type: ssh_fxp_name, size: 431, number: 11532 > 2015-07-20 11:00:15.950 type: ssh_fxp_readdir, size: 13, number: 11788 . 2015-07-20 11:00:15.950 reading symlink "link". > 2015-07-20 11:00:15.950 type: ssh_fxp_readlink, size: 58, number: 12051 > 2015-07-20 11:00:15.950 type: ssh_fxp_stat, size: 58, number: 12305 < 2015-07-20 11:00:16.005 type: ssh_fxp_status, size: 28, number: 11788 . 2015-07-20 11:00:16.005 storing reserved response < 2015-07-20 11:00:16.062 type: ssh_fxp_name, size: 41, number: 12051 . 2015-07-20 11:00:16.062 link resolved "target.txt". < 2015-07-20 11:00:16.062 type: ssh_fxp_attrs, size: 37, number: 12305 < 2015-07-20 11:00:16.063 status code: 1 > 2015-07-20 11:00:16.063 type: ssh_fxp_close, size: 13, number: 12548
Comments
Post a Comment