Merge "LOC_API: Add group permissions after creating the pipe."

This commit is contained in:
Linux Build Service Account 2012-09-25 08:01:03 -07:00 committed by Gerrit - the friendly Code Review server
commit acc44b1af1

10
loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c Normal file → Executable file
View file

@ -64,13 +64,21 @@ int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode)
int result; int result;
LOC_LOGD("%s, mode = %d\n", pipe_name, mode); LOC_LOGD("%s, mode = %d\n", pipe_name, mode);
result = mkfifo(pipe_name, 0666); result = mkfifo(pipe_name, 0660);
if ((result == -1) && (errno != EEXIST)) { if ((result == -1) && (errno != EEXIST)) {
LOC_LOGE("failed: %s\n", strerror(errno)); LOC_LOGE("failed: %s\n", strerror(errno));
return result; 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); fd = open(pipe_name, mode);
if (fd <= 0) if (fd <= 0)
{ {