Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75371

QSysInfo::machineUniqueId() is not unique on MacOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.12.5, 5.14.0 Alpha
    • 5.12.3
    • Core: Other
    • None
    • macOS
    • 0d024bd0a63fa7a741f4f118a3b48806b695594f (qt/qtbase/5.12)

      the function QSysInfo::machineUniqueId() returns the same value for several computers, and this value changes after each update of the OS

      the source code of the function refers to sysctlbyname("kern.uuid") which seems to returns the uuid of the kernel (kernel version), instead of the uuid of the computer

      I think this code should be better (link to IOKit framework) :

      io_registry_entry_t registryEntry = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
      CFStringRef stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(registryEntry, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
      CFStringGetCString(stringRef, uuid, uuidlen, kCFStringEncodingMacRoman);
      CFRelease(stringRef);
      IOObjectRelease(registryEntry);

       

      and I would like to thank you for your wonderful work on Qt ! It's an amazing platform...

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            filmars Philippe Castell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes