Commit 7aa9914a authored by Filippos Giannakos's avatar Filippos Giannakos

xseg_posixfd: Change fifo permissions

Make sure the pipes that are created, are readable/writable by the group of the
process that creates them.
parent a0e96f30
......@@ -139,31 +139,37 @@ static int posixfd_local_signal_init(struct xseg *xseg, xport portno)
/* create or truncate POSIXFD+portno file */
int r, fd;
char filename[POSIXFD_DIR_LEN + POSIXFD_FILENAME_LEN + 1];
mode_t old_mode;
struct posixfd_signal_desc *psd = __get_signal_desc(xseg, portno);
if (!psd) {
return -1;
}
__get_filename(psd, filename);
old_mode = umask(S_IWOTH);
retry:
r = mkfifo(filename, S_IRUSR|S_IWUSR);
r = mkfifo(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
if (r < 0) {
if (errno == EEXIST) {
unlink(filename);
goto retry;
}
umask(old_mode);
return -1;
}
fd = open(filename, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
unlink(filename);
umask(old_mode);
return -1;
}
psd->fd = fd;
open(filename, O_WRONLY | O_NONBLOCK);
umask(old_mode);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment