fix security problem caused server hang and unexpected input behavior at pre-login window when macOS version on Big Sur or above

This commit is contained in:
chenbaiyu 2022-01-08 01:39:54 +08:00
parent 089acaa6e7
commit 29f15aabed
2 changed files with 7 additions and 5 deletions

4
.cargo/config.toml Normal file
View File

@ -0,0 +1,4 @@
[target.'cfg(target_os="macos")']
rustflags = [
"-C", "link-args=-sectcreate __CGPreLoginApp __cgpreloginapp /dev/null",
]

View File

@ -904,12 +904,10 @@ async fn start_ipc(
mut rx_to_cm: mpsc::UnboundedReceiver<ipc::Data>, mut rx_to_cm: mpsc::UnboundedReceiver<ipc::Data>,
tx_from_cm: mpsc::UnboundedSender<ipc::Data>, tx_from_cm: mpsc::UnboundedSender<ipc::Data>,
) -> ResultType<()> { ) -> ResultType<()> {
loop { if crate::platform::is_prelogin() {
if !crate::platform::is_prelogin() { return Ok(());
break;
}
sleep(1.).await;
} }
let mut stream = None; let mut stream = None;
if let Ok(s) = crate::ipc::connect(1000, "_cm").await { if let Ok(s) = crate::ipc::connect(1000, "_cm").await {
stream = Some(s); stream = Some(s);