1
0
forked from pool/util-linux
Dr. Werner Fink 2014-02-07 15:58:52 +00:00 committed by Git OBS Bridge
parent e66e0cdc2e
commit 2ea1a6c269
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,32 @@
Enable sulogin to find a suitable console device even if the first line
in /proc/consoles does not have any major and minor number (bnc#862078)
---
sulogin-consoles.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- login-utils/sulogin-consoles.c
+++ login-utils/sulogin-consoles.c 2014-02-07 15:47:14.246235487 +0000
@@ -319,7 +319,7 @@ static int detect_consoles_from_proc(str
char fbuf[16 + 1];
DIR *dir = NULL;
FILE *fc = NULL;
- int maj, min, rc = 1;
+ int maj, min, rc = 1, matches;
DBG(dbgprint("trying /proc"));
@@ -332,10 +332,12 @@ static int detect_consoles_from_proc(str
if (!dir)
goto done;
- while (fscanf(fc, "%*s %*s (%16[^)]) %d:%d", fbuf, &maj, &min) == 3) {
+ while ((matches = fscanf(fc, "%*s %*s (%16[^)]) %d:%d", fbuf, &maj, &min)) >= 1) {
char *name;
dev_t comparedev;
+ if (matches != 3)
+ continue;
if (!strchr(fbuf, 'E'))
continue;
comparedev = makedev(maj, min);

View File

@ -114,6 +114,8 @@ Patch15: agetty-fooled-on-serial-line-due-plymouth.patch
Patch16: agetty-on-s390-on-dev-3270-tty1-line.patch
# PATCH-FIX-SUSE -- Make sure that plymouth does not break sulogin
Patch17: sulogin-fooled-on-tty-line-due-plymouth.patch
# PATCH-FIX-SUSE -- sulogin: find suitable console device even if first is not usable
Patch18: sulogin-does-not-find-any-console.patch
# hack for boot.localfs
Patch20: util-linux-HACK-boot.localfs.diff
@ -235,6 +237,7 @@ xzcat %{S:0} | %gpg_verify %{S:12} -
%patch15 -p0
%patch16 -p0
%patch17 -p0
%patch18 -p0
#
%patch20 -p1
#