forked from pool/util-linux
Accepting request 571531 from Base:System
OBS-URL: https://build.opensuse.org/request/show/571531 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=225
This commit is contained in:
commit
6765e598f0
@ -1,3 +1,24 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 31 20:34:56 CET 2018 - sbrabec@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)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 21 20:15:00 UTC 2018 - jengelh@inai.de
|
||||
|
||||
|
@ -73,7 +73,7 @@ Name: python-libmount
|
||||
%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 @@ BuildRequires: libmount-devel
|
||||
%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 @@ Release: 0
|
||||
# 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 @@ Source8: login.pamd
|
||||
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 @@ Patch2: util-linux-lsmem-memory-zone-2.patch
|
||||
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 sbrabec@suse.com -- Fix fsck.cramfs failure on ppc64le.
|
||||
Patch5: util-linux-cramfs.patch
|
||||
# PATCH-FIX-UPSTREAM util-linux-fincore-count.patch sbrabec@suse.com -- Disable bad test fincore/count.
|
||||
Patch6: util-linux-fincore-count.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
#
|
||||
@ -390,7 +394,6 @@ SMP systems.
|
||||
%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 @@ library.
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
#
|
||||
# setctsid
|
||||
cp -p %{S:22} %{S:23} .
|
||||
@ -645,7 +650,6 @@ make install DEST=%{buildroot}
|
||||
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 @@ getent passwd uuidd >/dev/null || \
|
||||
%{_bindir}/rename
|
||||
%{_bindir}/renice
|
||||
%{_bindir}/rev
|
||||
%{_bindir}/rfkill
|
||||
%{_sbindir}/rfkill
|
||||
%{_bindir}/script
|
||||
%{_bindir}/scriptreplay
|
||||
%{_bindir}/setarch
|
||||
@ -1037,6 +1039,7 @@ getent passwd uuidd >/dev/null || \
|
||||
%{_sbindir}/raw
|
||||
%{_sbindir}/rcraw
|
||||
%{_sbindir}/resizepart
|
||||
%{_sbindir}/rfkill
|
||||
%{_sbindir}/rtcwake
|
||||
%{_sbindir}/runuser
|
||||
%{_sbindir}/setctsid
|
||||
|
@ -4,7 +4,7 @@ After=rfkill-unblock@all.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/rfkill block %I
|
||||
ExecStart=/usr/sbin/rfkill block %I
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -4,7 +4,7 @@ After=rfkill-block@all.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/rfkill unblock %I
|
||||
ExecStart=/usr/sbin/rfkill unblock %I
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
16
util-linux-2.31.1.tar.sign
Normal file
16
util-linux-2.31.1.tar.sign
Normal file
@ -0,0 +1,16 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAlo5LQkACgkQ5LcdXuw5
|
||||
woSyww//djBJmPc3Jvy7eJSVjC3xbFgro7wHaAM0BSFYgiW1aSsR04sSwGIEMtbv
|
||||
EMOyF83qVKSoiWb57VOeJGSCWXUPkMPaTzretEyaD5IH3rHBDp7Q5oTUMlNmLnoT
|
||||
q86oYBKNXox5bbLHPqpQaLUGGJWIjz9suRtT1Uau+ZKRudO3f9YZCJBnCkqTpqX+
|
||||
7TqPK53Gen1jw3u7kz1CRDMsTllfV1Gw+hhq8YI/xPApTLRIcBWq9DUVu9v5PHjQ
|
||||
M8rh9d3693mgkhtPQAGShKpC8nz0013AOG8bJm0yL69YWlVdhFDR2DColxZE1nEe
|
||||
3T7aZPZCseObHR1rqMUngKMD6B6D7XPfexWuWXRHgr7Aayz6S/IOYTvTjtBkgNri
|
||||
KJ+QDn/6Xs5xTsWu6wSh7wXfjtwk7NuLY1pVo9pL3r4KmfIBbODwE80FKSqCwHJm
|
||||
kI7J2QIiaKGWfry6vqrUgECGY48f1W0PNfgCbdJDW1HsVCvTaUiXfIc++HTxgxpv
|
||||
6IcU1a4ikVT9zRMVE5ypgZPIkwSaGJgeV1YwCa9qanM3dx86D/DTzLVdr/Nhvn96
|
||||
uPdp287aebllU+O1QK/79q5pf/UcBofgNc9GsVgtqlKNYN+REuoqYsDQ/Sz12kor
|
||||
SdF/tR3qtdTucdD/4fUcF2Uv8RLmc4cknZdz37ld6q0TSeyZShE=
|
||||
=uflt
|
||||
-----END PGP SIGNATURE-----
|
3
util-linux-2.31.1.tar.xz
Normal file
3
util-linux-2.31.1.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1a51b16fa9cd51d26ef9ab52d2f1de12403b810fc8252bf7d478df91b3cddf11
|
||||
size 4510096
|
@ -1,16 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAlnoipIACgkQ5LcdXuw5
|
||||
woSnthAAhqdxus2J9uxERU1JwMJxiDpjwZnRR3NFHvBlY04maoaniAsVlQG8uWWr
|
||||
xE13jVkiG2hc+llt4UhDJA3sT0Hz1elNOKJD6fsZ598fptTYvF3fqLjstuJGCVyF
|
||||
hDio8lqAqurnpX3jtyG0tNrT3CVIUU2jrTq9QXqpB8jq699ez8xulMdU+VEqmbOg
|
||||
E5i5skWxfnaYxleXN8WkV+5WZx2tczWufLqVbLcUE7bOUyiEAubmXhbm9xgOJ8pX
|
||||
cUrOverbfvopZYlIUB44UcNYyWsj12r7/aIQBh2q6xmv5wOOAiZzFMBh4eZu07vc
|
||||
jZFKv2GYxVBU+e/1ERH0x4xbxCRXV9l1G9+V/H9GSbGCHK0+/0r7MzXf+QiADowx
|
||||
YkqROTvfTagNVPBbzU0pNeTsQs+AZg49JhTcCBVtk1yxufOK3BuRqU5PtuDBQCw4
|
||||
u8Z/kkZSdaOexJeaBJDhHEvPTCkAUBcuppU9tJ8dZ+3Orpdb8ghbBOxS3VUKIHn5
|
||||
FAnaC7OLPPB2uBTKrG5JH+mUnXCTYfctEPB3D/Rnjsyjs+T8h6zf5cnQ6NFvXPxw
|
||||
xm8FA3bcKvdSVcLwqFQLkvORfy1/Ju53HRDABSDLe4yjTUi8oAj4hqbR607/XPMA
|
||||
ZYBRRZntdKNLcrQUjnawjaExXcR2oACocaZ8Ul+mpaXsmjKIEc8=
|
||||
=u6TW
|
||||
-----END PGP SIGNATURE-----
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f9be7cdcf4fc5c5064a226599acdda6bdf3d86c640152ba01ea642d91108dc8a
|
||||
size 4503892
|
406
util-linux-cramfs.patch
Normal file
406
util-linux-cramfs.patch
Normal file
@ -0,0 +1,406 @@
|
||||
commit 68ac426949170bb3802a6d610f366f24aa0bb734
|
||||
Author: Ruediger Meier <ruediger.meier@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.meier@ga-group.nl>
|
||||
|
||||
commit c990f94cbcc68c7bab47458a09e361ce0791b6d8
|
||||
Author: Ruediger Meier <ruediger.meier@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.meier@ga-group.nl>
|
||||
|
||||
commit 2374b1ab75c66c9ecea86fc97abb6d6c048bcf45
|
||||
Author: Ruediger Meier <ruediger.meier@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 <tobias@stoeckmann.org>
|
||||
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
||||
|
||||
commit 919e372da872bcc37502783e80564654569edb22
|
||||
Author: Ruediger Meier <ruediger.meier@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 <tobias@stoeckmann.org>
|
||||
Signed-off-by: Ruediger Meier <ruediger.meier@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
|
||||
|
34
util-linux-fincore-count.patch
Normal file
34
util-linux-fincore-count.patch
Normal file
@ -0,0 +1,34 @@
|
||||
commit 839203c00ecb6b3dffd0d3eb8c77dac87584c241
|
||||
Author: Ruediger Meier <ruediger.meier@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.meier@ga-group.nl>
|
||||
|
||||
commit 88e5d289d5dcec3dfb7bc8f8fac89ce789e69d3f
|
||||
Author: Karel Zak <kzak@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 <kzak@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" "]"
|
@ -1,3 +1,24 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 31 20:34:56 CET 2018 - sbrabec@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)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 21 20:15:00 UTC 2018 - jengelh@inai.de
|
||||
|
||||
|
@ -116,7 +116,7 @@ BuildRequires: libmount-devel
|
||||
%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 @@ Release: 0
|
||||
# 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 @@ Source8: login.pamd
|
||||
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 @@ Patch2: util-linux-lsmem-memory-zone-2.patch
|
||||
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 sbrabec@suse.com -- Fix fsck.cramfs failure on ppc64le.
|
||||
Patch5: util-linux-cramfs.patch
|
||||
# PATCH-FIX-UPSTREAM util-linux-fincore-count.patch sbrabec@suse.com -- Disable bad test fincore/count.
|
||||
Patch6: util-linux-fincore-count.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
#
|
||||
@ -407,6 +411,8 @@ library.
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
#
|
||||
# setctsid
|
||||
cp -p %{S:22} %{S:23} .
|
||||
@ -644,7 +650,6 @@ make install DEST=%{buildroot}
|
||||
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 @@ getent passwd uuidd >/dev/null || \
|
||||
%{_bindir}/rename
|
||||
%{_bindir}/renice
|
||||
%{_bindir}/rev
|
||||
%{_bindir}/rfkill
|
||||
%{_sbindir}/rfkill
|
||||
%{_bindir}/script
|
||||
%{_bindir}/scriptreplay
|
||||
%{_bindir}/setarch
|
||||
@ -1036,6 +1039,7 @@ getent passwd uuidd >/dev/null || \
|
||||
%{_sbindir}/raw
|
||||
%{_sbindir}/rcraw
|
||||
%{_sbindir}/resizepart
|
||||
%{_sbindir}/rfkill
|
||||
%{_sbindir}/rtcwake
|
||||
%{_sbindir}/runuser
|
||||
%{_sbindir}/setctsid
|
||||
|
@ -1,3 +1,24 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 31 20:34:56 CET 2018 - sbrabec@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)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 21 20:15:00 UTC 2018 - jengelh@inai.de
|
||||
|
||||
|
@ -116,7 +116,7 @@ BuildRequires: libmount-devel
|
||||
%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 @@ Release: 0
|
||||
# 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 @@ Source8: login.pamd
|
||||
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 @@ Patch2: util-linux-lsmem-memory-zone-2.patch
|
||||
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 sbrabec@suse.com -- Fix fsck.cramfs failure on ppc64le.
|
||||
Patch5: util-linux-cramfs.patch
|
||||
# PATCH-FIX-UPSTREAM util-linux-fincore-count.patch sbrabec@suse.com -- Disable bad test fincore/count.
|
||||
Patch6: util-linux-fincore-count.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
#
|
||||
@ -407,6 +411,8 @@ library.
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
#
|
||||
# setctsid
|
||||
cp -p %{S:22} %{S:23} .
|
||||
@ -644,7 +650,6 @@ make install DEST=%{buildroot}
|
||||
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 @@ getent passwd uuidd >/dev/null || \
|
||||
%{_bindir}/rename
|
||||
%{_bindir}/renice
|
||||
%{_bindir}/rev
|
||||
%{_bindir}/rfkill
|
||||
%{_sbindir}/rfkill
|
||||
%{_bindir}/script
|
||||
%{_bindir}/scriptreplay
|
||||
%{_bindir}/setarch
|
||||
@ -1036,6 +1039,7 @@ getent passwd uuidd >/dev/null || \
|
||||
%{_sbindir}/raw
|
||||
%{_sbindir}/rcraw
|
||||
%{_sbindir}/resizepart
|
||||
%{_sbindir}/rfkill
|
||||
%{_sbindir}/rtcwake
|
||||
%{_sbindir}/runuser
|
||||
%{_sbindir}/setctsid
|
||||
|
@ -1,23 +1,3 @@
|
||||
commit 3bd55be742aec60a93ebcdebc325b49737cd6642
|
||||
Author: Karel Zak <kzak@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 <kzak@redhat.com>
|
||||
|
||||
commit b4db227582f1d0a14c7b63de8d57e6052b753d57
|
||||
Author: Karel Zak <kzak@redhat.com>
|
||||
Date: Tue Dec 12 11:38:17 2017 +0100
|
||||
|
||||
test_sha1: update helper
|
||||
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
commit 3ae2cb49d9a8c20de1892c691b7cc86f4deb280c
|
||||
Author: Karel Zak <kzak@redhat.com>
|
||||
Date: Tue Dec 12 11:42:28 2017 +0100
|
||||
@ -41,80 +21,8 @@ Date: Tue Jan 2 11:08:03 2018 +0100
|
||||
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
|
||||
Signed-off-by: Karel Zak <kzak@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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
#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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
-
|
||||
/* 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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
-
|
||||
/* 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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
- 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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
-
|
||||
/* 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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
+ }
|
||||
#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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
+ 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 @@ Index: util-linux-2.31/lib/sha1.c
|
||||
+ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user