Skip to content

Commit

Permalink
[Linux] fixing problem "Permission denied"; solution taken from BestB…
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitatg committed Jun 29, 2022
1 parent f035392 commit 273519d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ static void platform_device_id_linux_plugin_handle_method_call(
rstream = popen("dmidecode -s system-uuid","r");
fread(buf, sizeof(char), sizeof(buf), rstream);
pclose(rstream);
if(buf[0] == 0) {
rstream = popen("cat /etc/machine-id", "r");
fread(buf, sizeof(char), sizeof(buf), rstream);
pclose(rstream);
}
g_autofree gchar *deviceId = g_strdup_printf("%s", buf);
g_autoptr(FlValue) result = fl_value_new_string(deviceId);
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
Expand Down

0 comments on commit 273519d

Please sign in to comment.