dcavalca / 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

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