From: Lennart Poettering Date: Mon, 16 Jun 2014 11:20:38 +0000 (+0200) Subject: tmpfiles: set up selinux label proeprly when creating fifos X-Git-Tag: v215~414 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=45c196a76b2d883552c90807386d9bed40da822b;p=elogind.git tmpfiles: set up selinux label proeprly when creating fifos --- diff --git a/src/shared/util.c b/src/shared/util.c index a7aec5c54..d93a9680f 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -6659,6 +6659,7 @@ int bind_remount_recursive(const char *prefix, bool ro) { } int fflush_and_check(FILE *f) { + assert(f); errno = 0; fflush(f); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index df52085ff..0fd2bd233 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -719,9 +719,11 @@ static int create_item(Item *i) { case CREATE_FIFO: + label_context_set(i->path, S_IFIFO); RUN_WITH_UMASK(0000) { r = mkfifo(i->path, i->mode); } + label_context_clear(); if (r < 0 && errno != EEXIST) { log_error("Failed to create fifo %s: %m", i->path);