diff options
Diffstat (limited to 'svc/media_controller_svc.c')
-rwxr-xr-x | svc/media_controller_svc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/svc/media_controller_svc.c b/svc/media_controller_svc.c index e943ccf..71b910b 100755 --- a/svc/media_controller_svc.c +++ b/svc/media_controller_svc.c @@ -139,6 +139,16 @@ gboolean _mc_read_service_request_tcp_socket(GIOChannel *src, GIOCondition condi } } } else if (recv_msg.msg_type == MC_MSG_SERVER_CONNECTION) { + ret = __mc_privilege_ask(client_sock, "mediacontroller::svc", "w"); + if (ret != MEDIA_CONTROLLER_ERROR_NONE) { + ret = __mc_privilege_ask(client_sock, "mediacontroller::svc", "r"); + if (ret != MEDIA_CONTROLLER_ERROR_NONE) { + mc_error("permission is denied!"); + + send_msg = MEDIA_CONTROLLER_ERROR_PERMISSION_DENIED; + goto ERROR; + } + } if((recv_msg.msg_size > 0) && (recv_msg.msg != NULL)) { if (strncmp(recv_msg.msg, MC_SERVER_CONNECTION_MSG, recv_msg.msg_size) == 0) { if(g_connection_cnt == -1) |