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

QSysInfo::machineUniqueId() returns empty QByteArray on MacOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.12.2, 5.13.0
    • 5.11, 5.12.1, 5.12
    • Core: Other
    • None
    • MacOS 10.14.3
    • macOS
    • 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

            thiago Thiago Macieira
            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