MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / readLinuxId

Function readLinuxId

app/src/Licensing/MachineID.cpp:67–83  ·  view source on GitHub ↗

* @brief Reads the GNU/Linux machine id from the dbus or systemd store. */

Source from the content-addressed store, hash-verified

65 * @brief Reads the GNU/Linux machine id from the dbus or systemd store.
66 */
67static QString readLinuxId(bool& complete)
68{
69 QProcess process;
70 const auto catTool = resolveSystemTool({"/bin/cat", "/usr/bin/cat"}, "cat");
71 process.start(catTool, {"/var/lib/dbus/machine-id"});
72 awaitTool(process);
73 QString id = process.readAllStandardOutput().trimmed();
74
75 if (id.isEmpty()) {
76 process.start(catTool, {"/etc/machine-id"});
77 awaitTool(process);
78 id = process.readAllStandardOutput().trimmed();
79 }
80
81 complete = !id.isEmpty();
82 return id;
83}
84#endif
85
86#if defined(Q_OS_MAC)

Callers 1

readPlatformIdFunction · 0.85

Calls 4

resolveSystemToolFunction · 0.85
awaitToolFunction · 0.85
isEmptyMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected