}
bool ValidatePrivilegeLevel(common_installer::PrivilegeLevel level,
- const char* api_version, GList* privileges,
+ uid_t uid, const char* api_version, GList* privileges,
std::string* error_message) {
if (level == common_installer::PrivilegeLevel::UNTRUSTED) {
if (privileges) {
int status = PRVMGR_ERR_NONE;
// Do the privilege check only if the package has privileges
if (pair.first) {
- status = privilege_manager_verify_privilege(api_version,
+ status = privilege_manager_verify_privilege(uid, api_version,
pair.second ? PRVMGR_PACKAGE_TYPE_WRT : PRVMGR_PACKAGE_TYPE_CORE,
pair.first, PrivilegeLevelToVisibility(level), &error);
}
#include <boost/filesystem/path.hpp>
#include <privilege_manager.h>
+#include <sys/types.h>
#include <vcore/SignatureData.h>
#include <vcore/SignatureFinder.h>
bool check_reference, std::string* error_message);
bool ValidatePrivilegeLevel(common_installer::PrivilegeLevel level,
- const char* api_version, GList* privileges,
- std::string* error_message);
+ uid_t uid, const char* api_version, GList* privileges,
+ std::string* error_message);
} // namespace common_installer
Step::Status StepCheckSignature::CheckPrivilegeLevel(PrivilegeLevel level) {
std::string error_message;
if (!context_->is_preload_request.get()) {
- if (!ValidatePrivilegeLevel(level,
+ if (!ValidatePrivilegeLevel(level, context_->uid.get(),
context_->manifest_data.get()->api_version,
context_->manifest_data.get()->privileges, &error_message)) {
if (!error_message.empty()) {