Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a SharedDirectoryAnnounce incompatibility #25931

Merged
merged 4 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/srv/desktop/tdp/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,16 @@ func (s SharedDirectoryAnnounce) Encode() ([]byte, error) {
}

func decodeSharedDirectoryAnnounce(in io.Reader) (SharedDirectoryAnnounce, error) {
// TODO(isaiah): The completionID here is a copy-paste error, but we need to keep it
// for now in order that the proxy stay compatible with previous versions of the wds.
var completionID uint32
ibeckermayer marked this conversation as resolved.
Show resolved Hide resolved
err := binary.Read(in, binary.BigEndian, &completionID)
if err != nil {
return SharedDirectoryAnnounce{}, trace.Wrap(err)
}

var directoryID uint32
err := binary.Read(in, binary.BigEndian, &directoryID)
err = binary.Read(in, binary.BigEndian, &directoryID)
if err != nil {
return SharedDirectoryAnnounce{}, trace.Wrap(err)
}
Expand Down
4 changes: 4 additions & 0 deletions web/packages/teleport/src/lib/tdp/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ export type MfaJson = {
};

// | message type (11) | completion_id uint32 | directory_id uint32 | name_length uint32 | name []byte |
// TODO(isaiah): The completionId here is a copy-paste error, but we need to keep it
// for now in order that the proxy stay compatible with previous versions of the wds.
export type SharedDirectoryAnnounce = {
completionId: number;
directoryId: number;
Expand Down Expand Up @@ -601,6 +603,8 @@ export default class Codec {
let offset = 0;

view.setUint8(offset++, MessageType.SHARED_DIRECTORY_ANNOUNCE);
// TODO(isaiah): The completionId here is a copy-paste error, but we need to keep it
// for now in order that the proxy stay compatible with previous versions of the wds.
view.setUint32(offset, sharedDirAnnounce.completionId);
offset += uint32Length;
view.setUint32(offset, sharedDirAnnounce.directoryId);
Expand Down