aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2024-04-18 09:08:21 +0200
committerKarel Zak <kzak@redhat.com>2024-04-18 09:08:21 +0200
commitf9c1fa2935817da26bfe7ba7efd9e389ddda0e05 (patch)
treed36c2a319e2153a070dac077e3e520e7fe3e5055
parent532865fce9c521aea09e43b948a42985fbb3249a (diff)
parent72e7b345e216bb1b4ca7294813fa4b5054358242 (diff)
downloadutil-linux-f9c1fa2935817da26bfe7ba7efd9e389ddda0e05.tar.gz
Merge branch 'uuid/variant' of https://github.com/t-8ch/util-linux
* 'uuid/variant' of https://github.com/t-8ch/util-linux: uuidparse: only report type/version for DCE variant
-rw-r--r--misc-utils/uuidparse.c2
-rw-r--r--tests/expected/uuid/uuidparse42
2 files changed, 23 insertions, 21 deletions
diff --git a/misc-utils/uuidparse.c b/misc-utils/uuidparse.c
index 2dd7fb3888..33d961c922 100644
--- a/misc-utils/uuidparse.c
+++ b/misc-utils/uuidparse.c
@@ -191,6 +191,8 @@ static void fill_table_row(struct libscols_table *tb, char const *const uuid)
str = xstrdup(_("invalid"));
break;
}
+ if (variant != UUID_VARIANT_DCE)
+ break;
switch (type) {
case UUID_TYPE_DCE_NIL:
if (uuid_is_null(buf))
diff --git a/tests/expected/uuid/uuidparse b/tests/expected/uuid/uuidparse
index 8b23a25487..5cac367559 100644
--- a/tests/expected/uuid/uuidparse
+++ b/tests/expected/uuid/uuidparse
@@ -1,31 +1,31 @@
UUID VARIANT TYPE TIME
-00000000-0000-0000-0000-000000000000 NCS nil
-00000000-0000-1000-0000-000000000000 NCS time-based
-00000000-0000-2000-0000-000000000000 NCS DCE
-00000000-0000-3000-0000-000000000000 NCS name-based
-00000000-0000-4000-0000-000000000000 NCS random
-00000000-0000-5000-0000-000000000000 NCS sha1-based
-00000000-0000-6000-0000-000000000000 NCS unknown
+00000000-0000-0000-0000-000000000000 NCS
+00000000-0000-1000-0000-000000000000 NCS
+00000000-0000-2000-0000-000000000000 NCS
+00000000-0000-3000-0000-000000000000 NCS
+00000000-0000-4000-0000-000000000000 NCS
+00000000-0000-5000-0000-000000000000 NCS
+00000000-0000-6000-0000-000000000000 NCS
00000000-0000-0000-8000-000000000000 DCE unknown
00000000-0000-2000-8000-000000000000 DCE DCE
00000000-0000-3000-8000-000000000000 DCE name-based
00000000-0000-4000-8000-000000000000 DCE random
00000000-0000-5000-8000-000000000000 DCE sha1-based
00000000-0000-6000-8000-000000000000 DCE unknown
-00000000-0000-0000-d000-000000000000 Microsoft unknown
-00000000-0000-1000-d000-000000000000 Microsoft time-based
-00000000-0000-2000-d000-000000000000 Microsoft DCE
-00000000-0000-3000-d000-000000000000 Microsoft name-based
-00000000-0000-4000-d000-000000000000 Microsoft random
-00000000-0000-5000-d000-000000000000 Microsoft sha1-based
-00000000-0000-6000-d000-000000000000 Microsoft unknown
-00000000-0000-0000-f000-000000000000 other unknown
-00000000-0000-1000-f000-000000000000 other time-based
-00000000-0000-2000-f000-000000000000 other DCE
-00000000-0000-3000-f000-000000000000 other name-based
-00000000-0000-4000-f000-000000000000 other random
-00000000-0000-5000-f000-000000000000 other sha1-based
-00000000-0000-6000-f000-000000000000 other unknown
+00000000-0000-0000-d000-000000000000 Microsoft
+00000000-0000-1000-d000-000000000000 Microsoft
+00000000-0000-2000-d000-000000000000 Microsoft
+00000000-0000-3000-d000-000000000000 Microsoft
+00000000-0000-4000-d000-000000000000 Microsoft
+00000000-0000-5000-d000-000000000000 Microsoft
+00000000-0000-6000-d000-000000000000 Microsoft
+00000000-0000-0000-f000-000000000000 other
+00000000-0000-1000-f000-000000000000 other
+00000000-0000-2000-f000-000000000000 other
+00000000-0000-3000-f000-000000000000 other
+00000000-0000-4000-f000-000000000000 other
+00000000-0000-5000-f000-000000000000 other
+00000000-0000-6000-f000-000000000000 other
9b274c46-544a-11e7-a972-00037f500001 DCE time-based 2017-06-18 17:21:46,544647+00:00
invalid-input invalid invalid invalid
return value: 0