[client,common] guard /serial argument

only enable if serial redirection support is compiled in
This commit is contained in:
akallabeth 2024-08-26 13:20:51 +02:00
parent d08e44d883
commit 050eef537a
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
2 changed files with 6 additions and 0 deletions

View File

@ -787,6 +787,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, cons
return TRUE;
}
#if defined(CHANNEL_SERIAL_CLIENT)
else if (option_equals(params[0], "serial"))
{
RDPDR_DEVICE* serial = NULL;
@ -812,6 +813,7 @@ BOOL freerdp_client_add_device_channel(rdpSettings* settings, size_t count, cons
return TRUE;
}
#endif
else if (option_equals(params[0], "parallel"))
{
RDPDR_DEVICE* parallel = NULL;
@ -1076,6 +1078,7 @@ static int freerdp_client_command_line_post_filter_int(void* context, COMMAND_LI
if (status)
return fail_at(arg, status);
}
#if defined(CHANNEL_SERIAL_CLIENT)
CommandLineSwitchCase(arg, "serial")
{
size_t count = 0;
@ -1086,6 +1089,7 @@ static int freerdp_client_command_line_post_filter_int(void* context, COMMAND_LI
if (status)
return fail_at(arg, status);
}
#endif
CommandLineSwitchCase(arg, "parallel")
{
size_t count = 0;

View File

@ -415,8 +415,10 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = {
{ "sec-tls", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL,
"[DEPRECATED, use /sec:tls] TLS protocol security" },
#endif
#if defined(CHANNEL_SERIAL_CLIENT)
{ "serial", COMMAND_LINE_VALUE_OPTIONAL, "<name>[,<path>[,<driver>[,permissive]]]", NULL, NULL,
-1, "tty", "Redirect serial device" },
#endif
{ "server-name", COMMAND_LINE_VALUE_REQUIRED, "<name>", NULL, NULL, -1, NULL,
"User-specified server name to use for validation (TLS, Kerberos)" },
{ "shell", COMMAND_LINE_VALUE_REQUIRED, "<shell>", NULL, NULL, -1, NULL, "Alternate shell" },