cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0073-blkid-don-t-print-all-devices-if-only-garbage-specif.patch

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