]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidparse: only report type/version for DCE variant
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 17 Apr 2024 07:27:08 +0000 (09:27 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 17 Apr 2024 07:32:12 +0000 (09:32 +0200)
The type/version is only defined in scope for the DCE variant.

From RFC4122 Section 4.1.1:

"the interpretation of all other bits in the UUID depends on the setting
of the bits in the variant field."

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
misc-utils/uuidparse.c
tests/expected/uuid/uuidparse

index 2dd7fb3888ffeb089e6c3f5efe30b7078619badf..33d961c922cd123621826990e33212c048f3990e 100644 (file)
@@ -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))
index 8b23a254875a5d6b346456d277a2594e02a6cd1a..5cac36755980ea151b9d1e3dd8852966506943a1 100644 (file)
@@ -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