Version update to 2.19
OBS-URL: https://build.opensuse.org/package/show/Base:System/blog?expand=0&rev=31
This commit is contained in:
parent
ee2dc02250
commit
8d17e1075e
14
blog.changes
14
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
|
Wed Aug 1 14:33:06 UTC 2018 - schwab@suse.de
|
||||||
|
|
||||||
|
17
blog.spec
17
blog.spec
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: blog
|
Name: blog
|
||||||
Version: 2.18
|
Version: 2.19
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Boot logging
|
Summary: Boot logging
|
||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
@ -29,16 +29,6 @@ BuildRequires: suse-module-tools
|
|||||||
Requires(post): coreutils
|
Requires(post): coreutils
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Provides: sysvinit-tools:/sbin/blogd
|
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 <sys/sysmacros.h> for makedev
|
|
||||||
Patch4: sysmacros.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The blogd daemon determines the real underlying character device of
|
The blogd daemon determines the real underlying character device of
|
||||||
@ -76,11 +66,6 @@ the LSB startproc command.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n showconsole-%version
|
%setup -q -n showconsole-%version
|
||||||
%patch0 -p1
|
|
||||||
%patch1 -p1
|
|
||||||
%patch2 -p1
|
|
||||||
%patch3 -p1
|
|
||||||
%patch4 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make %{?_smp_mflags} CC="%__cc" \
|
make %{?_smp_mflags} CC="%__cc" \
|
||||||
|
@ -1,112 +0,0 @@
|
|||||||
From: Petr Mladek <pmladek@suse.com>
|
|
||||||
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 <pmladek@suse.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
|||||||
From: Petr Mladek <pmladek@suse.com>
|
|
||||||
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 <pmladek@suse.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
From: Petr Mladek <pmladek@suse.com>
|
|
||||||
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 <pmladek@suse.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
From: Petr Mladek <pmladek@suse.com>
|
|
||||||
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 <pmladek@suse.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:422aab23625186b7b2ec734f995389139ecf4abf30f44e99354ec1cdc74532b5
|
|
||||||
size 39848
|
|
3
showconsole-2.19.tar.gz
Normal file
3
showconsole-2.19.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:fe87631034fc6a7161b90b4be8624def1a5a938e496495934887f598dc3cb355
|
||||||
|
size 39957
|
@ -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 <sys/socket.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
+#include <sys/sysmacros.h>
|
|
||||||
#include <sys/vfs.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
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 <stdlib.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
+#include <sys/sysmacros.h>
|
|
||||||
#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 <sys/types.h> /* Defines the macros major and minor */
|
|
||||||
+#include <sys/sysmacros.h> /* Defines the macros major and minor */
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <err.h>
|
|
Loading…
Reference in New Issue
Block a user