Skip to content

Commit 6f34587

Browse files
authored
fix(single-instance): disable dbus name replacement (#2860)
1 parent 708fa4e commit 6f34587

File tree

4 files changed

+20
-37
lines changed

4 files changed

+20
-37
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"single-instance": patch
3+
---
4+
5+
Fix D-Bus name replacement logic on Linux to prevent multiple instances from acquiring the same well-known name.
6+
This patch updates the `zbus` dependency to the latest compatible version (`^5.9`) and explicitly sets `RequestNameFlags` to ensure a second instance fails to acquire the D-Bus name when another one is already running.

Cargo.lock

Lines changed: 11 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ schemars = "0.8"
2323
dunce = "1"
2424
specta = "^2.0.0-rc.16"
2525
glob = "0.3"
26-
zbus = "5"
26+
zbus = "5.9"
2727

2828
[workspace.package]
2929
edition = "2021"

plugins/single-instance/src/platform_impl/linux.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
6161
.unwrap()
6262
.name(dbus_name.as_str())
6363
.unwrap()
64+
.replace_existing_names(false)
65+
.allow_name_replacements(false)
6466
.serve_at(dbus_path.as_str(), single_instance_dbus)
6567
.unwrap()
6668
.build()

0 commit comments

Comments
 (0)