Skip to content

fix(xfreerdp): try --list-kbd as last resort #1380

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

yedayak
Copy link
Collaborator

@yedayak yedayak commented May 11, 2025

This is the only option that seems to work in xfreerdp 1.0.2, which is what comes with ubuntu 14.04.

Follow up to #1373

@yedayak
Copy link
Collaborator Author

yedayak commented May 11, 2025

🟢

Copy link
Collaborator

@akinomyoga akinomyoga left a comment

Choose a reason for hiding this comment

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

OK, but is FreeRDP/FreeRDP@9295838 the relevant commit? I'm not sure how this change affected the actual behavior of the command.

@akinomyoga
Copy link
Collaborator

akinomyoga commented May 11, 2025

I guess FreeRDP/FreeRDP@30275e7 is the commit, but I'm now unsure whether dropping the support for the POSIX style --kbd-list (in favor of /kbd-list) was the intended change. Although /kbd-list and --kbd-list were deprecated after that, valid options such as /list:timezones and --list timezones are still affected. There don't seem to be any mentions of this change in official documents.

First of all, the core part of the command-line parsing in FreeRDP seems to be performed by CommandLineParseArgumentsA. When COMMAND_LINE_SIGIL_DOUBLE_DASH (0x00000008) is specified to the flag parameter, it processes the double-dash syntax.

The current upstream FreeRDP still seems to accept both Windows and POSIX forms of the command options basically. The command-line parsing is performed by freerdp_client_settings_parse_command_line_arguments_int:

  1. This function calls another function freerdp_client_detect_command_line, where parsing of both the windows and posix styles of options is attempted. It even says the POSIX style is default.
  2. Then, if freerdp_client_detect_command_line doesn't detect any compatibility issue, it finally calls CommandLineParseArgumentsA with flags determined by freerdp_client_detect_command_line.

The problem is that in freerdp_client_settings_command_line_status_print_ex, before processing status-report command-line options, CommandLineParseArgumentsA is called again with a fixed flags (0x112) (which doesn't include COMMAND_LINE_SIGIL_DOUBLE_DASH). This extra command-parsing was introduced by the mentioned commit, which is associated with PR FreeRDP/FreeRDP#5707, a fix for FreeRDP/FreeRDP#5695. However, they don't seem to have discussed anything about the change in the Windows/POSIX styles of the command-line parsing.

This is the only option that seems to work in xfreerdp 1.0.2, which is
what comes with ubuntu 14.04.

Follow up to scop#1373
@yedayak yedayak force-pushed the xfreerdp-list-kbd-fix branch from 95821e8 to 34c1d89 Compare May 14, 2025 17:56
@yedayak
Copy link
Collaborator Author

yedayak commented May 14, 2025

I fixed the commit mentioned, and added a link to your comment. How does it look?

Copy link
Collaborator

@akinomyoga akinomyoga left a comment

Choose a reason for hiding this comment

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

Thank you for updating! LGTM

@yedayak yedayak merged commit 721fa87 into scop:main May 14, 2025
7 checks passed
@akinomyoga
Copy link
Collaborator

I asked the upstream about the intent of re-parsing the command line with 0x112:

https://sourceforge.net/p/freerdp/mailman/message/59183920/

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.

2 participants