-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send unsupported error on extended packets.
Following the rules outlined here: https://tools.ietf.org/html/draft-ietf-secsh-filexfer-extensions-00 Return an SSH_FXP_STATUS with appropriate status error for extended packets that we do not support.
- Loading branch information
Showing
5 changed files
with
49 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -874,10 +874,18 @@ type sshFxpExtendedPacket struct { | |
} | ||
} | ||
|
||
func (p sshFxpExtendedPacket) id() uint32 { return p.ID } | ||
func (p sshFxpExtendedPacket) readonly() bool { return p.SpecificPacket.readonly() } | ||
func (p sshFxpExtendedPacket) id() uint32 { return p.ID } | ||
func (p sshFxpExtendedPacket) readonly() bool { | ||
if p.SpecificPacket == nil { | ||
return true | ||
} | ||
return p.SpecificPacket.readonly() | ||
} | ||
|
||
func (p sshFxpExtendedPacket) respond(svr *Server) error { | ||
if p.SpecificPacket == nil { | ||
return nil | ||
} | ||
return p.SpecificPacket.respond(svr) | ||
} | ||
|
||
|
@@ -897,7 +905,7 @@ func (p *sshFxpExtendedPacket) UnmarshalBinary(b []byte) error { | |
case "[email protected]": | ||
p.SpecificPacket = &sshFxpExtendedPacketPosixRename{} | ||
default: | ||
return errUnknownExtendedPacket | ||
return errors.Wrapf(errUnknownExtendedPacket, "packet type %v", p.SpecificPacket) | ||
} | ||
|
||
return p.SpecificPacket.UnmarshalBinary(bOrig) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters