From a8b342aa318d95d043cdff721e80033b82d0b201 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 1 Sep 2022 19:10:50 +0900 Subject: [PATCH] lib: resource-monitor: Remove unneeded privilege check commit fccfb02d128c("lib: resource-monitor: Check systemmonitor privilege") added the unneeded privilege check code. In result, cynara is running by preempting CPU resource. So that remove unneeded privilege check code. Only check the privilege when pass_resource_monitor_init() call. Change-Id: I0a9c7b2ca76a781dcf88ab19ddf0ec597c98b6a5 Signed-off-by: Chanwoo Choi --- lib/resource-monitor/resource-monitor.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/resource-monitor/resource-monitor.c b/lib/resource-monitor/resource-monitor.c index e7b567e..a7ab07e 100644 --- a/lib/resource-monitor/resource-monitor.c +++ b/lib/resource-monitor/resource-monitor.c @@ -128,9 +128,6 @@ static inline int handle_request(struct request_data *data) if (!data) return TIZEN_ERROR_INVALID_PARAMETER; - if (!is_privilege_supported(PRIVILEGE_SYSTEMMONITOR)) - return TIZEN_ERROR_PERMISSION_DENIED; - /* Make buffer with struct request_data according to request */ switch (data->request) { case REQUEST_UPDATE_RESOURCE_ALL: @@ -343,9 +340,6 @@ int pass_resource_monitor_exit(int id) { struct pass_resource_monitor_client *client; - if (!is_privilege_supported(PRIVILEGE_SYSTEMMONITOR)) - return TIZEN_ERROR_PERMISSION_DENIED; - client = find_client_by_id(id); if (!client) { _E("[libpass] cannot find client-%d", id); @@ -518,9 +512,6 @@ static int pass_resource_monitor_get_json(int id, char *json_string, int request char *buffer; va_list args; - if (!is_privilege_supported(PRIVILEGE_SYSTEMMONITOR)) - return TIZEN_ERROR_PERMISSION_DENIED; - buffer = malloc(HUGE_BUFF_MAX + 1); if (!buffer) return TIZEN_ERROR_OUT_OF_MEMORY; @@ -720,9 +711,6 @@ pass_resource_monitor_get_array(int id, int res_id, u_int64_t attr_id, int data_ int response_req; int ret, i; - if (!is_privilege_supported(PRIVILEGE_SYSTEMMONITOR)) - return TIZEN_ERROR_PERMISSION_DENIED; - buffer = malloc(HUGE_BUFF_MAX + 1); if (!buffer) return TIZEN_ERROR_OUT_OF_MEMORY; -- 2.34.1