lib: resource-monitor: Check systemmonitor privilege 10/280610/5
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 1 Sep 2022 06:36:41 +0000 (15:36 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 1 Sep 2022 08:37:54 +0000 (17:37 +0900)
commitfccfb02d128c9504e0ba1182416e7e86c8a5a310
tree137ed9245fa15c37b07fba907c9dde2c1c9268b1
parentfac3dcb3501756666b3a987fc299243de123a1ab
lib: resource-monitor: Check systemmonitor privilege

In order to prevent the unauthorized client,
check the systemmonitor privilege[1] .
[1] http://tizen.org/privilege/systemmonitor

For example of rejection when don't have systemmonitor privilege
- Connect sdb without root and then executes resource-monitor/resource-monitor-tests.
  In result, cannot use the resource monitor. I checked it the log as following:

E/PASS    ( 1395): privilege.c: is_privilege_supported(69) > 'http://tizen.org/privilege/systemmonitor' privilege is not supported on resource-monitor
E/PASS    ( 1395): privilege.c: is_privilege_supported(69) > 'http://tizen.org/privilege/systemmonitor' privilege is not supported on resource-monitor
(snip)
E/PASS    ( 1429): privilege.c: is_privilege_supported(69) > 'http://tizen.org/privilege/systemmonitor' privilege is not supported on resource-monitor-tests
E/PASS    ( 1429): privilege.c: is_privilege_supported(69) > 'http://tizen.org/privilege/systemmonitor' privilege is not supported on resource-monitor-tests

Change-Id: I77531ca1717b3592f0803cc585e0f205c46edcee
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