Fix that getting command did not work for permission denied 88/165188/2 accepted/tizen/unified/20171229.070218 submit/tizen/20171228.044239
authorJiyong Min <jiyong.min@samsung.com>
Wed, 27 Dec 2017 03:05:54 +0000 (12:05 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Wed, 27 Dec 2017 03:37:48 +0000 (12:37 +0900)
[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 <jiyong.min@samsung.com>
packaging/capi-media-controller.spec
svc/media_controller_svc.c

index c14f366..5cbec56 100755 (executable)
@@ -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
index 87c8c7f..4786d4c 100755 (executable)
@@ -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;
        }
 }