From e60b3e76b687e48f7e621dfeeb191e68683fa139 Mon Sep 17 00:00:00 2001 From: "sung.goo.kim" Date: Wed, 23 Dec 2015 17:45:05 +0900 Subject: Remove bt/wifidirect privilege Change-Id: I07cf8699598e764196f65718cc63a48efe7afecd --- daemon/icd-cynara.c | 47 ------------------------------------ daemon/icd-cynara.h | 2 -- daemon/icd-dbus.c | 27 ++++++++------------- daemon/icd-ioty.c | 4 +-- lib/include/iotcon-client.h | 14 +++-------- lib/include/iotcon-internal.h | 6 ++--- lib/include/iotcon-lite-resource.h | 7 +----- lib/include/iotcon-remote-resource.h | 25 ++++--------------- lib/include/iotcon-resource.h | 20 +++++---------- lib/include/iotcon-response.h | 2 -- 10 files changed, 29 insertions(+), 125 deletions(-) diff --git a/daemon/icd-cynara.c b/daemon/icd-cynara.c index 64a2a94..b015b49 100644 --- a/daemon/icd-cynara.c +++ b/daemon/icd-cynara.c @@ -30,34 +30,12 @@ static const char *_icd_privileges_network[] = { /* network */ - "http://tizen.org/privilege/bluetooth", "http://tizen.org/privilege/network.get", - "http://tizen.org/privilege/wifidirect", - NULL, -}; - -static const char *_icd_privileges_data[] = { - /* network */ - "http://tizen.org/privilege/bluetooth", - "http://tizen.org/privilege/network.get", - "http://tizen.org/privilege/wifidirect", /* data */ "http://tizen.org/privilege/d2d.datasharing", NULL, }; -static const char *_icd_privileges_device[] = { - /* network */ - "http://tizen.org/privilege/bluetooth", - "http://tizen.org/privilege/network.get", - "http://tizen.org/privilege/wifidirect", - /* data */ - "http://tizen.org/privilege/d2d.datasharing", - /* device */ - "http://tizen.org/privilege/systemsettings", - NULL, -}; - #ifdef IOTCON_CYNARA static cynara *_cynara; #endif @@ -183,28 +161,3 @@ int icd_cynara_check_network(GDBusMethodInvocation *invocation) return ret; } - -int icd_cynara_check_data(GDBusMethodInvocation *invocation) -{ - int ret; - - ret = _icd_cynara_check(invocation, _icd_privileges_data); - if (IOTCON_ERROR_NONE != ret) - ERR("_icd_cynara_check() Fail(%d)", ret); - - return ret; -} - - -int icd_cynara_check_device(GDBusMethodInvocation *invocation) -{ - int ret; - - ret = _icd_cynara_check(invocation, _icd_privileges_device); - if (IOTCON_ERROR_NONE != ret) - ERR("_icd_cynara_check() Fail(%d)", ret); - - return ret; -} - - diff --git a/daemon/icd-cynara.h b/daemon/icd-cynara.h index 69b7bbb..83b17cb 100644 --- a/daemon/icd-cynara.h +++ b/daemon/icd-cynara.h @@ -21,7 +21,5 @@ int icd_cynara_init(); void icd_cynara_deinit(); int icd_cynara_check_network(GDBusMethodInvocation *invocation); -int icd_cynara_check_data(GDBusMethodInvocation *invocation); -int icd_cynara_check_device(GDBusMethodInvocation *invocation); #endif /*__IOT_CONNECTIVITY_MANAGER_DAEMON_CYNARA_H__*/ diff --git a/daemon/icd-dbus.c b/daemon/icd-dbus.c index e1f0ef3..57b2a63 100644 --- a/daemon/icd-dbus.c +++ b/daemon/icd-dbus.c @@ -541,13 +541,6 @@ static gboolean _dbus_handle_register_resource(icDbus *object, int64_t signal_number = 0; if (true == is_lite) { - ret = icd_cynara_check_data(invocation); - if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_data() Fail(%d)", ret); - ic_dbus_complete_register_resource(object, invocation, signal_number, ret); - return TRUE; - } - } else { ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { ERR("icd_cynara_check_network() Fail(%d)", ret); @@ -818,9 +811,9 @@ static gboolean _dbus_handle_notify(icDbus *object, /* iotcon_resource_notify() * iotcon_lite_resource_update_state() */ - ret = icd_cynara_check_data(invocation); + ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_data() Fail(%d)", ret); + ERR("icd_cynara_check_network() Fail(%d)", ret); ic_dbus_complete_notify(object, invocation, ret); return TRUE; } @@ -840,9 +833,9 @@ static gboolean _dbus_handle_send_response(icDbus *object, { int ret; - ret = icd_cynara_check_data(invocation); + ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_data() Fail(%d)", ret); + ERR("icd_cynara_check_network() Fail(%d)", ret); ic_dbus_complete_send_response(object, invocation, ret); return TRUE; } @@ -868,9 +861,9 @@ static gboolean _dbus_handle_get_device_info(icDbus *object, signal_number = icd_dbus_generate_signal_number(); - ret = icd_cynara_check_device(invocation); + ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_device() Fail(%d)", ret); + ERR("icd_cynara_check_network() Fail(%d)", ret); ic_dbus_complete_get_device_info(object, invocation, signal_number, ret); return TRUE; } @@ -899,9 +892,9 @@ static gboolean _dbus_handle_get_platform_info(icDbus *object, signal_number = icd_dbus_generate_signal_number(); - ret = icd_cynara_check_data(invocation); + ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_data() Fail(%d)", ret); + ERR("icd_cynara_check_network() Fail(%d)", ret); ic_dbus_complete_get_platform_info(object, invocation, signal_number, ret); return TRUE; } @@ -1121,9 +1114,9 @@ static gboolean _dbus_handle_start_caching(icDbus *object, int ret; int64_t signal_number = 0; - ret = icd_cynara_check_data(invocation); + ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_data() Fail(%d)", ret); + ERR("icd_cynara_check_network() Fail(%d)", ret); ic_dbus_complete_start_monitoring(object, invocation, signal_number, ret); return TRUE; } diff --git a/daemon/icd-ioty.c b/daemon/icd-ioty.c index 3acda99..3e23add 100644 --- a/daemon/icd-ioty.c +++ b/daemon/icd-ioty.c @@ -610,9 +610,9 @@ static gboolean _icd_ioty_crud(int type, OCConnectivityType oic_conn_type; OCDevAddr dev_addr = {0}; - ret = icd_cynara_check_data(invocation); + ret = icd_cynara_check_network(invocation); if (IOTCON_ERROR_NONE != ret) { - ERR("icd_cynara_check_data() Fail(%d)", ret); + ERR("icd_cynara_check_network() Fail(%d)", ret); icd_ioty_complete_error(type, invocation, ret); return TRUE; } diff --git a/lib/include/iotcon-client.h b/lib/include/iotcon-client.h index fb4c300..5d37f5f 100644 --- a/lib/include/iotcon-client.h +++ b/lib/include/iotcon-client.h @@ -72,9 +72,8 @@ typedef void (*iotcon_presence_cb)(iotcon_presence_h presence, iotcon_error_e er * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks The length of @a resource_type should be less than or equal to 61.\n * The @a resource_type must start with a lowercase alphabetic character, followed by a sequence @@ -117,9 +116,8 @@ int iotcon_add_presence_cb(const char *host_address, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] presence_handle The presence handle to be unsubscribed * @@ -330,9 +328,8 @@ typedef void (*iotcon_found_resource_cb)(iotcon_remote_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks The length of @a resource_type should be less than or equal to 61.\n * The @a resource_type must start with a lowercase alphabetic character, followed by a sequence @@ -393,10 +390,7 @@ typedef void (*iotcon_device_info_cb)(iotcon_device_info_h device_info, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect - * @privilege %http://tizen.org/privilege/systemsettings * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] host_address The host address of remote server @@ -472,9 +466,7 @@ typedef void (*iotcon_platform_info_cb)(iotcon_platform_info_h platform_info, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] host_address The host address of remote server diff --git a/lib/include/iotcon-internal.h b/lib/include/iotcon-internal.h index 54542cf..c7b30b9 100644 --- a/lib/include/iotcon-internal.h +++ b/lib/include/iotcon-internal.h @@ -31,9 +31,8 @@ extern "C" { * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks If @a time_to_live is 0, server will set default value as 60 seconds.\n * If @a time_to_live is very big, server will set maximum value as (60 * 60 * 24) seconds. @@ -60,9 +59,8 @@ int iotcon_start_presence(unsigned int time_to_live); * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @return 0 on success, otherwise a negative error value. * @retval #IOTCON_ERROR_NONE Successful diff --git a/lib/include/iotcon-lite-resource.h b/lib/include/iotcon-lite-resource.h index 879ac4a..0f61932 100644 --- a/lib/include/iotcon-lite-resource.h +++ b/lib/include/iotcon-lite-resource.h @@ -138,9 +138,7 @@ static void _update_brightness(int brightness) * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks @a uri_path length must be less than or equal 36.\n @@ -176,9 +174,8 @@ int iotcon_lite_resource_create(const char *uri_path, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks When a normal variable is used, there are only dbus error and permission\n * denied error. If the errors of this API are not handled, then you must check\n @@ -201,9 +198,7 @@ int iotcon_lite_resource_destroy(iotcon_lite_resource_h resource); * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the lite resource diff --git a/lib/include/iotcon-remote-resource.h b/lib/include/iotcon-remote-resource.h index 2a82c30..3273888 100644 --- a/lib/include/iotcon-remote-resource.h +++ b/lib/include/iotcon-remote-resource.h @@ -202,9 +202,8 @@ typedef void (*iotcon_remote_resource_observe_cb)(iotcon_remote_resource_h resou * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource * @param[in] observe_policy The type to specify how client wants to observe. @@ -237,9 +236,8 @@ int iotcon_remote_resource_observe_register(iotcon_remote_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource * @@ -290,9 +288,7 @@ typedef void (*iotcon_remote_resource_response_cb)(iotcon_remote_resource_h reso * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource @@ -323,9 +319,7 @@ int iotcon_remote_resource_get(iotcon_remote_resource_h resource, iotcon_query_h * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource @@ -360,9 +354,7 @@ int iotcon_remote_resource_put(iotcon_remote_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource @@ -397,9 +389,7 @@ int iotcon_remote_resource_post(iotcon_remote_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource @@ -449,9 +439,7 @@ typedef void (*iotcon_remote_resource_cached_representation_changed_cb)( * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the remote resource to be cached @@ -479,9 +467,8 @@ int iotcon_remote_resource_start_caching(iotcon_remote_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the remote resource * @@ -523,9 +510,8 @@ typedef void (*iotcon_remote_resource_state_changed_cb)(iotcon_remote_resource_h * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the remote resource * @param[in] cb The callback function to add into callback list @@ -549,9 +535,8 @@ int iotcon_remote_resource_start_monitoring(iotcon_remote_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the remote resource * diff --git a/lib/include/iotcon-resource.h b/lib/include/iotcon-resource.h index 8a3903e..6ea1350 100644 --- a/lib/include/iotcon-resource.h +++ b/lib/include/iotcon-resource.h @@ -161,9 +161,8 @@ typedef void (*iotcon_request_handler_cb)(iotcon_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks @a uri_path length must be less than or equal 36.\n * You must destroy @a resource by calling iotcon_resource_destroy() @@ -208,9 +207,8 @@ int iotcon_resource_create(const char *uri_path, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks When a normal variable is used, there are only dbus error and permission\n * denied error. If the errors of this API are not handled, then you must check\n @@ -240,9 +238,8 @@ int iotcon_resource_destroy(iotcon_resource_h resource_handle); * @details The @a iface could be one of #iotcon_interface_e. * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks Sets only one interface to @a iface. If not, @a iface will be ignored. * @@ -271,9 +268,8 @@ int iotcon_resource_bind_interface(iotcon_resource_h resource, iotcon_interface_ * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @remarks The length of @a resource_type should be less than or equal to 61.\n * The @a resource_type must start with a lowercase alphabetic character, followed by a sequence @@ -333,9 +329,8 @@ int iotcon_resource_set_request_handler(iotcon_resource_h resource, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] parent The handle of the parent resource * @param[in] child The handle of the child resource to be added to the parent resource @@ -364,9 +359,8 @@ int iotcon_resource_bind_child_resource(iotcon_resource_h parent, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect + * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] parent The handle of the parent resource * @param[in] child The handle of the child resource to be unbound from the parent resource @@ -395,9 +389,7 @@ int iotcon_resource_unbind_child_resource(iotcon_resource_h parent, * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resource The handle of the resource diff --git a/lib/include/iotcon-response.h b/lib/include/iotcon-response.h index 9526f05..77f9f0c 100644 --- a/lib/include/iotcon-response.h +++ b/lib/include/iotcon-response.h @@ -334,9 +334,7 @@ int iotcon_response_set_options(iotcon_response_h resp, iotcon_options_h options * * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth * @privilege %http://tizen.org/privilege/network.get - * @privilege %http://tizen.org/privilege/wifidirect * @privilege %http://tizen.org/privilege/d2d.datasharing * * @param[in] resp The handle of the response to send -- cgit v1.2.3