Commit 97a089d7 authored by Filippos Giannakos's avatar Filippos Giannakos

xseg_posixfd: Remove umask and make fifo mode 666

Remove umask calls and make fifo mode 666. This way, we avoid calling umask from
the librar and we rely on the umask of each process in order to create the pipes
with the right permissions.
parent 68b45047
......@@ -75,30 +75,25 @@ static int posixfd_local_signal_init(struct xseg *xseg, xport portno)
return -1;
}
__get_filename(psd, filename);
old_mode = umask(S_IWOTH);
retry:
r = mkfifo(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
r = mkfifo(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
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