From 054a9caf99f849b242a845f2b83963a57fe324f8424e54fb48c01d9ed6dbb0dd Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 27 May 2014 12:12:43 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=204 --- killproc-2.18-open_flags.dif | 11 +++++++++++ sysvinit.changes | 6 ++++++ sysvinit.spec | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 killproc-2.18-open_flags.dif diff --git a/killproc-2.18-open_flags.dif b/killproc-2.18-open_flags.dif new file mode 100644 index 0000000..29a45ee --- /dev/null +++ b/killproc-2.18-open_flags.dif @@ -0,0 +1,11 @@ +--- startproc.c ++++ startproc.c 2014-05-27 12:08:10.498235871 +0000 +@@ -624,7 +624,7 @@ static int do_start(const char *inname, + char * redirect; + if (!(redirect = getenv("REDIRECT"))) + redirect = "/dev/tty"; +- if ((tty = open(redirect,O_WRONLY|O_NONBLOCK,0)) < 0) ++ if ((tty = open(redirect,O_RDWR|O_NONBLOCK,0)) < 0) + error(LSB_PROOF," cannot open %s: %s\n", redirect, strerror(errno)); + dup2(tty, fileno(stdin)); + dup2(tty, fileno(stdout)); diff --git a/sysvinit.changes b/sysvinit.changes index 94d5381..80f266a 100644 --- a/sysvinit.changes +++ b/sysvinit.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 21 13:49:37 CEST 2014 - draht@suse.de + +- open("/dev/tty", ...) should use O_RDWR, not O_WRONLY. Otherwise, + after dup2(fd, 0);, a process cannot read from stdin. [bnc#863518] + ------------------------------------------------------------------- Fri Feb 7 15:42:34 UTC 2014 - werner@suse.de diff --git a/sysvinit.spec b/sysvinit.spec index 63126f0..305ba86 100644 --- a/sysvinit.spec +++ b/sysvinit.spec @@ -73,6 +73,7 @@ Patch12: %{name}-%{version}dsf-sulogin.diff # PATCH-FIX-SUSE -- sulogin: find suitable console device even if first is not usable Patch13: %{name}-%{version}dsf-xen.patch Patch30: killproc-%{KPVER}.dif +Patch31: killproc-2.18-open_flags.dif Patch40: showconsole-%{SCVER}.dif Patch41: showconsole-1.16-deadlock.diff Patch42: showconsole-1.16-glibc.dif @@ -143,6 +144,7 @@ pushd doc popd pushd ../killproc-%{KPVER} %patch30 +%patch31 -p0 -b .dialog ln -t../%{name}-%{SIVER}dsf/doc/killproc README popd pushd ../showconsole-%{SCVER}