Skip to content

Commit

Permalink
Merge pull request pkg#525 from pkg/document_symlink_packet_weirdness
Browse files Browse the repository at this point in the history
Document the weirdness of the reversal of arguments to SSH_FXP_SYMLINK
  • Loading branch information
drakkan committed Sep 29, 2022
2 parents 6285079 + 975b486 commit 3aa4378
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/encoding/ssh/filexfer/path_packets.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (p *ReadLinkPacket) UnmarshalPacketBody(buf *Buffer) (err error) {
//
// The order of the arguments to the SSH_FXP_SYMLINK method was inadvertently reversed.
// Unfortunately, the reversal was not noticed until the server was widely deployed.
// Covered in Section 3.1 of https://github.com/openssh/openssh-portable/blob/master/PROTOCOL
// Covered in Section 4.1 of https://github.com/openssh/openssh-portable/blob/master/PROTOCOL
type SymlinkPacket struct {
LinkPath string
TargetPath string
Expand Down
7 changes: 6 additions & 1 deletion packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,12 @@ func (p *sshFxpRmdirPacket) UnmarshalBinary(b []byte) error {
}

type sshFxpSymlinkPacket struct {
ID uint32
ID uint32

// The order of the arguments to the SSH_FXP_SYMLINK method was inadvertently reversed.
// Unfortunately, the reversal was not noticed until the server was widely deployed.
// Covered in Section 4.1 of https://github.com/openssh/openssh-portable/blob/master/PROTOCOL

Targetpath string
Linkpath string
}
Expand Down

0 comments on commit 3aa4378

Please sign in to comment.