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

override keyboard infomation #1950 (1st) #1952

Merged
merged 2 commits into from Aug 31, 2021

Conversation

TOMATO-ONE
Copy link
Contributor

This is a PR for Discussions #1950.
In this discussion we are considering several issues.

This is the first one.

add an option to force the RDP Client to overwrite any keyboard information sent to it with the specified value for debugging purposes.

I welcome suggestions for corrections to redundant code or confusing comments.

@TOMATO-ONE TOMATO-ONE force-pushed the xrdp_allow_overrite_keyboard branch from 7b7ed43 to 28a6de1 Compare July 23, 2021 15:33
@TOMATO-ONE TOMATO-ONE marked this pull request as draft July 30, 2021 14:10
Copy link
Member

@matt335672 matt335672 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @TOMATO-ONE. Thanks for this. Sorry it took a while to get to it.

libxrdp/xrdp_sec.c Show resolved Hide resolved
@@ -172,9 +183,12 @@ struct xrdp_client_info

int enable_token_login;
char domain_user_separator[16];

/* xrdp.overrode_* values */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small point. xrdp.override_* rather than xrdp.overrode_*.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a typo. Sorry.
I will correct it.

Comment on lines 410 to 417
if ((ko->type | ko->subtype | ko->layout) != 0)
{
LOG(LOG_LEVEL_INFO, "xrdp_load_keyboard_layout: Overrode keyboard"
" infomation, keyboard_type:[0x%02X], keyboard_subtype:[0x%02X],"
" keylayout:[0x%08X]",
client_info->keyboard_type, client_info->keyboard_subtype,
client_info->keylayout);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest removing 410-417 entirely, and making the preceding messages LOG_LEVEL_INFO. You've already logged the client info at line 380-384. The override messages should also be at LOG_LEVEL_INFO level so we get a complete picture of the keyboard layout variables when running at LOG_LEVEL_INFO.

Otherwise we're just duplicating information when running at LOG_LEVEL_DEBUG.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.
I was adding this for future code additions.
I've changed my mind and will remove lines 410-417.

I will change the override message to LOG_LEVEL_INFO.

Comment on lines 42 to 44
int original_type;
int original_subtype;
int original_layout;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the original_* values are needed(?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had added it in case the original client information was needed after the override.
This is not needed for this PR and will be removed.

common/xrdp_client_info.h Show resolved Hide resolved
@TOMATO-ONE TOMATO-ONE marked this pull request as ready for review August 8, 2021 13:53
Copy link
Member

@matt335672 matt335672 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TOMATO-ONE - thank you. That looks fine to me now.

@matt335672
Copy link
Member

@metalefty - when you get a moment can you look at this? It looks like it should be useful for debugging keyboard issues.

One thing which occurs to me is that tf we merge it for 0.9.17 we'll need to update xorgxrdp too, as the client_info has changed. At the moment that isn't necessary.

client_info->keyboard_type, client_info->keyboard_subtype,
client_info->keylayout);

if (ko->type != 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found a bug in this part.

In xrdp.ini, put the following.
xrdp.override_keyboard_type.type = 0x00

In this case, for this if statement
It will not override client_info->keyboard_type .

The same is true for the next two.

@TOMATO-ONE
Copy link
Contributor Author

TOMATO-ONE commented Aug 15, 2021

I set the initial value of the variable client_info->xrdp_keyboard_overrides.* to -1.

Please advise if there is a better way.

@matt335672
Copy link
Member

I think that's a good a way as any other.

@metalefty
Copy link
Member

LGTM. Needs to be triaged whether to include it in 0.9.17 or not.

@TOMATO-ONE
Copy link
Contributor Author

@matt335672 @metalefty
Thank you for being so busy with the release!

This PR is part of the discussion #1950.
So I understand that this PR will be triaged.
On the other hand, I think this PR could stand alone to help resolve issues like issue #1944 and #1576.

Either way, I respect the thoughts of the team.

@matt335672
Copy link
Member

I'm happy for this to go in to 0.9.17. As it stands, it doesn't cause any changes in behaviour that I can determine, so I see it as very low risk.

@metalefty metalefty added this to the v0.9.17 milestone Aug 23, 2021
@metalefty metalefty merged commit 6207679 into neutrinolabs:devel Aug 31, 2021
@metalefty metalefty mentioned this pull request Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants