From 6565b9d0b1bc6074a3b66abd14679fa7bd601fc3 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 15 Nov 2023 13:56:50 +0100 Subject: [PATCH] sd-bus: don't treat invalid user/machine as a programming error $ SYSTEMD_LOG_LEVEL=debug machinectl status --machine=@ Assertion 'r > 0' failed at src/libsystemd/sd-bus/sd-bus.c:1694, function sd_bus_open_system_machine(). Ignoring. --- src/libsystemd/sd-bus/sd-bus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index ced4466..4a0259f 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -1698,8 +1698,8 @@ _public_ int sd_bus_open_system_machine(sd_bus **ret, const char *user_and_machi r = user_and_machine_valid(user_and_machine); if (r < 0) return r; - - assert_return(r > 0, -EINVAL); + if (r == 0) + return -EINVAL; r = sd_bus_new(&b); if (r < 0) @@ -1734,8 +1734,8 @@ _public_ int sd_bus_open_user_machine(sd_bus **ret, const char *user_and_machine r = user_and_machine_valid(user_and_machine); if (r < 0) return r; - - assert_return(r > 0, -EINVAL); + if (r == 0) + return -EINVAL; r = sd_bus_new(&b); if (r < 0) -- 2.7.4