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

QSysInfo::machineUniqueId() returns empty QByteArray on MacOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.11, 5.12.1, 5.12
    • Fix Version/s: 5.12.2, 5.13.0
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      MacOS 10.14.3
    • Platform/s:
      macOS
    • Commits:
      0330db86fdd42ef1be1354cdbbd6e0ffc21d9a80

      Description

      the function QSysInfo::machineUniqueId() returns an empty QByteArray on MacOS

      it seems that in the source code file qtbase/src/corelib/global/qglobal.cpp, line 2959, the uuidlen has a length of 36, instead of being 36+1 for the sysctlbyname call

      // Darwin: no fixed value, we need to search by name
      if (sysctlbyname("kern.uuid", uuid, &uuidlen, nullptr, 0) == 0 && uuidlen == sizeof(uuid))
      return QByteArray(uuid, uuidlen - 1);

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes