diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-06 00:09:25 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-06 00:09:25 +0900 |
| commit | 92f510a6472064f4e4cb47ffb4f81898fc0a62ae (patch) | |
| tree | 605c40792d2abfa9d129de7117619a992fca88eb | |
| parent | acb6931f3e4af62f92dc2ef85ef7c1ac9f7867e4 (diff) | |
cmd/hakurei/command: pd run dbus-verbose nil check
This otherwise dereferences a nil pointer when dbus-verbose is set and either session or system bus are nil.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | cmd/hakurei/command.go | 8 | ||||
| -rw-r--r-- | test/test.py | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index d706bd21..0ce3b71c 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -162,8 +162,12 @@ func buildCommand(out io.Writer) command.Command { // override log from configuration if dbusVerbose { - config.SessionBus.Log = true - config.SystemBus.Log = true + if config.SessionBus != nil { + config.SessionBus.Log = true + } + if config.SystemBus != nil { + config.SystemBus.Log = true + } } } diff --git a/test/test.py b/test/test.py index 96253534..4240b8f4 100644 --- a/test/test.py +++ b/test/test.py @@ -149,7 +149,7 @@ silent_output_interrupt("--wayland -X --dbus --pulse ") print(machine.fail("sudo -u alice -i hakurei -v run --wayland true")) # Start hakurei permissive defaults within Wayland session: -hakurei('-v run --wayland --dbus notify-send -a "NixOS Tests" "Test notification" "Notification from within sandbox." && touch /tmp/dbus-ok') +hakurei('-v run --wayland --dbus --dbus-log notify-send -a "NixOS Tests" "Test notification" "Notification from within sandbox." && touch /tmp/dbus-ok') machine.wait_for_file("/tmp/dbus-ok", timeout=15) collect_state_ui("dbus_notify_exited") # not in pid namespace, verify termination |
