mirror of https://github.com/pkg/sftp.git
add NOTEs everywhere symlink target/linkpath vs sftp.Request.Filepath and sfftp.Request.Target come up
This commit is contained in:
parent
42f3825de9
commit
8ae3feeb9f
|
|
@ -159,6 +159,7 @@ func (fs *root) Filecmd(r *Request) error {
|
|||
return fs.link(r.Filepath, r.Target)
|
||||
|
||||
case "Symlink":
|
||||
// NOTE: r.Filepath is the target, and r.Target is the linkpath.
|
||||
return fs.symlink(r.Filepath, r.Target)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ func requestFromPacket(ctx context.Context, pkt hasPath) *Request {
|
|||
case *sshFxpRenamePacket:
|
||||
request.Target = cleanPath(p.Newpath)
|
||||
case *sshFxpSymlinkPacket:
|
||||
// NOTE: given a POSIX compliant signature: symlink(target, linkpath string)
|
||||
// this makes Request.Target the linkpath, and Request.Filepath the target.
|
||||
request.Target = cleanPath(p.Linkpath)
|
||||
case *sshFxpExtendedPacketHardlink:
|
||||
request.Target = cleanPath(p.Newpath)
|
||||
|
|
|
|||
Loading…
Reference in New Issue