}
SECURITY_MANAGER_API
+int security_manager_identify_app_from_cynara_client(const char *client, char **pkg_name,
+ char **app_name)
+{
+ return try_catch([&] {
+ LogDebug(__PRETTY_FUNCTION__ << " called");
+
+ if (pkg_name == NULL && app_name == NULL) {
+ LogError("Both pkg_name and app_name are NULL");
+ return SECURITY_MANAGER_ERROR_INPUT_PARAM;
+ }
+ return get_app_and_pkg_id_from_smack_label(client, pkg_name, app_name);
+ });
+}
+
+SECURITY_MANAGER_API
int security_manager_app_has_privilege(const char *app_name, const char *privilege,
uid_t uid, int *result)
{
int security_manager_identify_app_from_pid(pid_t pid, char **pkg_id, char **app_id);
/**
+ * Get package and application id of an application with given process Cynara client identifier
+ *
+ * On successful call pkg_id and app_id should be freed when caller is done with them.
+ * Both pkg_id and app_id are allocated with malloc() so they should be freed with free() function.
+ * Either app_id or pkg_id may be NULL. NULL-ed argument will be ignored.
+ * If both app_id and pkg_id are NULL then SECURITY_MANAGER_ERROR_INPUT_PARAM will be returned.
+ * When process identifier is incorrect or not related to any package, this function will
+ * return SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT.
+ *
+ *
+ * \param[in] client Application Cynara client identifier
+ * \param[out] pkg_id Package id of the application
+ * \param[out] app_id Application id of the application
+ * \return API return code or error code
+ */
+int security_manager_identify_app_from_cynara_client(const char *client, char **pkg_id,
+ char **app_id);
+/**
* Check whether an application would have access to a privilege
*
* This enables queries for application's privileges when there is no application