From ed2ea0fea55c8291d0a4df8dc9ceaff108239ef3 Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Fri, 7 Apr 2017 17:25:51 +0900 Subject: [PATCH] sensor: remove a bad way for hiding sensor handle - from now on, privilege is not checking. Change-Id: I4853b27e2bb7a7c2fc1775974d9df8e199b46ec8 Signed-off-by: kibak.yoon --- src/client/sensor_manager.cpp | 6 ------ src/server/sensor_manager.cpp | 3 --- 2 files changed, 9 deletions(-) diff --git a/src/client/sensor_manager.cpp b/src/client/sensor_manager.cpp index 74ed6c7..5602312 100644 --- a/src/client/sensor_manager.cpp +++ b/src/client/sensor_manager.cpp @@ -89,9 +89,6 @@ int sensor_manager::get_sensor(const char *uri, sensor_t *sensor) return -ENODATA; } - if (info->get_uri() == SENSOR_URI_PERMISSION_DENIED) - return -EACCES; - *sensor = (sensor_t)info; return OP_SUCCESS; } @@ -109,9 +106,6 @@ int sensor_manager::get_sensors(const char *uri, sensor_t **list, int *count) return -ENODATA; } - if (infos[0]->get_uri() == SENSOR_URI_PERMISSION_DENIED) - return -EACCES; - *list = (sensor_t *)malloc(sizeof(sensor_info *) * size); retvm_if(!*list, -ENOMEM, "Failed to allocate memory"); diff --git a/src/server/sensor_manager.cpp b/src/server/sensor_manager.cpp index 7a0ccc9..c7a692d 100644 --- a/src/server/sensor_manager.cpp +++ b/src/server/sensor_manager.cpp @@ -267,9 +267,6 @@ size_t sensor_manager::serialize(int sock_fd, char **bytes) for (auto it = m_sensors.begin(); it != m_sensors.end(); ++it) { info = it->second->get_sensor_info(); - if (!checker.has_permission(sock_fd, info.get_permission())) - info.set_uri(SENSOR_URI_PERMISSION_DENIED); - raw_data_t *raw = new(std::nothrow) raw_data_t(); retvm_if(!raw, -ENOMEM, "Failed to allocated memory"); -- 2.7.4