mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-06-09 18:04:53 +03:00
Add advanced option to allow CLI settings when custom client toggles Disable settings (#15138)
This commit is contained in:
Submodule libs/hbb_common updated: 822701e416...2e9f641101
@@ -432,7 +432,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
}
|
||||
return None;
|
||||
} else if args[0] == "--password" {
|
||||
if config::is_disable_settings() {
|
||||
if is_cli_setting_change_disabled() {
|
||||
println!("Settings are disabled!");
|
||||
return None;
|
||||
}
|
||||
@@ -474,7 +474,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
println!("{}", crate::ipc::get_id());
|
||||
return None;
|
||||
} else if args[0] == "--set-id" {
|
||||
if config::is_disable_settings() {
|
||||
if is_cli_setting_change_disabled() {
|
||||
println!("Settings are disabled!");
|
||||
return None;
|
||||
}
|
||||
@@ -521,7 +521,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
}
|
||||
return None;
|
||||
} else if args[0] == "--option" {
|
||||
if config::is_disable_settings() {
|
||||
if is_cli_setting_change_disabled() {
|
||||
println!("Settings are disabled!");
|
||||
return None;
|
||||
}
|
||||
@@ -967,6 +967,14 @@ fn is_user_main_ipc_scope_cli_command(args: &[String]) -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn is_cli_setting_change_disabled() -> bool {
|
||||
let option = config::keys::OPTION_ALLOW_COMMAND_LINE_SETTINGS_WHEN_SETTINGS_DISABLED;
|
||||
let allow_command_line_settings =
|
||||
config::option2bool(option, &crate::get_builtin_option(option));
|
||||
config::is_disable_settings() && !allow_command_line_settings
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user