From 02767a49084fbfc0894db1c5fc4e02e340ddf778545921734f74fbb788c5019a Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 12 Oct 2010 16:22:56 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=75 --- showconsole-1.12.dif | 51 ++++++++++++++++++++++++++++++++++++++++++++ sysvinit.changes | 5 +++++ 2 files changed, 56 insertions(+) diff --git a/showconsole-1.12.dif b/showconsole-1.12.dif index 8fc4656..b9e20af 100644 --- a/showconsole-1.12.dif +++ b/showconsole-1.12.dif @@ -56,3 +56,54 @@ close(c->fd); c->fd = -1; } +--- libblogger.c ++++ libblogger.c 2010-10-12 16:12:20.743926028 +0000 +@@ -54,7 +54,7 @@ static int bootlog_init(const int lvl __ + if (!S_ISFIFO(st.st_mode)) + goto out; + +- if ((fdfifo = open(fifo_name, O_WRONLY|O_NONBLOCK)) < 0) ++ if ((fdfifo = open(fifo_name, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_CLOEXEC)) < 0) + goto out; + + ret = 0; +--- libconsole.c ++++ libconsole.c 2010-10-12 16:20:05.187926537 +0000 +@@ -770,7 +770,7 @@ void prepareIO(void (*rfunc)(int), void + (void)mkfifo(fifo_name, 0600); + errno = 0; + if (!stat(fifo_name, &st) && S_ISFIFO(st.st_mode)) { +- if ((fdfifo = open(fifo_name, O_RDWR|O_NOCTTY)) < 0) ++ if ((fdfifo = open(fifo_name, O_RDONLY|O_NOCTTY|O_CLOEXEC)) < 0) + warn("can not open named fifo %s: %s\n", fifo_name, strerror(errno)); + } + } +@@ -788,7 +788,7 @@ static void more_input (struct timeval * + FD_ZERO (&watch); + FD_SET (fdread, &watch); + +- if (fdfifo > 0) { ++ if (fdfifo >= 0) { + FD_SET (fdfifo, &watch); + wfds = (fdread > fdfifo ? fdread : fdfifo) + 1; + } else +@@ -836,7 +836,7 @@ static void more_input (struct timeval * + } + } + +- if (fdfifo > 0 && FD_ISSET(fdfifo, &watch)) { ++ if (fdfifo >= 0 && FD_ISSET(fdfifo, &watch)) { + const ssize_t cnt = safein(fdfifo, (char*)trans, sizeof(trans), noerr); + + if (cnt > 0) { +@@ -1003,6 +1003,10 @@ void closeIO(void) + (void)fclose(flog); + flog = NULL; + xout: ++ if (fdfifo >= 0) { ++ close(fdfifo); ++ fdfifo = -1; ++ } + for (c = cons; c; c = c->next) { + if (c->fd < 0) + continue; diff --git a/sysvinit.changes b/sysvinit.changes index 27f6344..f42d0af 100644 --- a/sysvinit.changes +++ b/sysvinit.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 12 18:21:44 CEST 2010 - werner@suse.de + +- libblogger: set O_CLOEXEC for named FIFO /dev/blog (bnc#645793) + ------------------------------------------------------------------- Mon Oct 4 16:46:53 CEST 2010 - werner@suse.de