From ee2dc022503caa74b28234078f056ab7b143da36665ced1b092b04fe2eba4e64 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 2 Aug 2018 07:01:34 +0000 Subject: [PATCH 1/2] Accepting request 626926 from home:Andreas_Schwab:glibc:rebuild - sysmacros.patch: Include for makedev OBS-URL: https://build.opensuse.org/request/show/626926 OBS-URL: https://build.opensuse.org/package/show/Base:System/blog?expand=0&rev=30 --- blog.changes | 5 +++++ blog.spec | 3 +++ sysmacros.patch | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 sysmacros.patch diff --git a/blog.changes b/blog.changes index 56b2124..a47a9a7 100644 --- a/blog.changes +++ b/blog.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 1 14:33:06 UTC 2018 - schwab@suse.de + +- sysmacros.patch: Include for makedev + ------------------------------------------------------------------- Mon Mar 19 15:31:33 CET 2018 - kukuk@suse.de diff --git a/blog.spec b/blog.spec index 7f4bdfd..4cfc19f 100644 --- a/blog.spec +++ b/blog.spec @@ -37,6 +37,8 @@ Patch1: libconsole-Really-allow-to-use-dev-console-as-a-fall.patch Patch2: libconsole-Add-console-into-the-list-only-when-succe.patch # PATCH-FIX-UPSTREAM libconsole-Correctly-ignore-early-consoles.patch bsc#1071568 Patch3: libconsole-Correctly-ignore-early-consoles.patch +# PATCH-FIX-UPSTREAM Include for makedev +Patch4: sysmacros.patch %description The blogd daemon determines the real underlying character device of @@ -78,6 +80,7 @@ the LSB startproc command. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build make %{?_smp_mflags} CC="%__cc" \ diff --git a/sysmacros.patch b/sysmacros.patch new file mode 100644 index 0000000..57ef1df --- /dev/null +++ b/sysmacros.patch @@ -0,0 +1,36 @@ +Index: showconsole-2.18/libconsole/console.c +=================================================================== +--- showconsole-2.18.orig/libconsole/console.c ++++ showconsole-2.18/libconsole/console.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +Index: showconsole-2.18/libconsole/devices.c +=================================================================== +--- showconsole-2.18.orig/libconsole/devices.c ++++ showconsole-2.18/libconsole/devices.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include "libconsole.h" + + char *charname(const char *str) +Index: showconsole-2.18/showconsole.c +=================================================================== +--- showconsole-2.18.orig/showconsole.c ++++ showconsole-2.18/showconsole.c +@@ -10,6 +10,7 @@ + */ + + #include /* Defines the macros major and minor */ ++#include /* Defines the macros major and minor */ + #include + #include + #include From 8d17e1075e9c0ea0b11d745c3df2b4c6ced0f06e5df27edd69da4966dc902a06 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 2 Aug 2018 08:40:59 +0000 Subject: [PATCH 2/2] Version update to 2.19 OBS-URL: https://build.opensuse.org/package/show/Base:System/blog?expand=0&rev=31 --- blog.changes | 14 +++ blog.spec | 17 +-- ...onsole-into-the-list-only-when-succe.patch | 112 ------------------ ...sole-Correctly-ignore-early-consoles.patch | 55 --------- ...y-allow-to-use-dev-console-as-a-fall.patch | 36 ------ ...r-return-empty-list-from-getconsoles.patch | 39 ------ showconsole-2.18.tar.gz | 3 - showconsole-2.19.tar.gz | 3 + sysmacros.patch | 36 ------ 9 files changed, 18 insertions(+), 297 deletions(-) delete mode 100644 libconsole-Add-console-into-the-list-only-when-succe.patch delete mode 100644 libconsole-Correctly-ignore-early-consoles.patch delete mode 100644 libconsole-Really-allow-to-use-dev-console-as-a-fall.patch delete mode 100644 libconsole-never-return-empty-list-from-getconsoles.patch delete mode 100644 showconsole-2.18.tar.gz create mode 100644 showconsole-2.19.tar.gz delete mode 100644 sysmacros.patch diff --git a/blog.changes b/blog.changes index a47a9a7..72ead13 100644 --- a/blog.changes +++ b/blog.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Thu Aug 2 08:03:10 UTC 2018 - werner@suse.de + +- Update to version 2.19 which integrates the patches now removed: + * sysmacros.patch + * libconsole-Really-allow-to-use-dev-console-as-a-fall.patch + * libconsole-never-return-empty-list-from-getconsoles.patch + * showconsole-2.18.tar.gz + * libconsole-Add-console-into-the-list-only-when-succe.patch + * libconsole-Correctly-ignore-early-consoles.patch + as well as the changes + * Correct wants directory for systemd-ask-password-blog.service + * Sort input files for reproducible builds + ------------------------------------------------------------------- Wed Aug 1 14:33:06 UTC 2018 - schwab@suse.de diff --git a/blog.spec b/blog.spec index 4cfc19f..46c8b0a 100644 --- a/blog.spec +++ b/blog.spec @@ -17,7 +17,7 @@ Name: blog -Version: 2.18 +Version: 2.19 Release: 0 Summary: Boot logging License: GPL-2.0-or-later @@ -29,16 +29,6 @@ BuildRequires: suse-module-tools Requires(post): coreutils BuildRoot: %{_tmppath}/%{name}-%{version}-build Provides: sysvinit-tools:/sbin/blogd -# PATCH-FIX-UPSTREAM libconsole-never-return-empty-list-from-getconsoles.patch bsc#1071568 -Patch0: libconsole-never-return-empty-list-from-getconsoles.patch -# PATCH-FIX-UPSTREAM libconsole-Really-allow-to-use-dev-console-as-a-fall.patch bsc#1071568 -Patch1: libconsole-Really-allow-to-use-dev-console-as-a-fall.patch -# PATCH-FIX-UPSTREAM libconsole-Add-console-into-the-list-only-when-succe.patch bsc#1071568 -Patch2: libconsole-Add-console-into-the-list-only-when-succe.patch -# PATCH-FIX-UPSTREAM libconsole-Correctly-ignore-early-consoles.patch bsc#1071568 -Patch3: libconsole-Correctly-ignore-early-consoles.patch -# PATCH-FIX-UPSTREAM Include for makedev -Patch4: sysmacros.patch %description The blogd daemon determines the real underlying character device of @@ -76,11 +66,6 @@ the LSB startproc command. %prep %setup -q -n showconsole-%version -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %build make %{?_smp_mflags} CC="%__cc" \ diff --git a/libconsole-Add-console-into-the-list-only-when-succe.patch b/libconsole-Add-console-into-the-list-only-when-succe.patch deleted file mode 100644 index 08e39f8..0000000 --- a/libconsole-Add-console-into-the-list-only-when-succe.patch +++ /dev/null @@ -1,112 +0,0 @@ -From: Petr Mladek -Date: Tue, 12 Dec 2017 11:41:19 +0100 -Subject: libconsole: Add console into the list only when successfully allocated -Git-commit: 34a74a07c05d53f7c71bf7ba44a48f8be32942fd -References: bsc#1071568 -Upstream: merged - -consalloc() initializes the console when it is used from blogd (io = 1). -This operation might fail when the related tty device cannot be opened. -The structure is freed in this case but it was already added into -the list before. This might cause access to a freed memory. - -This patch moves the initialization code into a separate function. -The structure is added to the list only when the initialization -succeeds. It is freed otherwise. - -Signed-off-by: Petr Mladek ---- - libconsole/console.c | 57 +++++++++++++++++++++++++++++----------------------- - 1 file changed, 32 insertions(+), 25 deletions(-) - -diff --git a/libconsole/console.c b/libconsole/console.c -index 600e22608630..47e95a4b9046 100644 ---- a/libconsole/console.c -+++ b/libconsole/console.c -@@ -531,13 +531,39 @@ void closeIO(void) - return; - } - -+static int consinitIO(struct console *newc) -+{ -+ int tflags; -+ -+ if ((newc->fd = open(newc->tty, O_WRONLY|O_NONBLOCK|O_NOCTTY)) < 0) { -+ if (errno == EACCES) -+ error("can not open %s", newc->tty); -+ warn("can not open %s", newc->tty); -+ return 0; -+ } -+ -+ newc->tlock = 0; -+ newc->max_canon = _POSIX_MAX_CANON; -+ memset(&newc->ltio, 0, sizeof(newc->ltio)); -+ memset(&newc->otio, 0, sizeof(newc->otio)); -+ memset(&newc->ctio, 0, sizeof(newc->ctio)); -+ if ((tflags = fcntl(newc->fd, F_GETFL)) < 0) -+ warn("can not get terminal flags of %s", newc->tty); -+ -+ tflags &= ~(O_NONBLOCK); -+ tflags |= O_NOCTTY; -+ if (fcntl(newc->fd, F_SETFL, tflags) < 0) -+ warn("can not set terminal flags of %s", newc->tty); -+ -+ return 1; -+} -+ - /* Allocate a console */ - static list_t lcons = { &(lcons), &(lcons) }; - static int consalloc(struct console **cons, char *name, const int cflags, const dev_t dev, int io) - { - struct console *newc; - list_t *head; -- int tflags; - - if (!cons) - error("missing console pointer"); -@@ -551,6 +577,11 @@ static int consalloc(struct console **cons, char *name, const int cflags, const - newc->dev = dev; - newc->pid = -1; - -+ if (io && !consinitIO(newc)) { -+ free(newc); -+ return 0; -+ } -+ - if (!*cons) { - head = &lcons; - *cons = (struct console*)head; -@@ -558,30 +589,6 @@ static int consalloc(struct console **cons, char *name, const int cflags, const - head = &(*cons)->node; - insert(&newc->node, head); - -- if (!io) -- return 1; -- -- if ((newc->fd = open(newc->tty, O_WRONLY|O_NONBLOCK|O_NOCTTY)) < 0) { -- if (errno == EACCES) -- error("can not open %s", newc->tty); -- warn("can not open %s", newc->tty); -- free(newc); -- return 0; -- } -- -- newc->tlock = 0; -- newc->max_canon = _POSIX_MAX_CANON; -- memset(&newc->ltio, 0, sizeof(newc->ltio)); -- memset(&newc->otio, 0, sizeof(newc->otio)); -- memset(&newc->ctio, 0, sizeof(newc->ctio)); -- if ((tflags = fcntl(newc->fd, F_GETFL)) < 0) -- warn("can not get terminal flags of %s", newc->tty); -- -- tflags &= ~(O_NONBLOCK); -- tflags |= O_NOCTTY; -- if (fcntl(newc->fd, F_SETFL, tflags) < 0) -- warn("can not set terminal flags of %s", newc->tty); -- - return 1; - } - --- -2.13.6 - diff --git a/libconsole-Correctly-ignore-early-consoles.patch b/libconsole-Correctly-ignore-early-consoles.patch deleted file mode 100644 index 40f4842..0000000 --- a/libconsole-Correctly-ignore-early-consoles.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Petr Mladek -Date: Tue, 12 Dec 2017 12:49:39 +0100 -Subject: libconsole: Correctly ignore early consoles -Git-commit: 08b7314b53524040a16ce2a7f95a73304c55db30 -References: bsc#1071568 -Upstream: merged - -There might be consoles without tty binding. These do not have -defined major and minor numbers in the /proc/consoles list. -For example, it might look like: - -$> cat /proc/consoles -pl11 -W- (E Bp ) -ttyAMA0 -W- (EC p a) 204:64 - -Let's just ignore them. - -Signed-off-by: Petr Mladek ---- - libconsole/console.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/libconsole/console.c b/libconsole/console.c -index 47e95a4b9046..c4396b1f9b5e 100644 ---- a/libconsole/console.c -+++ b/libconsole/console.c -@@ -609,6 +609,7 @@ void getconsoles(struct console **cons, int io) - char fbuf[16], dev[64]; - char *tty = NULL; - FILE *fc; -+ int items; - - if (!cons) - error("error: console pointer empty"); -@@ -621,11 +622,16 @@ void getconsoles(struct console **cons, int io) - goto err; - } - -- while ((fscanf(fc, "%*s %*s (%[^)]) %[0-9:]", &fbuf[0], &dev[0]) == 2)) { -+ while ((items = fscanf(fc, "%*s %*s (%[^)]) %[0-9:]", &fbuf[0], &dev[0])) -+ != EOF) { - char *tmp; - int flags, n, maj, min; - int ret; - -+ /* Ignore consoles without tty binding. */ -+ if (items != 2) -+ continue; -+ - if (!strchr(fbuf, 'E')) - continue; - --- -2.13.6 - diff --git a/libconsole-Really-allow-to-use-dev-console-as-a-fall.patch b/libconsole-Really-allow-to-use-dev-console-as-a-fall.patch deleted file mode 100644 index a4a714a..0000000 --- a/libconsole-Really-allow-to-use-dev-console-as-a-fall.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Petr Mladek -Date: Mon, 11 Dec 2017 16:40:39 +0100 -Subject: libconsole: Really allow to use /dev/console as a fallback in showconsole -Git-commit: 19329e59e442c81d270028cbc945fe83a9732327 -References: bsc#1071568 -Upstream: merged - -consalloc() always returns an error when it is called from -showconsole (with io = 0). As a result, /dev/console is ignored -because it is not assigned to the global "cons" pointer -in getconsoles(). - -consalloc() should return success (1) when the console is added -to the list and the io-related operations are skipped. - -Signed-off-by: Petr Mladek ---- - libconsole/console.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libconsole/console.c b/libconsole/console.c -index 2f6e0b1d56d9..600e22608630 100644 ---- a/libconsole/console.c -+++ b/libconsole/console.c -@@ -559,7 +559,7 @@ static int consalloc(struct console **cons, char *name, const int cflags, const - insert(&newc->node, head); - - if (!io) -- return 0; -+ return 1; - - if ((newc->fd = open(newc->tty, O_WRONLY|O_NONBLOCK|O_NOCTTY)) < 0) { - if (errno == EACCES) --- -2.13.6 - diff --git a/libconsole-never-return-empty-list-from-getconsoles.patch b/libconsole-never-return-empty-list-from-getconsoles.patch deleted file mode 100644 index 61b8880..0000000 --- a/libconsole-never-return-empty-list-from-getconsoles.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Petr Mladek -Date: Mon, 11 Dec 2017 16:32:11 +0100 -Subject: libconsole: never return empty list from getconsoles() -Git-commit: d7fe84cd6198c4acc00a59d7c403fe6bdc3f509a -References: bsc#1071568 -Upstream: merged - -getconsoles() users expect that they get a non-empty list of consoles. -Otherwise, they might access an invalid memory. - -There is an attempt to create fallback to /dev/console but it is -used (assigned to *cons) only when the corresponding consalloc() -passes. Otherwise, we should printk an error and exit. - -Signed-off-by: Petr Mladek ---- - libconsole/console.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libconsole/console.c b/libconsole/console.c -index 2c6bbac8989f..2f6e0b1d56d9 100644 ---- a/libconsole/console.c -+++ b/libconsole/console.c -@@ -662,8 +662,10 @@ err: - if (!tty) - error("can not allocate string"); - -- if (consalloc(&c, tty, CON_CONSDEV, makedev(TTYAUX_MAJOR, 1), io)) -- *cons = c; -+ if (!consalloc(&c, tty, CON_CONSDEV, makedev(TTYAUX_MAJOR, 1), io)) -+ error("/dev/console is not a valid fallback\n"); -+ -+ *cons = c; - } - - /* --- -2.13.6 - diff --git a/showconsole-2.18.tar.gz b/showconsole-2.18.tar.gz deleted file mode 100644 index 3c8dfd4..0000000 --- a/showconsole-2.18.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:422aab23625186b7b2ec734f995389139ecf4abf30f44e99354ec1cdc74532b5 -size 39848 diff --git a/showconsole-2.19.tar.gz b/showconsole-2.19.tar.gz new file mode 100644 index 0000000..1600716 --- /dev/null +++ b/showconsole-2.19.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe87631034fc6a7161b90b4be8624def1a5a938e496495934887f598dc3cb355 +size 39957 diff --git a/sysmacros.patch b/sysmacros.patch deleted file mode 100644 index 57ef1df..0000000 --- a/sysmacros.patch +++ /dev/null @@ -1,36 +0,0 @@ -Index: showconsole-2.18/libconsole/console.c -=================================================================== ---- showconsole-2.18.orig/libconsole/console.c -+++ showconsole-2.18/libconsole/console.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include - #include - #include -Index: showconsole-2.18/libconsole/devices.c -=================================================================== ---- showconsole-2.18.orig/libconsole/devices.c -+++ showconsole-2.18/libconsole/devices.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include "libconsole.h" - - char *charname(const char *str) -Index: showconsole-2.18/showconsole.c -=================================================================== ---- showconsole-2.18.orig/showconsole.c -+++ showconsole-2.18/showconsole.c -@@ -10,6 +10,7 @@ - */ - - #include /* Defines the macros major and minor */ -+#include /* Defines the macros major and minor */ - #include - #include - #include