From 3f1522e84bb1bdeed9ddaf8f6d0b452b7522038f Mon Sep 17 00:00:00 2001 From: lizhipeng Date: Fri, 24 Apr 2026 02:30:38 -0400 Subject: [PATCH] enhance object_patch generation for cases where the vendor is null, the length of the model serial is zero fix:https://github.com/storaged-project/udisks/issues/1507 Signed-off-by: lizhipeng --- src/udiskslinuxdriveobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/udiskslinuxdriveobject.c b/src/udiskslinuxdriveobject.c index 71b73fe1d..62eca1238 100644 --- a/src/udiskslinuxdriveobject.c +++ b/src/udiskslinuxdriveobject.c @@ -258,7 +258,8 @@ udisks_linux_drive_object_constructed (GObject *_object) strip_and_replace_with_uscore (model); strip_and_replace_with_uscore (serial); str = g_string_new ("/org/freedesktop/UDisks2/drives/"); - if (vendor == NULL && model == NULL && serial == NULL) + if ((vendor == NULL && model == NULL && serial == NULL) || + (vendor == NULL && strlen (model) == 0 && strlen (serial) == 0)) { g_string_append (str, "drive"); }