dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
25f9c8
From aa57abc10273f250a7ab6525bd45dc2bdc5e4b41 Mon Sep 17 00:00:00 2001
25f9c8
From: Karel Zak <kzak@redhat.com>
25f9c8
Date: Mon, 10 Jan 2022 16:32:44 +0100
25f9c8
Subject: [PATCH 73/74] blkid: don't print all devices if only garbage
25f9c8
 specified
25f9c8
25f9c8
There is small regression. The old version (before
25f9c8
64cfe6ac37631a6347bd4005c72dd2d37e737f5e) returns nothing when
25f9c8
25f9c8
  # blkid /dontexist
25f9c8
25f9c8
specified on command line.
25f9c8
25f9c8
Upstream: http://github.com/util-linux/util-linux/commit/9e882685a3db3fd5e0870e7b94a4ea25ddc199c7
25f9c8
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2026511
25f9c8
Signed-off-by: Karel Zak <kzak@redhat.com>
25f9c8
---
25f9c8
 misc-utils/blkid.c | 6 ++++++
25f9c8
 1 file changed, 6 insertions(+)
25f9c8
25f9c8
diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c
25f9c8
index bd4ce4a39..bc0d3465d 100644
25f9c8
--- a/misc-utils/blkid.c
25f9c8
+++ b/misc-utils/blkid.c
25f9c8
@@ -838,6 +838,12 @@ int main(int argc, char **argv)
25f9c8
 
25f9c8
 			devices[numdev++] = dev;
25f9c8
 		}
25f9c8
+
25f9c8
+		if (!numdev) {
25f9c8
+			/* only unsupported devices specified */
25f9c8
+			err = BLKID_EXIT_NOTFOUND;
25f9c8
+			goto exit;
25f9c8
+		}
25f9c8
 	}
25f9c8
 
25f9c8
 	/* convert LABEL/UUID lookup to evaluate request */
25f9c8
-- 
25f9c8
2.31.1
25f9c8