From 0943bd50db777a1f0566c936e7832c39a2192ffe Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Tue, 21 Oct 2025 15:34:30 +0200 Subject: [PATCH] lvm-dbus: Show better error for invalid LVM IDs LVM DBus uses assert to check for empty IDs so it produces error which isn't easy to decipher. --- src/plugins/lvm/lvm-dbus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/lvm/lvm-dbus.c b/src/plugins/lvm/lvm-dbus.c index 197dcd123..877a72a58 100644 --- a/src/plugins/lvm/lvm-dbus.c +++ b/src/plugins/lvm/lvm-dbus.c @@ -924,6 +924,12 @@ static GVariant* get_lvm_object_properties (const gchar *obj_id, const gchar *if GVariant *ret = NULL; gchar *obj_path = NULL; + if (!obj_id || g_strcmp0 (obj_id, "") == 0) { + g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_NOEXIST, + "Invalid LVM ID specified"); + return NULL; + } + args = g_variant_new ("(s)", obj_id); /* consumes (frees) the 'args' parameter */ ret = g_dbus_connection_call_sync (bus, LVM_BUS_NAME, MANAGER_OBJ, MANAGER_INTF,