diff --git a/util-linux-2.20-rc-fix-dmesg.patch b/util-linux-2.20-rc-fix-dmesg.patch new file mode 100644 index 0000000..902b59a --- /dev/null +++ b/util-linux-2.20-rc-fix-dmesg.patch @@ -0,0 +1,36 @@ +From dd8f12f4bc28eaf8e746ae2e4489a4445793d4e3 Mon Sep 17 00:00:00 2001 +From: Petr Uzel +Date: Wed, 10 Aug 2011 14:08:55 +0200 +Subject: [PATCH] dmesg: avoid mess at the end of dmesg output + +Since util-linux commit a7ee94f2204011f26232ed3133514bf6e0d4a62c, +dmesg incorrectly calculates number of bytes that are remaining in the +buffer in get_next_record(). This could, under specific circumstances, +cause printing mess at the end of dmesg output: + +> dmesg | tail +[ 1191.478725] Adding 285488k swap on /root/swapfile. Priority:-2 extents:15 across:1186612k +[ 1205.588331] Adding 285488k swap on /root/swapfile. Priority:-2 extents:15 across:1186612k +\xffffffba\xffffffba + +Reported-by: Glenn Doig +Addresses: https://bugzilla.novell.com/show_bug.cgi?id=710417 + +Signed-off-by: Petr Uzel +--- + sys-utils/dmesg.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +Index: util-linux-2.20-rc1/sys-utils/dmesg.c +=================================================================== +--- util-linux-2.20-rc1.orig/sys-utils/dmesg.c ++++ util-linux-2.20-rc1/sys-utils/dmesg.c +@@ -492,6 +492,8 @@ static int get_next_record(struct dmesg_ + + rec->next_size -= end - rec->next; + rec->next = rec->next_size > 0 ? end + 1 : NULL; ++ if (rec->next_size > 0) ++ rec->next_size--; + + return 0; + } diff --git a/util-linux.changes b/util-linux.changes index 74459cf..ad61245 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 10 12:20:41 UTC 2011 - puzel@novell.com + +- add util-linux-2.20-rc-fix-dmesg.patch (bnc#710417) + ------------------------------------------------------------------- Wed Aug 10 11:06:15 UTC 2011 - puzel@novell.com diff --git a/util-linux.spec b/util-linux.spec index 7943d1e..84c7d41 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -85,6 +85,8 @@ Patch3: util-linux-fix-manpages.patch Patch4: util-linux-wall-build-with-pie.patch # bnc#711240 - squashed 4 upstream patches Patch5: util-linux-2.20-rc1-agetty-fixes.patch +# bnc#710471 +Patch6: util-linux-2.20-rc-fix-dmesg.patch ## ## adjtimex ## @@ -188,6 +190,7 @@ Files to develop applications using the libmount library. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # cd adjtimex-*