Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.3
-
None
-
-
0d024bd0a63fa7a741f4f118a3b48806b695594f (qt/qtbase/5.12)
Description
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...
Attachments
For Gerrit Dashboard: QTBUG-75371 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
259523,8 | QSysInfo: Use the Apple IOKit API to get the machine's UUID | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |