forked from mirrors/rustdesk
Add advanced option to allow CLI settings when custom client toggles Disable settings (#15138)
This commit is contained in:
parent
d59d543ec1
commit
caadd72ab2
2 changed files with 12 additions and 4 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 822701e416a60c97e6f3b23bb0bfa84a2177c57f
|
||||
Subproject commit 2e9f641101c6bfbd1f4ca42a249bef7c14e52f5b
|
||||
|
|
@ -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::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue