From d8d05c818eeb6d88f21f9913b247cef7bdffdf62 Mon Sep 17 00:00:00 2001 From: Jiyong Min Date: Wed, 27 Dec 2017 12:05:54 +0900 Subject: [PATCH] Fix that getting command did not work for permission denied [Cause] The server process should check the safety of the command. The check-list of the command exist in the list of the client. So it should be checked with the data of the client. [Solution] The '__mc_get_data' search the command with the check-list. The '__mc_get_data' don't care about the pid(client & server). Change-Id: I51d68b215006e92a04586e6d635fdd15999ff3cb Signed-off-by: Jiyong Min --- packaging/capi-media-controller.spec | 2 +- svc/media_controller_svc.c | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/packaging/capi-media-controller.spec b/packaging/capi-media-controller.spec index c14f366..5cbec56 100755 --- a/packaging/capi-media-controller.spec +++ b/packaging/capi-media-controller.spec @@ -1,6 +1,6 @@ Name: capi-media-controller Summary: A media controller library in Tizen Native API -Version: 0.1.50 +Version: 0.1.51 Release: 1 Group: Multimedia/API License: Apache-2.0 diff --git a/svc/media_controller_svc.c b/svc/media_controller_svc.c index 87c8c7f..4786d4c 100755 --- a/svc/media_controller_svc.c +++ b/svc/media_controller_svc.c @@ -137,24 +137,22 @@ static void __mc_get_data(gpointer data, gpointer user_data) mc_list_user_data *_user_data = (mc_list_user_data *)user_data; mc_comm_msg_s *_message = (mc_comm_msg_s *)_user_data->message; - if (_data->pid == _message->pid) { - if (_data->s_data != NULL) { - unsigned int i = 0; - unsigned int length_of_list = g_list_length(_data->s_data); - char *value = NULL; - for (i = 0; i < length_of_list; i++) { - value = (char *)g_list_nth_data(_data->s_data, i); - if ((value != NULL) && (strlen(value) == _message->msg_size)) { - if (strncmp(value, _message->msg, _message->msg_size) == 0) { - _data->s_data = g_list_remove(_data->s_data, value); - MC_SAFE_FREE(value); - _user_data->result++; - } + if (_data->s_data != NULL) { + unsigned int i = 0; + unsigned int length_of_list = g_list_length(_data->s_data); + char *value = NULL; + for (i = 0; i < length_of_list; i++) { + value = (char *)g_list_nth_data(_data->s_data, i); + if ((value != NULL) && (strlen(value) == _message->msg_size)) { + if (strncmp(value, _message->msg, _message->msg_size) == 0) { + _data->s_data = g_list_remove(_data->s_data, value); + MC_SAFE_FREE(value); + _user_data->result++; } } - if (g_list_length(_data->s_data) == 0) - _data->s_data = NULL; } + if (g_list_length(_data->s_data) == 0) + _data->s_data = NULL; } } -- 2.7.4