From a03322f3a73dd28d7486ffa516755d2c49773e8d Mon Sep 17 00:00:00 2001 From: Amol Mahesh Date: Mon, 24 Sep 2012 13:41:46 -0700 Subject: [PATCH] LOC_API: Add group permissions after creating the pipe. Add the group permissions to the pipe after creation so that it can be accessed by the group. Change-Id: Ib42639ee8a46a498c4e246bc448fe8267fd5fa7d --- loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c old mode 100644 new mode 100755 index 74769088..e479b7ae --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -64,13 +64,21 @@ int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode) int result; LOC_LOGD("%s, mode = %d\n", pipe_name, mode); - result = mkfifo(pipe_name, 0666); + result = mkfifo(pipe_name, 0660); if ((result == -1) && (errno != EEXIST)) { LOC_LOGE("failed: %s\n", strerror(errno)); return result; } + // The mode in mkfifo is not honoured and does not provide the + // group permissions. Doing chmod to add group permissions. + result = chmod (pipe_name, 0660); + if (result != 0){ + LOC_LOGE ("%s failed to change mode for %s, error = %s\n", __func__, + pipe_name, strerror(errno)); + } + fd = open(pipe_name, mode); if (fd <= 0) {