From: Lennart Poettering Date: Sun, 4 Apr 2010 20:50:04 +0000 (+0200) Subject: socket: when creating FIFOs, create parent dirs first, and use right access mode X-Git-Tag: v1~668 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=8cb45bf8df4d1fab4386bce349a1437443a9b0eb;ds=inline socket: when creating FIFOs, create parent dirs first, and use right access mode --- diff --git a/socket.c b/socket.c index afa001f20..2a19e97b7 100644 --- a/socket.c +++ b/socket.c @@ -267,7 +267,9 @@ static int socket_open_fds(Socket *s) { struct stat st; assert(p->type == SOCKET_FIFO); - if (mkfifo(p->path, 0666 & ~s->exec_context.umask) < 0 && errno != EEXIST) { + mkdir_parents(p->path, s->directory_mode); + + if (mkfifo(p->path, s->socket_mode) < 0 && errno != EEXIST) { r = -errno; goto rollback; }