Revert "lib: resource-monitor: Check systemmonitor privilege"
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 2 Sep 2022 06:33:46 +0000 (15:33 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 6 Sep 2022 10:25:03 +0000 (19:25 +0900)
This reverts commit fccfb02d128c9504e0ba1182416e7e86c8a5a310.

Change-Id: Iba2cc166e0c00aa90577cb554328b863f32cccb1
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
lib/CMakeLists.txt
lib/resource-monitor/resource-monitor.c
tests/integration-test/CMakeLists.txt
tools/resource-monitor/CMakeLists.txt

index fd2f3d12a78df532683d4529cc95f581dc7ff8d4..78a3b9ce8d67fab26225d29eb9b6021721276025 100644 (file)
@@ -17,8 +17,6 @@ SET(PKG_MODULES
        dlog
        gio-2.0
        glib-2.0
-       cynara-client
-       cynara-session
 )
 
 INCLUDE(FindPkgConfig)
@@ -33,10 +31,7 @@ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functi
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -lrt")
 SET(CMAKE_EXE_LINKER_FLAGS "-pie")
 
-SET(SRCS
-       ${CMAKE_SOURCE_DIR}/src/util/privilege.c
-       ${CMAKE_SOURCE_DIR}/lib/resource-monitor/resource-monitor.c
-)
+SET(SRCS ./resource-monitor/resource-monitor.c)
 
 ADD_LIBRARY( ${PROJECT_NAME} SHARED ${SRCS})
 TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl -Wl,-z,nodelete,--no-undefined)
index e43eccc7bf3180082f27ff618cad45a92dc2a55a..0f8a3b043db5bd9b5c1188a99ce9bc572ea5bb48 100644 (file)
@@ -23,7 +23,6 @@
 #include <util/log.h>
 #include <monitor/request.h>
 #include <util/resource.h>
-#include <util/privilege.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -39,8 +38,6 @@
 
 #include "resource-monitor.h"
 
-#define PRIVILEGE_SYSTEMMONITOR        "http://tizen.org/privilege/systemmonitor"
-
 #define REQUEST_SERVER_IP "127.0.0.1"
 #define REQUEST_SERVER_PORT 10001
 
@@ -128,9 +125,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:
@@ -297,9 +291,6 @@ int pass_resource_monitor_init(void)
        struct sockaddr_un server_addr;
        int ret = TIZEN_ERROR_NO_DATA;
 
-       if (!is_privilege_supported(PRIVILEGE_SYSTEMMONITOR))
-               return TIZEN_ERROR_PERMISSION_DENIED;
-
        client = malloc(sizeof(struct pass_resource_monitor_client));
        if (!client) {
                _E("[libpass] failed to allocate memory");
@@ -341,9 +332,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);
@@ -516,9 +504,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;
@@ -718,9 +703,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;
index 1326408c3a8a250e0d61fab83b1cf8fe84794296..33dc3bfcd61fc6346d36e31a4eaa33c2a785545a 100644 (file)
@@ -3,7 +3,6 @@ PROJECT(pass C CXX)
 SET(SRCS ${CMAKE_SOURCE_DIR}/src/pass/pass-hal.c
        ${CMAKE_SOURCE_DIR}/src/pass/pass-parser.c
        ${CMAKE_SOURCE_DIR}/src/util/common.c
-       ${CMAKE_SOURCE_DIR}/src/util/privilege.c
        ${CMAKE_SOURCE_DIR}/lib/resource-monitor/resource-monitor.c
 )
 
@@ -21,8 +20,6 @@ pkg_check_modules(gtest_pkgs REQUIRED
        dlog
        json-c
        hal-api-power
-       cynara-client
-       cynara-session
 )
 
 FOREACH(flag ${gtest_pkgs_CFLAGS})
index 8746e13bb95a15e5b876cfcaba7bd3a297eabb5d..3e28063dc4f37bdecfd1dbe1d93a872398d5ad7c 100644 (file)
@@ -2,7 +2,6 @@ PROJECT(pass C CXX)
 
 SET(SRCS
        ${CMAKE_SOURCE_DIR}/src/util/common.c
-       ${CMAKE_SOURCE_DIR}/src/util/privilege.c
        ${CMAKE_SOURCE_DIR}/lib/resource-monitor/resource-monitor.c
 )
 
@@ -18,8 +17,6 @@ pkg_check_modules(gtest_pkgs REQUIRED
        gio-2.0
        dlog
        json-c
-       cynara-client
-       cynara-session
 )
 
 FOREACH(flag ${gtest_pkgs_CFLAGS})