Hello community,

here is the log from the commit of package util-linux for openSUSE:Factory 
checked in at 2018-02-09 15:41:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/util-linux (Old)
 and      /work/SRC/openSUSE:Factory/.util-linux.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "util-linux"

Fri Feb  9 15:41:15 2018 rev:225 rq:571531 version:2.31.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/util-linux/python-libmount.changes       
2018-01-26 13:33:45.661376327 +0100
+++ /work/SRC/openSUSE:Factory/.util-linux.new/python-libmount.changes  
2018-02-09 15:41:16.832888933 +0100
@@ -1,0 +2,21 @@
+Wed Jan 31 20:34:56 CET 2018 - sbra...@suse.com
+
+- Update to version 2.31.1:
+  * blkid: Add support for LUKS2 and new LABEL attributes.
+  * move rfkill to /usr/sbin (boo#1076134).
+  * fsck.cramfs: Fix bus error on broken file system.
+  * hwclock: add iso-8601 overflow check
+  * libmount:
+    * Allow MNT_FORCE and MNT_DETACH at umount
+    * add nsfs between pseudo filesystems
+  * lscpu: Treat read failure on Xen Hypervisor properties as
+    non-fatal
+  * sha1: endian fixes (affects util_linux_bigendian.patch)
+  * documentation updates
+  * other fixes and improvements
+- Fix regressions in 2.31.1:
+  * sha1 on s390* (update util_linux_bigendian.patch)
+  * fsck.cramfs on ppc64le (util-linux-cramfs.patch)
+  * fincore/count (disable, util-linux-fincore-count.patch)
+
+-------------------------------------------------------------------
util-linux-systemd.changes: same change
util-linux.changes: same change

Old:
----
  util-linux-2.31.tar.sign
  util-linux-2.31.tar.xz

New:
----
  util-linux-2.31.1.tar.sign
  util-linux-2.31.1.tar.xz
  util-linux-cramfs.patch
  util-linux-fincore-count.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-libmount.spec ++++++
--- /var/tmp/diff_new_pack.grcn1P/_old  2018-02-09 15:41:18.448830922 +0100
+++ /var/tmp/diff_new_pack.grcn1P/_new  2018-02-09 15:41:18.452830778 +0100
@@ -73,7 +73,7 @@
 %endif
 Summary:        %main_summary
 License:        GPL-2.0+
-Group:          %group_pl
+Group:          %main_group
 BuildRequires:  audit-devel
 BuildRequires:  bc
 BuildRequires:  binutils-devel
@@ -116,7 +116,7 @@
 %endif
 %endif
 #END SECOND STAGE DEPENDENCIES
-Version:        2.31
+Version:        2.31.1
 Release:        0
 # util-linux is a base package and uuidd pre-requiring pwdutils pulls
 # that into the core build cycle.  pwdutils also pulls in the whole
@@ -125,7 +125,7 @@
 # these tools as well
 #!BuildIgnore:  pwdutils
 Url:            https://www.kernel.org/pub/linux/utils/util-linux/
-Source:         
https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.xz
+Source:         
https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-%{version}.tar.xz
 Source1:        util-linux-rpmlintrc
 Source4:        raw.service
 Source5:        etc.raw
@@ -135,7 +135,7 @@
 Source9:        remote.pamd
 Source10:       su.pamd
 Source11:       su.default
-Source12:       
https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.sign
+Source12:       
https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-%{version}.tar.sign
 Source13:       %{_name}.keyring
 Source14:       runuser.pamd
 # klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
@@ -166,6 +166,10 @@
 Patch3:         util-linux-lsmem-memory-zone-3.patch
 # Add four commits from upstream to pass tests on ppc64
 Patch4:         util_linux_bigendian.patch
+# PATCH-FIX-UPSTREAM util-linux-cramfs.patch sbra...@suse.com -- Fix 
fsck.cramfs failure on ppc64le.
+Patch5:         util-linux-cramfs.patch
+# PATCH-FIX-UPSTREAM util-linux-fincore-count.patch sbra...@suse.com -- 
Disable bad test fincore/count.
+Patch6:         util-linux-fincore-count.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 #
@@ -390,7 +394,6 @@
 %if %build_util_linux
 %package -n python-libmount
 Summary:        %summary_pl
-License:        GPL-2.0+
 Group:          %group_pl
 
 %description -n python-libmount
@@ -408,6 +411,8 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 #
 # setctsid
 cp -p %{S:22} %{S:23} .
@@ -645,7 +650,6 @@
 popd
 install -Dm644 %{SOURCE41} %{buildroot}%{_unitdir}/rfkill-block@.service
 install -Dm644 %{SOURCE42} %{buildroot}%{_unitdir}/rfkill-unblock@.service
-ln -s "../bin/rfkill" %{buildroot}%{_sbindir}/rfkill
 %endif
 #
 # util-linux install
@@ -985,8 +989,6 @@
 %{_bindir}/rename
 %{_bindir}/renice
 %{_bindir}/rev
-%{_bindir}/rfkill
-%{_sbindir}/rfkill
 %{_bindir}/script
 %{_bindir}/scriptreplay
 %{_bindir}/setarch
@@ -1037,6 +1039,7 @@
 %{_sbindir}/raw
 %{_sbindir}/rcraw
 %{_sbindir}/resizepart
+%{_sbindir}/rfkill
 %{_sbindir}/rtcwake
 %{_sbindir}/runuser
 %{_sbindir}/setctsid

++++++ util-linux-systemd.spec ++++++
--- /var/tmp/diff_new_pack.grcn1P/_old  2018-02-09 15:41:18.492829342 +0100
+++ /var/tmp/diff_new_pack.grcn1P/_new  2018-02-09 15:41:18.496829199 +0100
@@ -116,7 +116,7 @@
 %endif
 %endif
 #END SECOND STAGE DEPENDENCIES
-Version:        2.31
+Version:        2.31.1
 Release:        0
 # util-linux is a base package and uuidd pre-requiring pwdutils pulls
 # that into the core build cycle.  pwdutils also pulls in the whole
@@ -125,7 +125,7 @@
 # these tools as well
 #!BuildIgnore:  pwdutils
 Url:            https://www.kernel.org/pub/linux/utils/util-linux/
-Source:         
https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.xz
+Source:         
https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-%{version}.tar.xz
 Source1:        util-linux-rpmlintrc
 Source4:        raw.service
 Source5:        etc.raw
@@ -135,7 +135,7 @@
 Source9:        remote.pamd
 Source10:       su.pamd
 Source11:       su.default
-Source12:       
https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.sign
+Source12:       
https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-%{version}.tar.sign
 Source13:       %{_name}.keyring
 Source14:       runuser.pamd
 # klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
@@ -166,6 +166,10 @@
 Patch3:         util-linux-lsmem-memory-zone-3.patch
 # Add four commits from upstream to pass tests on ppc64
 Patch4:         util_linux_bigendian.patch
+# PATCH-FIX-UPSTREAM util-linux-cramfs.patch sbra...@suse.com -- Fix 
fsck.cramfs failure on ppc64le.
+Patch5:         util-linux-cramfs.patch
+# PATCH-FIX-UPSTREAM util-linux-fincore-count.patch sbra...@suse.com -- 
Disable bad test fincore/count.
+Patch6:         util-linux-fincore-count.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 #
@@ -407,6 +411,8 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 #
 # setctsid
 cp -p %{S:22} %{S:23} .
@@ -644,7 +650,6 @@
 popd
 install -Dm644 %{SOURCE41} %{buildroot}%{_unitdir}/rfkill-block@.service
 install -Dm644 %{SOURCE42} %{buildroot}%{_unitdir}/rfkill-unblock@.service
-ln -s "../bin/rfkill" %{buildroot}%{_sbindir}/rfkill
 %endif
 #
 # util-linux install
@@ -984,8 +989,6 @@
 %{_bindir}/rename
 %{_bindir}/renice
 %{_bindir}/rev
-%{_bindir}/rfkill
-%{_sbindir}/rfkill
 %{_bindir}/script
 %{_bindir}/scriptreplay
 %{_bindir}/setarch
@@ -1036,6 +1039,7 @@
 %{_sbindir}/raw
 %{_sbindir}/rcraw
 %{_sbindir}/resizepart
+%{_sbindir}/rfkill
 %{_sbindir}/rtcwake
 %{_sbindir}/runuser
 %{_sbindir}/setctsid

++++++ util-linux.spec ++++++
--- /var/tmp/diff_new_pack.grcn1P/_old  2018-02-09 15:41:18.516828481 +0100
+++ /var/tmp/diff_new_pack.grcn1P/_new  2018-02-09 15:41:18.520828337 +0100
@@ -116,7 +116,7 @@
 %endif
 %endif
 #END SECOND STAGE DEPENDENCIES
-Version:        2.31
+Version:        2.31.1
 Release:        0
 # util-linux is a base package and uuidd pre-requiring pwdutils pulls
 # that into the core build cycle.  pwdutils also pulls in the whole
@@ -125,7 +125,7 @@
 # these tools as well
 #!BuildIgnore:  pwdutils
 Url:            https://www.kernel.org/pub/linux/utils/util-linux/
-Source:         
https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.xz
+Source:         
https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-%{version}.tar.xz
 Source1:        util-linux-rpmlintrc
 Source4:        raw.service
 Source5:        etc.raw
@@ -135,7 +135,7 @@
 Source9:        remote.pamd
 Source10:       su.pamd
 Source11:       su.default
-Source12:       
https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.sign
+Source12:       
https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-%{version}.tar.sign
 Source13:       %{_name}.keyring
 Source14:       runuser.pamd
 # klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
@@ -166,6 +166,10 @@
 Patch3:         util-linux-lsmem-memory-zone-3.patch
 # Add four commits from upstream to pass tests on ppc64
 Patch4:         util_linux_bigendian.patch
+# PATCH-FIX-UPSTREAM util-linux-cramfs.patch sbra...@suse.com -- Fix 
fsck.cramfs failure on ppc64le.
+Patch5:         util-linux-cramfs.patch
+# PATCH-FIX-UPSTREAM util-linux-fincore-count.patch sbra...@suse.com -- 
Disable bad test fincore/count.
+Patch6:         util-linux-fincore-count.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 #
@@ -407,6 +411,8 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 #
 # setctsid
 cp -p %{S:22} %{S:23} .
@@ -644,7 +650,6 @@
 popd
 install -Dm644 %{SOURCE41} %{buildroot}%{_unitdir}/rfkill-block@.service
 install -Dm644 %{SOURCE42} %{buildroot}%{_unitdir}/rfkill-unblock@.service
-ln -s "../bin/rfkill" %{buildroot}%{_sbindir}/rfkill
 %endif
 #
 # util-linux install
@@ -984,8 +989,6 @@
 %{_bindir}/rename
 %{_bindir}/renice
 %{_bindir}/rev
-%{_bindir}/rfkill
-%{_sbindir}/rfkill
 %{_bindir}/script
 %{_bindir}/scriptreplay
 %{_bindir}/setarch
@@ -1036,6 +1039,7 @@
 %{_sbindir}/raw
 %{_sbindir}/rcraw
 %{_sbindir}/resizepart
+%{_sbindir}/rfkill
 %{_sbindir}/rtcwake
 %{_sbindir}/runuser
 %{_sbindir}/setctsid

++++++ rfkill-block@.service ++++++
--- /var/tmp/diff_new_pack.grcn1P/_old  2018-02-09 15:41:18.684822450 +0100
+++ /var/tmp/diff_new_pack.grcn1P/_new  2018-02-09 15:41:18.684822450 +0100
@@ -4,7 +4,7 @@
 
 [Service]
 Type=oneshot
-ExecStart=/usr/bin/rfkill block %I
+ExecStart=/usr/sbin/rfkill block %I
 
 [Install]
 WantedBy=multi-user.target

++++++ rfkill-unblock@.service ++++++
--- /var/tmp/diff_new_pack.grcn1P/_old  2018-02-09 15:41:18.708821588 +0100
+++ /var/tmp/diff_new_pack.grcn1P/_new  2018-02-09 15:41:18.712821445 +0100
@@ -4,7 +4,7 @@
 
 [Service]
 Type=oneshot
-ExecStart=/usr/bin/rfkill unblock %I
+ExecStart=/usr/sbin/rfkill unblock %I
 
 [Install]
 WantedBy=multi-user.target

++++++ util-linux-2.31.tar.xz -> util-linux-2.31.1.tar.xz ++++++
++++ 60079 lines of diff (skipped)

++++++ util-linux-cramfs.patch ++++++
commit 68ac426949170bb3802a6d610f366f24aa0bb734
Author: Ruediger Meier <ruediger.me...@ga-group.nl>
Date:   Tue Jan 23 16:59:25 2018 +0100

    fsck.cramfs: fix error message
    
    errno is invalid in case that we just read(3) too short.
    
    Signed-off-by: Ruediger Meier <ruediger.me...@ga-group.nl>

commit c990f94cbcc68c7bab47458a09e361ce0791b6d8
Author: Ruediger Meier <ruediger.me...@ga-group.nl>
Date:   Tue Jan 23 16:59:24 2018 +0100

    tests: rewrite fsck-bad-header
    
    Fix test for systems with pagesize != 4096
    Loop over many combinations of sizes, endianness and blocksizes.
    
    Signed-off-by: Ruediger Meier <ruediger.me...@ga-group.nl>

commit 2374b1ab75c66c9ecea86fc97abb6d6c048bcf45
Author: Ruediger Meier <ruediger.me...@ga-group.nl>
Date:   Tue Jan 23 16:59:23 2018 +0100

    fsck.cramfs: fix crash when superblock size is too small
    
    This hopefully fixes the original problem addressed by the reverted
    patch 7cb962c7.
    
    The bug was introduced by myself in
        f991dbd3 "fsck.cramfs: allow smaller superblock sizes"
    
    CC: Tobias Stoeckmann <tob...@stoeckmann.org>
    Signed-off-by: Ruediger Meier <ruediger.me...@ga-group.nl>

commit 919e372da872bcc37502783e80564654569edb22
Author: Ruediger Meier <ruediger.me...@ga-group.nl>
Date:   Tue Jan 23 16:59:22 2018 +0100

    Revert "fsck.cramfs: Fix bus error on broken file system."
    
    This reverts commit 7cb962c77015e9383b53eeb22ce732cb5216bbc3.
    
    It can't be right that we mmap (start + super.size) bytes from a file
    which is usually only super.size bytes large. The patch "fixed" a
    problem when super.size is bad but now it fails for the correct case:
    
    $ mkdir -p root/subdir
    $ ./mkfs.cramfs -p root cramfs
    $ ./fsck.cramfs cramfs
    Bus error (core dumped)
    
    We will fix the original problem later.
    
    CC: Tobias Stoeckmann <tob...@stoeckmann.org>
    Signed-off-by: Ruediger Meier <ruediger.me...@ga-group.nl>

diff -urN util-linux-2.31.1.orig/disk-utils/fsck.cramfs.c 
util-linux-2.31.1/disk-utils/fsck.cramfs.c
--- util-linux-2.31.1.orig/disk-utils/fsck.cramfs.c     2017-12-14 
15:26:35.141144200 +0100
+++ util-linux-2.31.1/disk-utils/fsck.cramfs.c  2018-01-26 18:41:01.001095311 
+0100
@@ -192,7 +192,7 @@
                errx(FSCK_EX_ERROR, _("unsupported filesystem features"));
 
        /* What are valid superblock sizes? */
-       if (super.size < sizeof(struct cramfs_super))
+       if (super.size < *start + sizeof(struct cramfs_super))
                errx(FSCK_EX_UNCORRECTED, _("superblock size (%d) too small"),
                     super.size);
 
@@ -220,24 +220,28 @@
        crc = crc32(0L, NULL, 0);
 
        buf =
-           mmap(NULL, start + super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, 
fd, 0);
+           mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
        if (buf == MAP_FAILED) {
                buf =
-                   mmap(NULL, start + super.size, PROT_READ | PROT_WRITE,
+                   mmap(NULL, super.size, PROT_READ | PROT_WRITE,
                         MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                if (buf != MAP_FAILED) {
-                       if (lseek(fd, start, SEEK_SET) == (off_t) -1)
+                       ssize_t tmp;
+                       if (lseek(fd, 0, SEEK_SET) == (off_t) -1)
                                err(FSCK_EX_ERROR, _("seek on %s failed"), 
filename);
-                       if (read(fd, (unsigned char *) buf + start, super.size) 
!=
-                           (ssize_t) super.size)
+                       tmp = read(fd, buf, super.size);
+                       if (tmp < 0)
                                err(FSCK_EX_ERROR, _("cannot read %s"), 
filename);
+                       if (tmp != (ssize_t) super.size)
+                               errx(FSCK_EX_ERROR, _("failed to read %"PRIu32" 
bytes from file %s"),
+                                       super.size, filename);
                }
        }
        if (buf != MAP_FAILED) {
                ((struct cramfs_super *)((unsigned char *) buf + 
start))->fsid.crc =
                    crc32(0L, NULL, 0);
-               crc = crc32(crc, (unsigned char *) buf + start, super.size);
-               munmap(buf, start + super.size);
+               crc = crc32(crc, (unsigned char *) buf + start, super.size - 
start);
+               munmap(buf, super.size);
        } else {
                int retval;
                size_t length = 0;
diff -urN util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header        
2017-12-14 15:26:46.585066844 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header     1970-01-01 
01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-fsck.cramfs: file extends past end of filesystem
-fsck.cramfs: crc error
diff -urN 
util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-nopad-4K-be 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-nopad-4K-be
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-nopad-4K-be    
1970-01-01 01:00:00.000000000 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-nopad-4K-be 
2018-01-26 18:40:57.401031690 +0100
@@ -0,0 +1,29 @@
+## size: 0
+fsck.cramfs: superblock size (0) too small
+ret: 4
+
+## size: 75
+fsck.cramfs: superblock size (75) too small
+ret: 4
+
+## size: 76
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4095
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4096
+ret: 0
+
+## size: 4097
+fsck.cramfs: file length too short
+ret: 4
+
+## size: 4294967295
+fsck.cramfs: file length too short
+ret: 4
+
diff -urN 
util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-nopad-4K-le 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-nopad-4K-le
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-nopad-4K-le    
1970-01-01 01:00:00.000000000 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-nopad-4K-le 
2018-01-26 18:40:57.401031690 +0100
@@ -0,0 +1,29 @@
+## size: 0
+fsck.cramfs: superblock size (0) too small
+ret: 4
+
+## size: 75
+fsck.cramfs: superblock size (75) too small
+ret: 4
+
+## size: 76
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4095
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4096
+ret: 0
+
+## size: 4097
+fsck.cramfs: file length too short
+ret: 4
+
+## size: 4294967295
+fsck.cramfs: file length too short
+ret: 4
+
diff -urN 
util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-4K-be 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-4K-be
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-4K-be      
1970-01-01 01:00:00.000000000 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-4K-be   
2018-01-26 18:40:57.401031690 +0100
@@ -0,0 +1,29 @@
+## size: 76
+fsck.cramfs: superblock size (76) too small
+ret: 4
+
+## size: 587
+fsck.cramfs: superblock size (587) too small
+ret: 4
+
+## size: 588
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4095
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4096
+ret: 0
+
+## size: 4097
+fsck.cramfs: file length too short
+ret: 4
+
+## size: 4294967295
+fsck.cramfs: file length too short
+ret: 4
+
diff -urN 
util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-4K-le 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-4K-le
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-4K-le      
1970-01-01 01:00:00.000000000 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-4K-le   
2018-01-26 18:40:57.401031690 +0100
@@ -0,0 +1,29 @@
+## size: 76
+fsck.cramfs: superblock size (76) too small
+ret: 4
+
+## size: 587
+fsck.cramfs: superblock size (587) too small
+ret: 4
+
+## size: 588
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4095
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 4096
+ret: 0
+
+## size: 4097
+fsck.cramfs: file length too short
+ret: 4
+
+## size: 4294967295
+fsck.cramfs: file length too short
+ret: 4
+
diff -urN 
util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-64K-be 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-64K-be
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-64K-be     
1970-01-01 01:00:00.000000000 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-64K-be  
2018-01-26 18:40:57.401031690 +0100
@@ -0,0 +1,29 @@
+## size: 76
+fsck.cramfs: superblock size (76) too small
+ret: 4
+
+## size: 587
+fsck.cramfs: superblock size (587) too small
+ret: 4
+
+## size: 588
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 65535
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 65536
+ret: 0
+
+## size: 65537
+fsck.cramfs: file length too short
+ret: 4
+
+## size: 4294967295
+fsck.cramfs: file length too short
+ret: 4
+
diff -urN 
util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-64K-le 
util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-64K-le
--- util-linux-2.31.1.orig/tests/expected/cramfs/fsck-bad-header-pad-64K-le     
1970-01-01 01:00:00.000000000 +0100
+++ util-linux-2.31.1/tests/expected/cramfs/fsck-bad-header-pad-64K-le  
2018-01-26 18:40:57.401031690 +0100
@@ -0,0 +1,29 @@
+## size: 76
+fsck.cramfs: superblock size (76) too small
+ret: 4
+
+## size: 587
+fsck.cramfs: superblock size (587) too small
+ret: 4
+
+## size: 588
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 65535
+fsck.cramfs: file extends past end of filesystem
+fsck.cramfs: crc error
+ret: 4
+
+## size: 65536
+ret: 0
+
+## size: 65537
+fsck.cramfs: file length too short
+ret: 4
+
+## size: 4294967295
+fsck.cramfs: file length too short
+ret: 4
+
diff -urN util-linux-2.31.1.orig/tests/ts/cramfs/fsck-bad-header 
util-linux-2.31.1/tests/ts/cramfs/fsck-bad-header
--- util-linux-2.31.1.orig/tests/ts/cramfs/fsck-bad-header      2017-12-14 
15:26:46.585066844 +0100
+++ util-linux-2.31.1/tests/ts/cramfs/fsck-bad-header   2018-01-26 
18:40:57.401031690 +0100
@@ -16,7 +16,7 @@
 # GNU General Public License for more details.
 #
 TS_TOPDIR="${0%/*}/../.."
-TS_DESC="fsck endianness"
+TS_DESC="fsck bad header"
 
 . $TS_TOPDIR/functions.sh
 ts_init "$*"
@@ -25,14 +25,78 @@
 ts_check_test_command "$TS_CMD_FSCKCRAMFS"
 ts_check_prog "dd"
 
-IMAGE_SOURCE="$TS_OUTDIR/${TS_TESTNAME}-data/root"
+function num2binary()
+{
+       local num=$1
+       local endian=$2
+
+       test "$num" -ge 0 -a "$num" -le 4294967295 || return 1
+       test "$endian" = "be" -o "$endian" = "le" || return 1
+
+       # how to do that easier?
+       if test "$endian" = "be"; then
+               echo -en "$(printf "%08x" "$1" | sed 's/\(..\)/\\x\1/g')"
+       else
+               echo -en "$(printf "%08x" "$1" | sed 
's/^\(..\)\(..\)\(..\)\(..\)$/\\x\4\\x\3\\x\2\\x\1/')"
+       fi
+}
+
+function fsck_loop_sizes()
+{
+       local endian=$1  # be, le
+       local seek=$2    # 4 for nopad, 516 for pad
+       shift 2          # the rest are sizes to loop over
+
+       for size in "$@"; do
+               ts_log "## size: $size"
+               cp -a "$IMAGE_FILE" "$IMAGE_FILE.tmp"
+               num2binary "$size" $endian |
+                       dd of="$IMAGE_FILE.tmp" bs=1 seek="$seek" count=4 
conv=notrunc &> /dev/null
+               $TS_CMD_FSCKCRAMFS "$IMAGE_FILE.tmp" >> $TS_OUTPUT 2>&1
+               ts_log "ret: $?
+"
+       done
+       rm -f "$IMAGE_FILE"
+}
+
+
+IMAGE_SOURCE="$TS_OUTDIR/${TS_TESTNAME}-data"
 IMAGE_FILE="$TS_OUTDIR/${TS_TESTNAME}-cramfs.img"
 
 mkdir -p "${IMAGE_SOURCE}/subdir" &> /dev/null
-$TS_CMD_MKCRAMFS -p -N big $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
-echo -ne \\00\\x4c |
-       dd of=$IMAGE_FILE bs=1 seek=518 count=2 conv=notrunc &> /dev/null
-$TS_CMD_FSCKCRAMFS $IMAGE_FILE >> $TS_OUTPUT 2>&1
+
+ts_init_subtest "nopad-4K-be"
+$TS_CMD_MKCRAMFS -N big -b 4096 $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
+fsck_loop_sizes be 4  0 75 76 4095 4096 4097 4294967295
+rm -f "$IMAGE_FILE"
+ts_finalize_subtest
+
+ts_init_subtest "nopad-4K-le"
+$TS_CMD_MKCRAMFS -N little -b 4096 $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
+fsck_loop_sizes le 4  0 75 76 4095 4096 4097 4294967295
+ts_finalize_subtest
+
+ts_init_subtest "pad-4K-be"
+$TS_CMD_MKCRAMFS -p -N big -b 4096 $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
+fsck_loop_sizes be 516  76 587 588 4095 4096 4097 4294967295
+ts_finalize_subtest
+
+ts_init_subtest "pad-4K-le"
+$TS_CMD_MKCRAMFS -p -N little -b 4096 $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
+fsck_loop_sizes le 516  76 587 588 4095 4096 4097 4294967295
+ts_finalize_subtest
+
+ts_init_subtest "pad-64K-be"
+$TS_CMD_MKCRAMFS -p -N big -b 65536 $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
+fsck_loop_sizes be 516  76 587 588 65535 65536 65537 4294967295
+ts_finalize_subtest
+
+ts_init_subtest "pad-64K-le"
+$TS_CMD_MKCRAMFS -p -N little -b 65536 $IMAGE_SOURCE $IMAGE_FILE &> /dev/null
+fsck_loop_sizes le 516  76 587 588 65535 65536 65537 4294967295
+ts_finalize_subtest
+
+rm -rf "$IMAGE_SOURCE" "$IMAGE_FILE.tmp"
 
 ts_finalize
 
++++++ util-linux-fincore-count.patch ++++++
commit 839203c00ecb6b3dffd0d3eb8c77dac87584c241
Author: Ruediger Meier <ruediger.me...@ga-group.nl>
Date:   Tue Jan 23 16:59:27 2018 +0100

    tests: fix fincore/count KNOWN_FAIL
    
    It has to be set after calling ts_init.
    
    Signed-off-by: Ruediger Meier <ruediger.me...@ga-group.nl>

commit 88e5d289d5dcec3dfb7bc8f8fac89ce789e69d3f
Author: Karel Zak <k...@redhat.com>
Date:   Wed Jan 17 14:41:56 2018 +0100

    tests: mark fincore/count as KNOWN_FAIL
    
    The test (or our expectations about Direct-IO) seems not robust
    enough. I guess this is not fincore problem.
    
    Signed-off-by: Karel Zak <k...@redhat.com>

diff -urN util-linux-2.31.1.orig/tests/ts/fincore/count 
util-linux-2.31.1/tests/ts/fincore/count
--- util-linux-2.31.1.orig/tests/ts/fincore/count       2017-11-23 
13:42:05.508423452 +0100
+++ util-linux-2.31.1/tests/ts/fincore/count    2018-01-31 20:33:12.838715727 
+0100
@@ -8,6 +8,9 @@
 
 ts_check_test_command "$TS_HELPER_SYSINFO"
 
+# Send patch if you know how to keep it portable and robust. Thanks.
+TS_KNOWN_FAIL="yes"
+
 function header
 {
     echo "[" "$1" "]"
++++++ util_linux_bigendian.patch ++++++
--- /var/tmp/diff_new_pack.grcn1P/_old  2018-02-09 15:41:20.648751946 +0100
+++ /var/tmp/diff_new_pack.grcn1P/_new  2018-02-09 15:41:20.652751802 +0100
@@ -1,26 +1,6 @@
-commit 3bd55be742aec60a93ebcdebc325b49737cd6642
-Author: Karel Zak <k...@redhat.com>
-Date:   Tue Dec 12 11:29:02 2017 +0100
-
-    lib/sha1: use ul_/UL_prefix for symbols
-    
-    Unfortunately, the symbols are visible in statically compiled libuuid
-    and the names are too generic.
-    
-    Addresses: https://github.com/karelzak/util-linux/issues/548
-    Signed-off-by: Karel Zak <k...@redhat.com>
-
-commit b4db227582f1d0a14c7b63de8d57e6052b753d57
-Author: Karel Zak <k...@redhat.com>
-Date:   Tue Dec 12 11:38:17 2017 +0100
-
-    test_sha1: update helper
-    
-    Signed-off-by: Karel Zak <k...@redhat.com>
-
 commit 3ae2cb49d9a8c20de1892c691b7cc86f4deb280c
 Author: Karel Zak <k...@redhat.com>
-Date:   Tue Dec 12 11:42:28 2017 +0100
+Date: Tue Dec 12 11:42:28 2017 +0100
 
     lib/sha1: fix indention
     
@@ -31,7 +11,7 @@
 
 commit 4ff4b1106e8c6a71cce59ca40a2019342a92d47d
 Author: Karel Zak <k...@redhat.com>
-Date:   Tue Jan 2 11:08:03 2018 +0100
+Date: Tue Jan 2 11:08:03 2018 +0100
 
     lib/sha1: use proper WORDS_BIGENDIAN macro
     
@@ -41,80 +21,8 @@
     Reported-by: Andreas Schwab <sch...@linux-m68k.org>
     Signed-off-by: Karel Zak <k...@redhat.com>
 
----
- include/sha1.h            |   47 +----
- lib/sha1.c                |  426 
++++++++++++++++++++--------------------------
- libuuid/src/gen_uuid.c    |   12 -
- tests/helpers/test_sha1.c |   12 -
- 4 files changed, 219 insertions(+), 278 deletions(-)
-
-Index: util-linux-2.31/include/sha1.h
-===================================================================
---- util-linux-2.31.orig/include/sha1.h
-+++ util-linux-2.31/include/sha1.h
-@@ -1,5 +1,5 @@
--#ifndef SHA1_H
--#define SHA1_H
-+#ifndef UTIL_LINUX_SHA1_H
-+#define UTIL_LINUX_SHA1_H
- 
- /*
-    SHA-1 in C
-@@ -9,38 +9,19 @@
- 
- #include "stdint.h"
- 
--#define SHA1LENGTH            20
-+#define UL_SHA1LENGTH         20
- 
- typedef struct
- {
--    uint32_t state[5];
--    uint32_t count[2];
--    unsigned char buffer[64];
--} SHA1_CTX;
--
--void SHA1Transform(
--    uint32_t state[5],
--    const unsigned char buffer[64]
--    );
--
--void SHA1Init(
--    SHA1_CTX * context
--    );
--
--void SHA1Update(
--    SHA1_CTX * context,
--    const unsigned char *data,
--    uint32_t len
--    );
--
--void SHA1Final(
--    unsigned char digest[SHA1LENGTH],
--    SHA1_CTX * context
--    );
--
--void SHA1(
--    char *hash_out,
--    const char *str,
--    unsigned len);
-+    uint32_t  state[5];
-+    uint32_t  count[2];
-+    unsigned  char buffer[64];
-+} UL_SHA1_CTX;
-+
-+void ul_SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
-+void ul_SHA1Init(UL_SHA1_CTX *context);
-+void ul_SHA1Update(UL_SHA1_CTX *context, const unsigned char *data, uint32_t 
len);
-+void ul_SHA1Final(unsigned char digest[UL_SHA1LENGTH], UL_SHA1_CTX *context);
-+void ul_SHA1(char *hash_out, const char *str, unsigned len);
- 
--#endif /* SHA1_H */
-+#endif /* UTIL_LINUX_SHA1_H */
-Index: util-linux-2.31/lib/sha1.c
-===================================================================
---- util-linux-2.31.orig/lib/sha1.c
-+++ util-linux-2.31/lib/sha1.c
+--- util-linux-2.31.1/lib/sha1.c       2017-12-19 13:52:18.459949048 +0100
++++ util-linux-2.31.1/lib/sha1.c       2018-01-26 17:51:47.456559746 +0100
 @@ -1,43 +1,31 @@
  /*
 -SHA-1 in C
@@ -173,14 +81,14 @@
  #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
      ^block->l[(i+2)&15]^block->l[i&15],1))
  
-@@ -48,249 +36,221 @@ A million repetitions of "a"
+@@ -48,249 +36,221 @@
  #define R3(v,w,x,y,z,i) 
z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
  #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
  
 -
  /* Hash a single 512-bit block. This is the core of the algorithm. */
  
--void SHA1Transform(
+-void ul_SHA1Transform(
 -    uint32_t state[5],
 -    const unsigned char buffer[64]
 -)
@@ -420,8 +328,8 @@
 -
  /* SHA1Init - Initialize new context */
  
--void SHA1Init(
--    SHA1_CTX * context
+-void ul_SHA1Init(
+-    UL_SHA1_CTX * context
 -)
 +void ul_SHA1Init(UL_SHA1_CTX *context)
  {
@@ -444,8 +352,8 @@
 -
  /* Run your data through this. */
  
--void SHA1Update(
--    SHA1_CTX * context,
+-void ul_SHA1Update(
+-    UL_SHA1_CTX * context,
 -    const unsigned char *data,
 -    uint32_t len
 -)
@@ -465,10 +373,10 @@
 -    if ((j + len) > 63)
 -    {
 -        memcpy(&context->buffer[j], data, (i = 64 - j));
--        SHA1Transform(context->state, context->buffer);
+-        ul_SHA1Transform(context->state, context->buffer);
 -        for (; i + 63 < len; i += 64)
 -        {
--            SHA1Transform(context->state, &data[i]);
+-            ul_SHA1Transform(context->state, &data[i]);
 -        }
 -        j = 0;
 -    }
@@ -495,9 +403,9 @@
 -
  /* Add padding and return the message digest. */
  
--void SHA1Final(
+-void ul_SHA1Final(
 -    unsigned char digest[20],
--    SHA1_CTX * context
+-    UL_SHA1_CTX * context
 -)
 +void ul_SHA1Final(unsigned char digest[20], UL_SHA1_CTX *context)
  {
@@ -548,13 +456,13 @@
 +      }
  #endif
 -    c = 0200;
--    SHA1Update(context, &c, 1);
+-    ul_SHA1Update(context, &c, 1);
 -    while ((context->count[0] & 504) != 448)
 -    {
 -        c = 0000;
--        SHA1Update(context, &c, 1);
+-        ul_SHA1Update(context, &c, 1);
 -    }
--    SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
+-    ul_SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() 
*/
 -    for (i = 0; i < 20; i++)
 -    {
 -        digest[i] = (unsigned char)
@@ -579,21 +487,21 @@
 +      memset(&finalcount, '\0', sizeof(finalcount));
  }
  
--void SHA1(
+-void ul_SHA1(
 -    char *hash_out,
 -    const char *str,
 -    unsigned len)
 +void ul_SHA1(char *hash_out, const char *str, unsigned len)
  {
--    SHA1_CTX ctx;
+-    UL_SHA1_CTX ctx;
 -    unsigned int ii;
 +      UL_SHA1_CTX ctx;
 +      unsigned int ii;
  
--    SHA1Init(&ctx);
+-    ul_SHA1Init(&ctx);
 -    for (ii=0; ii<len; ii+=1)
--        SHA1Update(&ctx, (const unsigned char*)str + ii, 1);
--    SHA1Final((unsigned char *)hash_out, &ctx);
+-        ul_SHA1Update(&ctx, (const unsigned char*)str + ii, 1);
+-    ul_SHA1Final((unsigned char *)hash_out, &ctx);
 -    hash_out[20] = '\0';
 +      ul_SHA1Init(&ctx);
 +      for (ii = 0; ii < len; ii += 1)
@@ -602,62 +510,3 @@
 +      hash_out[20] = '\0';
  }
 -
-Index: util-linux-2.31/libuuid/src/gen_uuid.c
-===================================================================
---- util-linux-2.31.orig/libuuid/src/gen_uuid.c
-+++ util-linux-2.31/libuuid/src/gen_uuid.c
-@@ -589,15 +589,15 @@ void uuid_generate_md5(uuid_t out, const
-  */
- void uuid_generate_sha1(uuid_t out, const uuid_t ns, const char *name, size_t 
len)
- {
--      SHA1_CTX ctx;
--      char hash[SHA1LENGTH];
-+      UL_SHA1_CTX ctx;
-+      char hash[UL_SHA1LENGTH];
- 
--      SHA1Init(&ctx);
-+      ul_SHA1Init(&ctx);
-       /* hash concatenation of well-known UUID with name */
--      SHA1Update(&ctx, ns, sizeof(uuid_t));
--      SHA1Update(&ctx, (const unsigned char *)name, len);
-+      ul_SHA1Update(&ctx, ns, sizeof(uuid_t));
-+      ul_SHA1Update(&ctx, (const unsigned char *)name, len);
- 
--      SHA1Final((unsigned char *)hash, &ctx);
-+      ul_SHA1Final((unsigned char *)hash, &ctx);
- 
-       memcpy(out, hash, sizeof(uuid_t));
- 
-Index: util-linux-2.31/tests/helpers/test_sha1.c
-===================================================================
---- util-linux-2.31.orig/tests/helpers/test_sha1.c
-+++ util-linux-2.31/tests/helpers/test_sha1.c
-@@ -7,22 +7,22 @@
- int main(void)
- {
-       int i, ret;
--      SHA1_CTX ctx;
--      unsigned char digest[SHA1LENGTH];
-+      UL_SHA1_CTX ctx;
-+      unsigned char digest[UL_SHA1LENGTH];
-       unsigned char buf[BUFSIZ];
- 
--      SHA1Init( &ctx );
-+      ul_SHA1Init( &ctx );
- 
-       while(!feof(stdin) && !ferror(stdin)) {
-               ret = fread(buf, 1, sizeof(buf), stdin);
-               if (ret)
--                      SHA1Update( &ctx, buf, ret );
-+                      ul_SHA1Update( &ctx, buf, ret );
-       }
- 
-       fclose(stdin);
--      SHA1Final( digest, &ctx );
-+      ul_SHA1Final( digest, &ctx );
- 
--      for (i = 0; i < SHA1LENGTH; i++)
-+      for (i = 0; i < UL_SHA1LENGTH; i++)
-               printf( "%02x", digest[i] );
-       printf("\n");
-       return 0;


Reply via email to