Hello community, here is the log from the commit of package util-linux for openSUSE:Factory checked in at 2017-06-29 14:58:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/util-linux (Old) and /work/SRC/openSUSE:Factory/.util-linux.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "util-linux" Thu Jun 29 14:58:21 2017 rev:218 rq:504843 version:2.30 Changes: -------- --- /work/SRC/openSUSE:Factory/util-linux/python-libmount.changes 2017-04-25 08:55:22.398971323 +0200 +++ /work/SRC/openSUSE:Factory/.util-linux.new/python-libmount.changes 2017-06-29 14:58:41.756296404 +0200 @@ -1,0 +2,48 @@ +Sun Jun 11 12:12:44 UTC 2017 - lnus...@suse.de + +- don't conflict with sysvinit-tools in Tumblweed anymore. Needed for Leap 15 + which wants to use a different release number scheme (lp150.x which produces + lower numbers than the conflict). + +------------------------------------------------------------------- +Thu Jun 8 21:21:12 UTC 2017 - sweet_...@gmx.de + +- Update to version 2.30: + * Many changes and improvements, most notably: + * The libblkid library has been improved for hybrid CDROM/DVD + media. + * The deprecated command tailf has been removed. Use "tail -f" + from coreutils. + * blkzone -- NEW COMMAND to run zone commands on block devices + that support Zoned Block Commands (ZBC) or Zoned-device ATA + Commands (ZAC). + * fincore -- NEW COMMAND to count pages of file contents in + core (memory). + * lsmem -- NEW COMMAND to list the ranges of available memory + with their online status. + * The command fallocate -- supports an "insert range" operation + now. + * The command "column -t|--table" has been modified to use + libsmartcols. It now provides nearly all of that library's + functionality from the command line. + * Security issues: + * hwclock - no longer makes any internal permission checks. The + System Administrator must set proper permissions to control + user access to the RTC. It is NOT recommended to use SUID. + * CVE-2016-2779 - This security issue is NOT FIXED yet. + * More details at: + https://www.kernel.org/pub/linux/utils/util-linux/v2.30/v2.30-ReleaseNotes +- Drop upstreamed patch + arm64-lscpu-use-sysfs-for-table-access-if-available.patch +- Refreshed patch + util-linux-losetup-Add-support-for-setting-logical-blocksize.patch +- fix compiler warnings for mkzimage_cmdline + +------------------------------------------------------------------- +Thu Jun 8 16:28:41 UTC 2017 - msucha...@suse.com + +- When when hypervisor_decode_sysfw fails continue with other + detection methods (bsc#1042991, bsc#1039360, bsc#1033718) + + util-linux-lscpu-cleanup-DMI-detection-return-codes.patch + +------------------------------------------------------------------- @@ -181 +229 @@ - ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.28/v2.28.2-ReleaseNotes + https://www.kernel.org/pub/linux/utils/util-linux/v2.28/v2.28.2-ReleaseNotes @@ -187 +235 @@ - ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.28/v2.28.1-ReleaseNotes + https://www.kernel.org/pub/linux/utils/util-linux/v2.28/v2.28.1-ReleaseNotes @@ -296 +344 @@ - ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.27/v2.27.1-ReleaseNotes + https://www.kernel.org/pub/linux/utils/util-linux/v2.27/v2.27.1-ReleaseNotes @@ -1851 +1899 @@ - ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.18/v2.18-ReleaseNotes + https://www.kernel.org/pub/linux/utils/util-linux/v2.18/v2.18-ReleaseNotes util-linux-systemd.changes: same change util-linux.changes: same change Old: ---- arm64-lscpu-use-sysfs-for-table-access-if-available.patch util-linux-2.29.2.tar.sign util-linux-2.29.2.tar.xz New: ---- util-linux-2.30.tar.sign util-linux-2.30.tar.xz util-linux-lscpu-cleanup-DMI-detection-return-codes.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-libmount.spec ++++++ --- /var/tmp/diff_new_pack.vKj8Gm/_old 2017-06-29 14:58:52.558771138 +0200 +++ /var/tmp/diff_new_pack.vKj8Gm/_new 2017-06-29 14:58:52.562770572 +0200 @@ -116,7 +116,7 @@ %endif %endif #END SECOND STAGE DEPENDENCIES -Version: 2.29.2 +Version: 2.30 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/v2.29/util-linux-%{version}.tar.xz +Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/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/v2.29/util-linux-%{version}.tar.sign +Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.sign Source13: %{_name}.keyring Source14: runuser.pamd # klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050 @@ -157,8 +157,8 @@ Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff # PATCH-FEATURE-SLE util-linux-losetup-Add-support-for-setting-logical-blocksize.patch bsc931634 FATE319010 h...@suse.de -- Add support for setting logical blocksizes. Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch -# PATCH-BUG-FIX arm64-lscpu-use-sysfs-for-table-access-if-available.patch bsc#1033718 ag...@suse.de -- Use SMBIOS3 tables when available in lscpu -Patch2: arm64-lscpu-use-sysfs-for-table-access-if-available.patch +# PATCH-BUG-FIX util-linux-lscpu-cleanup-DMI-detection-return-codes.patch bsc#1039360 msucha...@suse.de -- lscpu: cleanup DMI detection return codes +Patch2: util-linux-lscpu-cleanup-DMI-detection-return-codes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # %if %build_util_linux @@ -177,8 +177,10 @@ # File conflict of su and kill (up to 12.3 and SLE11). # It should be coreutils < 8.21-4, but coreutils provide Release-less symbol. Conflicts: coreutils < 8.21 +%if 0%{?suse_version} < 1330 # File conflict of sulogin and utmpdump (up to 12.3 and SLE11). Conflicts: sysvinit-tools < 2.88+-87 +%endif # File conflicts of completion files with <= Leap 42.1 and <= SLE12 SP1 (fixed by SLE12 Update, boo#977259#c3). Conflicts: bash-completion <= 2.1-10 # The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775) @@ -601,6 +603,7 @@ export TS_OPT_fdisk_gpt_known_fail="yes" export TS_OPT_fdisk_oddinput_known_fail="yes" export TS_OPT_fdisk_sunlabel_known_fail="yes" +export TS_OPT_fincore_count_known_fail="yes" export TS_OPT_libfdisk_gpt_known_fail="yes" export TS_OPT_misc_flock_known_fail="yes" export TS_OPT_misc_ionice_known_fail="yes" @@ -934,6 +937,7 @@ %{_bindir}/su %{_bindir}/eject %{_bindir}/cal +%{_bindir}/chmem %{_bindir}/chrt %{_bindir}/col %{_bindir}/colcrt @@ -941,6 +945,7 @@ %{_bindir}/column %{_bindir}/dmesg %{_bindir}/fallocate +%{_bindir}/fincore %{_bindir}/findmnt %{_bindir}/flock %{_bindir}/getopt @@ -960,6 +965,7 @@ %{_bindir}/lscpu %{_bindir}/lsipc %{_bindir}/lslocks +%{_bindir}/lsmem %{_bindir}/lsns %{_bindir}/mcookie %{_bindir}/mesg @@ -976,7 +982,6 @@ %{_bindir}/setarch %{_bindir}/setpriv %{_bindir}/setsid -%{_bindir}/tailf %{_bindir}/taskset %{_bindir}/ul %{_bindir}/umount @@ -994,6 +999,10 @@ %{_sbindir}/agetty %{_sbindir}/blkid %{_sbindir}/blkdiscard +# blkzone depends on linux/blkzoned.h +%if 0%{?suse_version} >= 1330 +%{_sbindir}/blkzone +%endif %{_sbindir}/blockdev %{_sbindir}/chcpu %{_sbindir}/ctrlaltdel @@ -1041,6 +1050,7 @@ %{_mandir}/man1/dmesg.1.gz %{_mandir}/man1/eject.1.gz %{_mandir}/man1/fallocate.1.gz +%{_mandir}/man1/fincore.1.gz %{_mandir}/man1/flock.1.gz %{_mandir}/man1/getopt.1.gz %{_mandir}/man1/hexdump.1.gz @@ -1055,6 +1065,7 @@ %{_mandir}/man1/look.1.gz %{_mandir}/man1/lscpu.1.gz %{_mandir}/man1/lsipc.1.gz +%{_mandir}/man1/lsmem.1.gz %{_mandir}/man1/mcookie.1.gz %{_mandir}/man1/mesg.1.gz %{_mandir}/man1/more.1.gz @@ -1070,7 +1081,6 @@ %{_mandir}/man1/script.1.gz %{_mandir}/man1/scriptreplay.1.gz %{_mandir}/man1/setterm.1.gz -%{_mandir}/man1/tailf.1.gz %{_mandir}/man1/taskset.1.gz %{_mandir}/man1/ul.1.gz %{_mandir}/man1/unshare.1.gz @@ -1086,9 +1096,13 @@ %{_mandir}/man5/terminal-colors.d.5.gz %{_mandir}/man8/addpart.8.gz %{_mandir}/man8/agetty.8.gz +%if 0%{?suse_version} >= 1330 +%{_mandir}/man8/blkzone.8.gz +%endif %{_mandir}/man8/blockdev.8.gz -%{_mandir}/man8/delpart.8.gz +%{_mandir}/man8/chmem.8.gz %{_mandir}/man8/ctrlaltdel.8.gz +%{_mandir}/man8/delpart.8.gz %{_mandir}/man8/blkid.8.gz %{_mandir}/man8/blkdiscard.8.gz %{_mandir}/man8/switch_root.8.gz util-linux-systemd.spec: same change ++++++ util-linux.spec ++++++ --- /var/tmp/diff_new_pack.vKj8Gm/_old 2017-06-29 14:58:52.654757584 +0200 +++ /var/tmp/diff_new_pack.vKj8Gm/_new 2017-06-29 14:58:52.658757020 +0200 @@ -116,7 +116,7 @@ %endif %endif #END SECOND STAGE DEPENDENCIES -Version: 2.29.2 +Version: 2.30 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/v2.29/util-linux-%{version}.tar.xz +Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/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/v2.29/util-linux-%{version}.tar.sign +Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.sign Source13: %{_name}.keyring Source14: runuser.pamd # klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050 @@ -157,8 +157,8 @@ Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff # PATCH-FEATURE-SLE util-linux-losetup-Add-support-for-setting-logical-blocksize.patch bsc931634 FATE319010 h...@suse.de -- Add support for setting logical blocksizes. Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch -# PATCH-BUG-FIX arm64-lscpu-use-sysfs-for-table-access-if-available.patch bsc#1033718 ag...@suse.de -- Use SMBIOS3 tables when available in lscpu -Patch2: arm64-lscpu-use-sysfs-for-table-access-if-available.patch +# PATCH-BUG-FIX util-linux-lscpu-cleanup-DMI-detection-return-codes.patch bsc#1039360 msucha...@suse.de -- lscpu: cleanup DMI detection return codes +Patch2: util-linux-lscpu-cleanup-DMI-detection-return-codes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # %if %build_util_linux @@ -177,8 +177,10 @@ # File conflict of su and kill (up to 12.3 and SLE11). # It should be coreutils < 8.21-4, but coreutils provide Release-less symbol. Conflicts: coreutils < 8.21 +%if 0%{?suse_version} < 1330 # File conflict of sulogin and utmpdump (up to 12.3 and SLE11). Conflicts: sysvinit-tools < 2.88+-87 +%endif # File conflicts of completion files with <= Leap 42.1 and <= SLE12 SP1 (fixed by SLE12 Update, boo#977259#c3). Conflicts: bash-completion <= 2.1-10 # The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775) @@ -601,6 +603,7 @@ export TS_OPT_fdisk_gpt_known_fail="yes" export TS_OPT_fdisk_oddinput_known_fail="yes" export TS_OPT_fdisk_sunlabel_known_fail="yes" +export TS_OPT_fincore_count_known_fail="yes" export TS_OPT_libfdisk_gpt_known_fail="yes" export TS_OPT_misc_flock_known_fail="yes" export TS_OPT_misc_ionice_known_fail="yes" @@ -934,6 +937,7 @@ %{_bindir}/su %{_bindir}/eject %{_bindir}/cal +%{_bindir}/chmem %{_bindir}/chrt %{_bindir}/col %{_bindir}/colcrt @@ -941,6 +945,7 @@ %{_bindir}/column %{_bindir}/dmesg %{_bindir}/fallocate +%{_bindir}/fincore %{_bindir}/findmnt %{_bindir}/flock %{_bindir}/getopt @@ -960,6 +965,7 @@ %{_bindir}/lscpu %{_bindir}/lsipc %{_bindir}/lslocks +%{_bindir}/lsmem %{_bindir}/lsns %{_bindir}/mcookie %{_bindir}/mesg @@ -976,7 +982,6 @@ %{_bindir}/setarch %{_bindir}/setpriv %{_bindir}/setsid -%{_bindir}/tailf %{_bindir}/taskset %{_bindir}/ul %{_bindir}/umount @@ -994,6 +999,10 @@ %{_sbindir}/agetty %{_sbindir}/blkid %{_sbindir}/blkdiscard +# blkzone depends on linux/blkzoned.h +%if 0%{?suse_version} >= 1330 +%{_sbindir}/blkzone +%endif %{_sbindir}/blockdev %{_sbindir}/chcpu %{_sbindir}/ctrlaltdel @@ -1041,6 +1050,7 @@ %{_mandir}/man1/dmesg.1.gz %{_mandir}/man1/eject.1.gz %{_mandir}/man1/fallocate.1.gz +%{_mandir}/man1/fincore.1.gz %{_mandir}/man1/flock.1.gz %{_mandir}/man1/getopt.1.gz %{_mandir}/man1/hexdump.1.gz @@ -1055,6 +1065,7 @@ %{_mandir}/man1/look.1.gz %{_mandir}/man1/lscpu.1.gz %{_mandir}/man1/lsipc.1.gz +%{_mandir}/man1/lsmem.1.gz %{_mandir}/man1/mcookie.1.gz %{_mandir}/man1/mesg.1.gz %{_mandir}/man1/more.1.gz @@ -1070,7 +1081,6 @@ %{_mandir}/man1/script.1.gz %{_mandir}/man1/scriptreplay.1.gz %{_mandir}/man1/setterm.1.gz -%{_mandir}/man1/tailf.1.gz %{_mandir}/man1/taskset.1.gz %{_mandir}/man1/ul.1.gz %{_mandir}/man1/unshare.1.gz @@ -1086,9 +1096,13 @@ %{_mandir}/man5/terminal-colors.d.5.gz %{_mandir}/man8/addpart.8.gz %{_mandir}/man8/agetty.8.gz +%if 0%{?suse_version} >= 1330 +%{_mandir}/man8/blkzone.8.gz +%endif %{_mandir}/man8/blockdev.8.gz -%{_mandir}/man8/delpart.8.gz +%{_mandir}/man8/chmem.8.gz %{_mandir}/man8/ctrlaltdel.8.gz +%{_mandir}/man8/delpart.8.gz %{_mandir}/man8/blkid.8.gz %{_mandir}/man8/blkdiscard.8.gz %{_mandir}/man8/switch_root.8.gz ++++++ mkzimage_cmdline.c ++++++ --- /var/tmp/diff_new_pack.vKj8Gm/_old 2017-06-29 14:58:52.782739514 +0200 +++ /var/tmp/diff_new_pack.vKj8Gm/_new 2017-06-29 14:58:52.782739514 +0200 @@ -162,9 +162,9 @@ if (clear) memset(s, 0x0, tmp - s); if (set) - snprintf(s, tmp - s, "%s", string); + snprintf((char*)s, tmp - s, "%s", string); } else { - fprintf(stdout, "cmd_line size:%d\n", tmp - s); + fprintf(stdout, "cmd_line size:%td\n", tmp - s); fprintf(stdout, "cmd_line: %s\n", s); fprintf(stdout, "active: %c\n", *active); } ++++++ util-linux-2.29.2.tar.xz -> util-linux-2.30.tar.xz ++++++ ++++ 488865 lines of diff (skipped) ++++++ util-linux-losetup-Add-support-for-setting-logical-blocksize.patch ++++++ --- /var/tmp/diff_new_pack.vKj8Gm/_old 2017-06-29 14:58:55.398370197 +0200 +++ /var/tmp/diff_new_pack.vKj8Gm/_new 2017-06-29 14:58:55.398370197 +0200 @@ -1,7 +1,20 @@ -Index: util-linux-2.29/include/loopdev.h -=================================================================== ---- util-linux-2.29.orig/include/loopdev.h -+++ util-linux-2.29/include/loopdev.h +From a60cc5c2eeaad7ea5ea0c4a74cc4af5e2dc3f6c2 Mon Sep 17 00:00:00 2001 +From: Ruediger Meier <ruediger.me...@ga-group.nl> +Date: Tue, 4 Apr 2017 16:29:58 +0200 +Subject: [PATCH] + util-linux-losetup-Add-support-for-setting-logical-blocksize.patch + +Signed-off-by: Ruediger Meier <ruediger.me...@ga-group.nl> +--- + include/loopdev.h | 5 ++++- + lib/loopdev.c | 20 ++++++++++++++++++++ + sys-utils/losetup.c | 19 +++++++++++++++---- + 3 files changed, 39 insertions(+), 5 deletions(-) + +diff --git a/include/loopdev.h b/include/loopdev.h +index 953d2db..7c783bf 100644 +--- a/include/loopdev.h ++++ b/include/loopdev.h @@ -41,6 +41,7 @@ enum { LO_FLAGS_AUTOCLEAR = 4, /* kernel >= 2.6.25 */ LO_FLAGS_PARTSCAN = 8, /* kernel >= 3.2 */ @@ -20,7 +33,7 @@ }; /* -@@ -173,6 +175,7 @@ int loopcxt_set_offset(struct loopdev_cx +@@ -173,6 +175,7 @@ int loopcxt_set_offset(struct loopdev_cxt *lc, uint64_t offset); int loopcxt_set_sizelimit(struct loopdev_cxt *lc, uint64_t sizelimit); int loopcxt_set_flags(struct loopdev_cxt *lc, uint32_t flags); int loopcxt_set_backing_file(struct loopdev_cxt *lc, const char *filename); @@ -28,11 +41,11 @@ extern char *loopcxt_get_backing_file(struct loopdev_cxt *lc); extern int loopcxt_get_backing_devno(struct loopdev_cxt *lc, dev_t *devno); -Index: util-linux-2.29/lib/loopdev.c -=================================================================== ---- util-linux-2.29.orig/lib/loopdev.c -+++ util-linux-2.29/lib/loopdev.c -@@ -1115,6 +1115,26 @@ int loopcxt_set_backing_file(struct loop +diff --git a/lib/loopdev.c b/lib/loopdev.c +index fd4f166..b85e2ce 100644 +--- a/lib/loopdev.c ++++ b/lib/loopdev.c +@@ -1115,6 +1115,26 @@ int loopcxt_set_backing_file(struct loopdev_cxt *lc, const char *filename) } /* @@ -59,19 +72,19 @@ * In kernels prior to v3.9, if the offset or sizelimit options * are used, the block device's size won't be synced automatically. * blockdev --getsize64 and filesystems will use the backing -Index: util-linux-2.29/sys-utils/losetup.c -=================================================================== ---- util-linux-2.29.orig/sys-utils/losetup.c -+++ util-linux-2.29/sys-utils/losetup.c -@@ -398,6 +398,7 @@ static void usage(FILE *out) - +diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c +index 2218d3b..d8f1bfa 100644 +--- a/sys-utils/losetup.c ++++ b/sys-utils/losetup.c +@@ -399,6 +399,7 @@ static void usage(FILE *out) + fputs(USAGE_SEPARATOR, out); fputs(_(" -o, --offset <num> start at offset <num> into file\n"), out); fputs(_(" --sizelimit <num> device is limited to <num> bytes of the file\n"), out); + fputs(_(" --logical-blocksize <size> set the logical block size to <size>\n"), out); fputs(_(" -P, --partscan create a partitioned loop device\n"), out); fputs(_(" -r, --read-only set up a read-only loop device\n"), out); fputs(_(" --direct-io[=<on|off>] open backing file with O_DIRECT\n"), out); -@@ -447,7 +448,8 @@ static void warn_size(const char *filena +@@ -448,7 +449,8 @@ static void warn_size(const char *filename, uint64_t size) static int create_loop(struct loopdev_cxt *lc, int nooverlap, int lo_flags, int flags, @@ -81,7 +94,7 @@ { int hasdev = loopcxt_has_device(lc); int rc = 0; -@@ -533,6 +535,8 @@ static int create_loop(struct loopdev_cx +@@ -534,6 +536,8 @@ static int create_loop(struct loopdev_cxt *lc, loopcxt_set_offset(lc, offset); if (flags & LOOPDEV_FL_SIZELIMIT) loopcxt_set_sizelimit(lc, sizelimit); @@ -90,7 +103,7 @@ if (lo_flags) loopcxt_set_flags(lc, lo_flags); if ((rc = loopcxt_set_backing_file(lc, file))) { -@@ -561,7 +565,7 @@ int main(int argc, char **argv) +@@ -562,7 +566,7 @@ int main(int argc, char **argv) struct loopdev_cxt lc; int act = 0, flags = 0, no_overlap = 0, c; char *file = NULL; @@ -99,7 +112,7 @@ int res = 0, showdev = 0, lo_flags = 0; char *outarg = NULL; int list = 0; -@@ -571,7 +575,8 @@ int main(int argc, char **argv) +@@ -572,7 +576,8 @@ int main(int argc, char **argv) OPT_SIZELIMIT = CHAR_MAX + 1, OPT_SHOW, OPT_RAW, @@ -108,16 +121,16 @@ + OPT_BLOCKSIZE, }; static const struct option longopts[] = { - { "all", 0, 0, 'a' }, -@@ -584,6 +589,7 @@ int main(int argc, char **argv) - { "associated", 1, 0, 'j' }, - { "json", 0, 0, 'J' }, - { "list", 0, 0, 'l' }, -+ { "logical-blocksize", 1, 0, OPT_BLOCKSIZE }, - { "noheadings", 0, 0, 'n' }, - { "offset", 1, 0, 'o' }, - { "output", 1, 0, 'O' }, -@@ -657,6 +663,10 @@ int main(int argc, char **argv) + { "all", no_argument, NULL, 'a' }, +@@ -585,6 +590,7 @@ int main(int argc, char **argv) + { "associated", required_argument, NULL, 'j' }, + { "json", no_argument, NULL, 'J' }, + { "list", no_argument, NULL, 'l' }, ++ { "logical-blocksize", required_argument, NULL, OPT_BLOCKSIZE }, + { "noheadings", no_argument, NULL, 'n' }, + { "offset", required_argument, NULL, 'o' }, + { "output", required_argument, NULL, 'O' }, +@@ -658,6 +664,10 @@ int main(int argc, char **argv) act = A_SHOW; file = optarg; break; @@ -128,7 +141,7 @@ case 'l': list = 1; break; -@@ -789,7 +799,8 @@ int main(int argc, char **argv) +@@ -790,7 +800,8 @@ int main(int argc, char **argv) switch (act) { case A_CREATE: @@ -138,3 +151,6 @@ if (res == 0) { if (showdev) printf("%s\n", loopcxt_get_device(&lc)); +-- +1.8.5.6 + ++++++ util-linux-lscpu-cleanup-DMI-detection-return-codes.patch ++++++ >From c972852b29391c35b1d5c7d3e1e6413e0cc86908 Mon Sep 17 00:00:00 2001 From: Karel Zak <k...@redhat.com> Date: Tue, 13 Jun 2017 12:15:11 +0200 Subject: [PATCH] lscpu: cleanup DMI detection return codes Michal wrote: There is weird mix of logic in lscpu-dmi.c which sometimes returns 0 and sometimes -1 on error. Since most checks are if (rc) goto done; this bails out early on error skipping some detection methods. Further, in lscpu.c all following detections are guarder by if(hyper) so returning -1 causes all following methods to be skipped. Reported-by: Michal Suchanek <msucha...@suse.de> Signed-off-by: Karel Zak <k...@redhat.com> --- sys-utils/lscpu-dmi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c index 3ba999124a2e..4b845b97ccd9 100644 --- a/sys-utils/lscpu-dmi.c +++ b/sys-utils/lscpu-dmi.c @@ -174,7 +174,7 @@ done: static int hypervisor_decode_legacy(uint8_t *buf, const char *devmem) { if (!checksum(buf, 0x0F)) - return HYPER_NONE; + return -1; return hypervisor_from_dmi_table(DWORD(buf + 0x08), WORD(buf + 0x06), WORD(buf + 0x0C), @@ -254,11 +254,15 @@ int read_hypervisor_dmi(void) || sizeof(uint16_t) != 2 || sizeof(uint32_t) != 4 || '\0' != 0) - return rc; + goto done; + /* -1 : no DMI in /sys, + * 0 : DMI exist, nothing detected (HYPER_NONE) + * >0 : hypervisor detected + */ rc = hypervisor_decode_sysfw(); - if (rc >= 0) - return rc; + if (rc >= HYPER_NONE) + goto done; /* First try EFI (ia64, Intel-based Mac) */ switch (address_from_efi(&fp)) { @@ -273,8 +277,9 @@ int read_hypervisor_dmi(void) goto done; rc = hypervisor_decode_smbios(buf, _PATH_DEV_MEM); - if (rc) + if (rc >= HYPER_NONE) goto done; + free(buf); buf = NULL; memory_scan: @@ -287,17 +292,17 @@ memory_scan: for (fp = 0; fp <= 0xFFF0; fp += 16) { if (memcmp(buf + fp, "_SM_", 4) == 0 && fp <= 0xFFE0) { rc = hypervisor_decode_smbios(buf + fp, _PATH_DEV_MEM); - if (rc == -1) + if (rc < 0) fp += 16; } else if (memcmp(buf + fp, "_DMI_", 5) == 0) rc = hypervisor_decode_legacy(buf + fp, _PATH_DEV_MEM); - if (rc >= 0) + if (rc >= HYPER_NONE) break; } #endif done: free(buf); - return rc; + return rc < 0 ? HYPER_NONE : rc; } -- 2.12.3