lib: resource-monitor: Remove unneeded privilege check 28/280628/2 accepted/tizen/unified/20220904.214045 submit/tizen/20220902.091829
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 1 Sep 2022 10:10:50 +0000 (19:10 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 1 Sep 2022 10:13:30 +0000 (19:13 +0900)
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 <cw00.choi@samsung.com>
lib/resource-monitor/resource-monitor.c

index e7b567e6b13867a26b3f19c07d44bc64f77443a6..a7ab07ef9fbac7fc43688f5b56df8d46681eb04a 100644 (file)
@@ -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;