ADD_DEFINITIONS("-DAPI_VERSION=\"$(API_VERSION)\"")
ADD_DEFINITIONS("-DSMACK_ENABLED")
-#ADD_DEFINITIONS("-DASKUSER_ENABLED")
+ADD_DEFINITIONS("-DASKUSER_ENABLED")
OPTION(DPL_WITH_DLOG "DPL DLOG backend" ON)
OPTION(DPL_WITH_SYSTEMD_JOURNAL "DPL systemd-journal backend" OFF)
const std::string &label,
const std::string &user,
const std::vector<std::string> &privileges,
- std::function <bool(const std::string &)> isPrivacy)
+ std::function <bool(const std::string &, const std::string &)> isPrivacy)
{
auto calcPolicies = [&](
const std::string &user,
std::vector<std::string> privacyPrivileges;
for (auto &p : privileges)
- if (isPrivacy(p))
+ if (isPrivacy(label, p))
privacyPrivileges.push_back(p);
// 2nd, performing operation on PRIVACY_MANAGER bucket for all affected users
}
void CynaraAdmin::UserInit(uid_t uid, security_manager_user_type userType,
- std::function <bool(const std::string &)> isPrivacy)
+ std::function <bool(const std::string &, const std::string &)> isPrivacy)
{
Bucket bucket;
std::vector<CynaraAdminPolicy> policies;
CYNARA_ADMIN_ANY, appPolicies);
for (CynaraAdminPolicy &policy : appPolicies)
- if (isPrivacy(policy.privilege))
+ if (isPrivacy(policy.client, policy.privilege))
policies.push_back(CynaraAdminPolicy(policy.client,
userStr,
policy.privilege,
*/
void UpdateAppPolicy(const std::string &label, const std::string &user,
const std::vector<std::string> &privileges,
- std::function <bool(const std::string &)> isPrivacy);
+ std::function <bool(const std::string &, const std::string &)> isPrivacy);
/**
* Fetch Cynara policies for the application and the user.
* @param isPrivacy a function that checks if privilege is privacy-related
*/
void UserInit(uid_t uid, security_manager_user_type userType,
- std::function <bool(const std::string &)> isPrivacy);
+ std::function <bool(const std::string &, const std::string &)> isPrivacy);
/**
* List all users registered in Cynara
static bool isSharedRO(const pkg_paths& paths);
- static bool isPrivilegePrivacy(const std::string &privilege);
+ static bool isPrivilegePrivacy(const std::string &clientLabel, const std::string &privilege);
int squashDropPrivateSharing(const std::string &ownerAppName,
const std::string &targetAppName,
}
}
-bool ServiceImpl::isPrivilegePrivacy(const std::string &privilege)
+bool ServiceImpl::isPrivilegePrivacy(const std::string &clientLabel, const std::string &privilege)
{
if (Config::IS_ASKUSER_ENABLED) {
- int ret = privilege_info_is_privacy(privilege.c_str());
+ int ret = privilege_info_is_privacy2(clientLabel.c_str(), privilege.c_str());
if (ret == 1)
return true;
if (ret != 0)