prepare no-register-device

This commit is contained in:
rustdesk
2025-05-23 22:15:31 +08:00
parent 39151531d7
commit 01146574f2
4 changed files with 7 additions and 3 deletions

View File

@@ -454,7 +454,9 @@ pub fn core_main() -> Option<Vec<String>> {
}
return None;
} else if args[0] == "--assign" {
if crate::platform::is_installed() && is_root() {
if config::Config::no_register_device() {
println!("Cannot assign an unregistrable device!");
} else if crate::platform::is_installed() && is_root() {
let max = args.len() - 1;
let pos = args.iter().position(|x| x == "--token").unwrap_or(max);
if pos < max {