fix: exclusive serial port lock prevents USB port theft

The mux now acquires an flock-based exclusive lock on the serial port
before opening it. This prevents bridges or other processes from directly
opening the same device while the mux owns it. The lock is held for the
duration of the dongle session and auto-released on disconnect or crash.
This commit is contained in:
swaits committed 2026-04-07 18:04:52 -06:00
1 parent 903729ccbe
commit f867383b12
4 files changed
+50 -8

No files matched your search

Generated
+3 -3
View File
@@ -161,9 +161,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "donglora-client"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1936935d31ab56a8cd70ceecfd6d447f2628a73a123e1cfe37ee4987eab0fa70"
checksum = "343d750fe1e5dad94d4b31e6dbbb05214b39e66f3c94a2ff2a29b0031ffd2826"
dependencies = [
"anyhow",
"serialport",
@@ -173,7 +173,7 @@ dependencies = [
[[package]]
name = "donglora-mux"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"anyhow",
"clap",