data_control->trusted = strdup(control.trusted().c_str());
else
data_control->trusted = strdup("false");
-
- std::shared_ptr<const tpk::parse::PrivilegesInfo> priv_info =
- std::static_pointer_cast<const tpk::parse::PrivilegesInfo>(
- control.privileges());
-
- const auto& privileges = priv_info->GetPrivileges();
- for (auto& priv : privileges) {
- privilege_x* privilege =
- reinterpret_cast<privilege_x*>(calloc(1, sizeof(privilege_x)));
- if (!privilege)
- return false;
- privilege->value = strdup(priv.first.c_str());
- privilege->type = strdup(priv.second.c_str());
+ for (const auto& priv : control.privileges())
data_control->privileges = g_list_append(data_control->privileges,
- privilege);
- }
+ strdup(priv.c_str()));
app->datacontrol = g_list_append(app->datacontrol, data_control);
}