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
This commit is contained in:
parent
7da07e83ff
commit
a03322f3a7
1 changed files with 9 additions and 1 deletions
10
loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
Normal file → Executable file
10
loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
Normal file → Executable file
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue