From 502865cbdf91517eb1a8fc1471ead21640a292fc Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 1 Oct 2012 11:57:20 -0700 Subject: [PATCH] BIT:Fixes a bug in the pipe ownership for BIT AGPS interface Changes to assign the correct permissions for 'gps" group for Rx path from HAL to BIT daemon Change-Id: I6c5dc4ff0a1379a95888f4d98e88f0174a7a2a79 CRs-Fixed: 400339, 387672 --- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index f01402a1..112d30f3 100755 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -72,7 +72,8 @@ static int loc_api_server_proc_init(void *context) result = chown (global_loc_api_q_path, -1, gps_group->gr_gid); if (result != 0) { - LOC_LOGE("chown for pipe failed, gid = %d, result = %d, error = %s\n", gps_group->gr_gid, result, strerror(errno)); + LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n", + global_loc_api_q_path, gps_group->gr_gid, result, strerror(errno)); } } else @@ -81,6 +82,25 @@ static int loc_api_server_proc_init(void *context) } loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR); + + //change mode/group for the global_loc_api_resp_q_path pipe + result = chmod (global_loc_api_resp_q_path, 0660); + if (result != 0) + { + LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_resp_q_path, strerror(errno)); + } + + if (gps_group != NULL) + { + result = chown (global_loc_api_resp_q_path, -1, gps_group->gr_gid); + if (result != 0) + { + LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n", + global_loc_api_resp_q_path, + gps_group->gr_gid, result, strerror(errno)); + } + } + quipc_msgqid = loc_eng_dmn_conn_glue_msgget(global_quipc_ctrl_q_path, O_RDWR); msapm_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapm_ctrl_q_path , O_RDWR); msapu_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapu_ctrl_q_path , O_RDWR);