});
}
+SECURITY_MANAGER_API
+int security_manager_self_is_app(bool *app)
+{
+ if (!app)
+ return SECURITY_MANAGER_ERROR_INPUT_PARAM;
+ char * pkgId = NULL;
+ int ret = security_manager_identify_app_from_pid(getpid(), &pkgId, NULL);
+
+ *app = SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT != ret && pkgId;
+
+ if (pkgId)
+ free(pkgId);
+
+ if (ret != SECURITY_MANAGER_SUCCESS && ret != SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT)
+ // its neither an app nor not-app, something went wrong in the process
+ return SECURITY_MANAGER_ERROR_UNKNOWN;
+
+ return SECURITY_MANAGER_SUCCESS;
+}
+
SECURITY_MANAGER_API
int security_manager_identify_app_from_cynara_client(const char *client, char **pkg_name,
char **app_name)
*/
int security_manager_identify_app_from_pid(pid_t pid, char **pkg_id, char **app_id);
+/**
+ * Return true or false depending the caller being an app or not.
+ * Function checks attributes of process in /proc and maps it to an app or other process.
+ *
+ * \param[out] app returned boolean value; must not be null
+ * \return SECURITY_MANAGER_SUCCESS or error code
+ */
+int security_manager_self_is_app(bool *app);
+
/**
* Get package and application id of an application with given process Cynara client identifier
*