diff --git a/fdisk-fix-quit-dialog-for-non-libreadline-version.patch b/fdisk-fix-quit-dialog-for-non-libreadline-version.patch deleted file mode 100644 index b9e5559..0000000 --- a/fdisk-fix-quit-dialog-for-non-libreadline-version.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 40af0db4cdadc50d9ba7ea77d8fa0689bf976f9f Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 5 Sep 2019 12:34:01 +0200 -Subject: [PATCH] fdisk: fix quit dialog for non-libreadline version - -We need to clear stdin errors otherwise it returns EOF forever after -CTRL+D. - -Reported-by: Lukas Czerner -Signed-off-by: Karel Zak ---- - disk-utils/fdisk.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c -index 81334d0..0502fa3 100644 ---- a/disk-utils/fdisk.c -+++ b/disk-utils/fdisk.c -@@ -109,6 +109,7 @@ int get_user_reply(const char *prompt, char *buf, size_t bufsz) - if (is_interactive) - rl_callback_handler_install(prompt, reply_linehandler); - #endif -+ errno = 0; - reply_running = 1; - do { - int rc; -@@ -158,6 +159,7 @@ int get_user_reply(const char *prompt, char *buf, size_t bufsz) - if (!*buf) { - DBG(ASK, ul_debug("cancel by CTRL+D")); - ret = -ECANCELED; -+ clearerr(stdin); - goto done; - } - -@@ -168,13 +170,13 @@ int get_user_reply(const char *prompt, char *buf, size_t bufsz) - if (sz && *(buf + sz - 1) == '\n') - *(buf + sz - 1) = '\0'; - -- DBG(ASK, ul_debug("user's reply: >>>%s<<<", buf)); - done: - #ifdef HAVE_LIBREADLINE - if (is_interactive) - rl_callback_handler_remove(); - #endif - sigaction(SIGINT, &oldact, NULL); -+ DBG(ASK, ul_debug("user's reply: >>>%s<<< [rc=%d]", buf, ret)); - return ret; - } - --- -1.8.3.1 - diff --git a/libmount-parser-fix-memory-leak-on-error-before-end-.patch b/libmount-parser-fix-memory-leak-on-error-before-end-.patch new file mode 100644 index 0000000..e50e234 --- /dev/null +++ b/libmount-parser-fix-memory-leak-on-error-before-end-.patch @@ -0,0 +1,114 @@ +From fe0d12d4f82269096f8d0cffc51ca9590814c284 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Fri, 26 Jun 2020 12:59:32 +0200 +Subject: [PATCH 821/863] libmount: (parser) fix memory leak on error before + end-of-file + +Let's simplify the loop where we add FS to the table. The optimization +for recoverable errors is a fragile overkill. The new code always +allocates and unrefs FS for each loop. + +Addresses: https://github.com/karelzak/util-linux/pull/1068 +Signed-off-by: Karel Zak +--- + libmount/src/fs.c | 2 +- + libmount/src/tab_parse.c | 49 ++++++++++++++++++++++++++---------------------- + 2 files changed, 28 insertions(+), 23 deletions(-) + +diff --git a/libmount/src/fs.c b/libmount/src/fs.c +index bcc8273..52f937a 100644 +--- a/libmount/src/fs.c ++++ b/libmount/src/fs.c +@@ -39,7 +39,7 @@ struct libmnt_fs *mnt_new_fs(void) + + fs->refcount = 1; + INIT_LIST_HEAD(&fs->ents); +- /*DBG(FS, ul_debugobj(fs, "alloc"));*/ ++ DBG(FS, ul_debugobj(fs, "alloc")); + return fs; + } + +diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c +index 3b52f6b..e3f30c2 100644 +--- a/libmount/src/tab_parse.c ++++ b/libmount/src/tab_parse.c +@@ -703,7 +703,6 @@ static int __table_parse_stream(struct libmnt_table *tb, FILE *f, const char *fi + int rc = -1; + int flags = 0; + pid_t tid = -1; +- struct libmnt_fs *fs = NULL; + struct libmnt_parser pa = { .line = 0 }; + + assert(tb); +@@ -723,19 +722,25 @@ static int __table_parse_stream(struct libmnt_table *tb, FILE *f, const char *fi + if (filename && strcmp(filename, _PATH_PROC_MOUNTS) == 0) + flags = MNT_FS_KERNEL; + +- while (!feof(f)) { +- if (!fs) { +- fs = mnt_new_fs(); +- if (!fs) +- goto err; ++ do { ++ struct libmnt_fs *fs; ++ ++ if (feof(f)) { ++ DBG(TAB, ul_debugobj(tb, "end-of-file")); ++ break; + } ++ fs = mnt_new_fs(); ++ if (!fs) ++ goto err; + ++ /* parse */ + rc = mnt_table_parse_next(&pa, tb, fs); + +- if (!rc && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data)) +- rc = 1; /* filtered out by callback... */ ++ if (rc != 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data)) ++ rc = 1; /* error filtered out by callback... */ + +- if (!rc) { ++ /* add to the table */ ++ if (rc == 0) { + rc = mnt_table_add_fs(tb, fs); + fs->flags |= flags; + +@@ -746,21 +751,21 @@ static int __table_parse_stream(struct libmnt_table *tb, FILE *f, const char *fi + } + } + +- if (rc) { +- if (rc > 0) { +- mnt_reset_fs(fs); +- assert(fs->refcount == 1); +- continue; /* recoverable error, reuse fs*/ +- } ++ /* remove refernece (or deallocate on error) */ ++ mnt_unref_fs(fs); + +- mnt_unref_fs(fs); +- if (feof(f)) +- break; +- goto err; /* fatal error */ ++ /* recoverable error */ ++ if (rc > 0) { ++ DBG(TAB, ul_debugobj(tb, "recoverable error (continue)")); ++ continue; + } +- mnt_unref_fs(fs); +- fs = NULL; +- } ++ ++ /* fatal errors */ ++ if (rc < 0 && !feof(f)) { ++ DBG(TAB, ul_debugobj(tb, "fatal error")); ++ goto err; ++ } ++ } while (1); + + DBG(TAB, ul_debugobj(tb, "%s: stop parsing (%d entries)", + filename, mnt_table_get_nents(tb))); +-- +1.8.3.1 + diff --git a/lscpu-Add-HiSilicon-aarch64-tsv110-cpupart.patch b/lscpu-Add-HiSilicon-aarch64-tsv110-cpupart.patch deleted file mode 100644 index 6d6efa0..0000000 --- a/lscpu-Add-HiSilicon-aarch64-tsv110-cpupart.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6f00af5b3c7aadd1322424a84661cfdac83146eb Mon Sep 17 00:00:00 2001 -From: John Garry -Date: Tue, 8 Oct 2019 21:12:21 +0800 -Subject: [PATCH] lscpu: Add HiSilicon aarch64 tsv110 cpupart - -Add an entry for the HiSilicon aarch64 part tsv110. - -Another known alias for this part is TaishanV110, and it can be -found in the Kunpeng920/Hi1620 SoC. - -Signed-off-by: John Garry ---- - sys-utils/lscpu-arm.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c -index fd9ab3f..b45cbe3 100644 ---- a/sys-utils/lscpu-arm.c -+++ b/sys-utils/lscpu-arm.c -@@ -170,6 +170,11 @@ static const struct id_part intel_part[] = { - { -1, "unknown" }, - }; - -+static const struct id_part hisi_part[] = { -+ { 0xd01, "tsv110" }, -+ { -1, "unknown" }, -+}; -+ - static const struct id_part unknown_part[] = { - { -1, "unknown" }, - }; -@@ -185,6 +190,7 @@ static const struct hw_impl hw_implementer[] = { - { 0x42, brcm_part, "Broadcom" }, - { 0x43, cavium_part, "Cavium" }, - { 0x44, dec_part, "DEC" }, -+ { 0x48, hisi_part, "HiSilicon" }, - { 0x4e, nvidia_part, "Nvidia" }, - { 0x50, apm_part, "APM" }, - { 0x51, qcom_part, "Qualcomm" }, --- -1.8.3.1 - diff --git a/lscpu-use-official-name-for-HiSilicon-tsv110.patch b/lscpu-use-official-name-for-HiSilicon-tsv110.patch deleted file mode 100644 index e32253a..0000000 --- a/lscpu-use-official-name-for-HiSilicon-tsv110.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8243036cae35c1be6992b0ef722d68585589d7d7 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Wed, 4 Mar 2020 12:54:24 +0100 -Subject: [PATCH] lscpu: use official name for HiSilicon tsv110 - -Addresses: https://github.com/karelzak/util-linux/issues/969 -Signed-off-by: Karel Zak ---- - sys-utils/lscpu-arm.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c -index b45cbe3..ef9d1ff 100644 ---- a/sys-utils/lscpu-arm.c -+++ b/sys-utils/lscpu-arm.c -@@ -171,7 +171,7 @@ static const struct id_part intel_part[] = { - }; - - static const struct id_part hisi_part[] = { -- { 0xd01, "tsv110" }, -+ { 0xd01, "Kunpeng-920" }, /* aka tsv110 */ - { -1, "unknown" }, - }; - -@@ -190,7 +190,7 @@ static const struct hw_impl hw_implementer[] = { - { 0x42, brcm_part, "Broadcom" }, - { 0x43, cavium_part, "Cavium" }, - { 0x44, dec_part, "DEC" }, -- { 0x48, hisi_part, "HiSilicon" }, -+ { 0x48, hisi_part, "HiSilicon" }, - { 0x4e, nvidia_part, "Nvidia" }, - { 0x50, apm_part, "APM" }, - { 0x51, qcom_part, "Qualcomm" }, --- -1.8.3.1 - diff --git a/tests-Fix-mountpoint-test-failure-in-build-chroots.patch b/tests-Fix-mountpoint-test-failure-in-build-chroots.patch new file mode 100644 index 0000000..774eef9 --- /dev/null +++ b/tests-Fix-mountpoint-test-failure-in-build-chroots.patch @@ -0,0 +1,74 @@ +From 3e9395811708b5ebcf2c5079ff0cb6d18694a3cc Mon Sep 17 00:00:00 2001 +From: Mark Hindley +Date: Mon, 22 Jun 2020 23:52:09 +0000 +Subject: [PATCH 819/863] tests: Fix mountpoint test failure in build chroots. + +The test assumed that / was a mountpoint. This is not always the case, for +example in pbuilder/cowbuilder chroots. So use / if findmnt verifies it is a +mountpoint, otherwise use the first mountpoint found. Skip the test if no +mountpoints are found. + +Signed-off-by: Mark Hindley +--- + tests/expected/misc/mountpoint-default | 2 +- + tests/expected/misc/mountpoint-nofollow | 2 +- + tests/ts/misc/mountpoint | 15 +++++++++++---- + 3 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/tests/expected/misc/mountpoint-default b/tests/expected/misc/mountpoint-default +index 9a7ac6a..ca75055 100644 +--- a/tests/expected/misc/mountpoint-default ++++ b/tests/expected/misc/mountpoint-default +@@ -1,2 +1,2 @@ +-./symlink-to-root is a mountpoint ++./symlink-to-mountpoint is a mountpoint + 0 +diff --git a/tests/expected/misc/mountpoint-nofollow b/tests/expected/misc/mountpoint-nofollow +index 1ba1749..03d2b5d 100644 +--- a/tests/expected/misc/mountpoint-nofollow ++++ b/tests/expected/misc/mountpoint-nofollow +@@ -1,2 +1,2 @@ +-./symlink-to-root is not a mountpoint ++./symlink-to-mountpoint is not a mountpoint + 1 +diff --git a/tests/ts/misc/mountpoint b/tests/ts/misc/mountpoint +index 1b391c3..e52ccb2 100755 +--- a/tests/ts/misc/mountpoint ++++ b/tests/ts/misc/mountpoint +@@ -7,16 +7,23 @@ TS_DESC="mountpoint" + ts_init "$*" + + ts_check_test_command "$TS_CMD_MOUNTPOINT" ++ts_check_test_command "$TS_CMD_FINDMNT" + +-ln -s / ./symlink-to-root ++# / is not always a mountpoint (chroots etc.), so check if it is and otherwise ++# fallback to the first available mountpoint. ++FIRST_MOUNTPOINT=$($TS_CMD_FINDMNT -no TARGET / || $TS_CMD_FINDMNT -fno TARGET) ++ ++[ -z "$FIRST_MOUNTPOINT" ] && ts_skip "no mountpoint found for symlink tests" ++ ++ln -s $FIRST_MOUNTPOINT ./symlink-to-mountpoint + + ts_init_subtest "default" +-$TS_CMD_MOUNTPOINT ./symlink-to-root >> $TS_OUTPUT 2>> $TS_ERRLOG ++$TS_CMD_MOUNTPOINT ./symlink-to-mountpoint >> $TS_OUTPUT 2>> $TS_ERRLOG + echo $? >> $TS_OUTPUT 2>> $TS_ERRLOG + ts_finalize_subtest + + ts_init_subtest "nofollow" +-$TS_CMD_MOUNTPOINT --nofollow ./symlink-to-root >> $TS_OUTPUT 2>> $TS_ERRLOG ++$TS_CMD_MOUNTPOINT --nofollow ./symlink-to-mountpoint >> $TS_OUTPUT 2>> $TS_ERRLOG + echo $? >> $TS_OUTPUT 2>> $TS_ERRLOG + ts_finalize_subtest + +@@ -25,5 +32,5 @@ $TS_CMD_MOUNTPOINT --devno --nofollow / >> $TS_OUTPUT 2>> $TS_ERRLOG + echo $? >> $TS_OUTPUT 2>> $TS_ERRLOG + ts_finalize_subtest + +-rm -f ./symlink-to-root ++rm -f ./symlink-to-mountpoint + ts_finalize +-- +1.8.3.1 + diff --git a/util-linux-2.34.tar.xz b/util-linux-2.34.tar.xz deleted file mode 100644 index 539be36..0000000 Binary files a/util-linux-2.34.tar.xz and /dev/null differ diff --git a/util-linux-2.35.2.tar.xz b/util-linux-2.35.2.tar.xz new file mode 100644 index 0000000..30eb8f3 Binary files /dev/null and b/util-linux-2.35.2.tar.xz differ diff --git a/util-linux.spec b/util-linux.spec index 0ef0477..51bd864 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,8 +1,8 @@ %define compldir %{_datadir}/bash-completion/completions/ Name: util-linux -Version: 2.34 -Release: 9 +Version: 2.35.2 +Release: 1 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -29,17 +29,16 @@ Conflicts: initscripts < 9.79-4 bash-completion < 1:2.1-1 coreutils < 8.20 Conflicts: e2fsprogs < 1.41.8-5 filesystem < 3 Provides: eject = 2.1.6 rfkill = 0.5 -Provides: util-linux-ng = %{version}-%{release} +Provides: util-linux-ng = %{version}-%{release} hardlink = 1:1.3-9 Provides: /bin/dmesg /bin/kill /bin/more /bin/mount /bin/umount /sbin/blkid Provides: /sbin/blockdev /sbin/findfs /sbin/fsck /sbin/nologin -Obsoletes: eject <= 2.1.5 rfkill <= 0.5 util-linux-ng < 2.19 +Obsoletes: eject <= 2.1.5 rfkill <= 0.5 util-linux-ng < 2.19 hardlink <= 1:1.3-9 -Patch0000: 2.28-login-lastlog-create.patch -Patch0001: fdisk-fix-quit-dialog-for-non-libreadline-version.patch -Patch0002: libmount-move-already-mounted-code-to-separate-funct.patch -Patch0003: libmount-try-read-only-mount-on-write-protected-supe.patch -Patch0004: lscpu-Add-HiSilicon-aarch64-tsv110-cpupart.patch -Patch0005: lscpu-use-official-name-for-HiSilicon-tsv110.patch +Patch0: 2.28-login-lastlog-create.patch +Patch1: libmount-move-already-mounted-code-to-separate-funct.patch +Patch2: libmount-try-read-only-mount-on-write-protected-supe.patch +Patch3: libmount-parser-fix-memory-leak-on-error-before-end-.patch +Patch4: tests-Fix-mountpoint-test-failure-in-build-chroots.patch %description The util-linux package contains a random collection of files that @@ -134,6 +133,8 @@ development of %{name}. Summary: Help package for ${name} BuildArch: noarch Requires: %{name} = %{version}-%{release} +Obsoletes: hardlink-help <= 1:1.3-9 +Provides: hardlink-help = 1:1.3-9 %description help This package contains some doc and man help files for %{name}. @@ -155,6 +156,7 @@ unset LINGUAS || : --enable-usrdir-path \ --enable-write \ --enable-raw \ + --enable-hardlink \ --with-python=2 \ --with-systemd \ --with-udev \ @@ -297,7 +299,7 @@ fi %{_bindir}/{flock,getopt,hexdump,ionice,ipcmk,ipcrm,ipcs,isosize,kill,last,lastb,logger,hardlink} %{_bindir}/{look,lsblk,lscpu,lsipc,lslocks,lslogins,lsmem,lsns,mcookie,mesg,more,mountpoint} %{_bindir}/{namei,nsenter,prlimit,raw,rename,renice,rev,script,scriptreplay,setarch,setpriv} -%{_bindir}/{setsid,setterm,taskset,ul,unshare,utmpdump,uuidgen,uuidparse,wall,wdctl,whereis} +%{_bindir}/{setsid,setterm,taskset,ul,unshare,utmpdump,uuidgen,uuidparse,wall,wdctl,whereis,scriptlive,hardlink} %{_sbindir}/{addpart,agetty,blkdiscard,blkid,blkzone,blockdev,chcpu,ctrlaltdel,delpart,fdisk} %{_sbindir}/{findfs,fsck,fsck.cramfs,fsck.minix,fsfreeze,fstrim,ldattach,losetup,mkfs,mkfs.cramfs} %{_sbindir}/{mkfs.minix,mkswap,nologin,partx,pivot_root,readprofile,resizepart,rfkill,rtcwake} @@ -313,7 +315,7 @@ fi %{compldir}/{resizepart,rev,rfkill,rtcwake,runuser,script,scriptreplay,setarch} %{compldir}/{setpriv,setsid,setterm,su,swaplabel,swapoff,swapon,taskset,ul,unshare} %{compldir}/{utmpdump,uuidgen,uuidparse,wall,wdctl,whereis,wipefs,write,zramctl} -%{compldir}/{fdformat,hwclock,cfdisk,sfdisk} +%{compldir}/{fdformat,hwclock,cfdisk,sfdisk,scriptlive} %files -n libfdisk %license Documentation/licenses/COPYING.LGPL-2.1* libfdisk/COPYING @@ -365,13 +367,12 @@ fi %exclude %{_datadir}/doc/util-linux/getopt/* %doc README NEWS Documentation/deprecated.txt %doc %attr(0644,-,-) misc-utils/getopt-*.{bash,tcsh} -%exclude %{_mandir}/man1/hardlink.1* %{_mandir}/man1/{chfn.1*,chsh.1*,cal.1*,chrt.1*,col.1*,colcrt.1*,colrm.1*,column.1*,dmesg.1*,eject.1*} %{_mandir}/man1/{fallocate.1*,fincore.1*,flock.1*,getopt.1*,hexdump.1*,ionice.1*,ipcmk.1*,ipcrm.1*,ipcs.1*} %{_mandir}/man1/{kill.1*,last.1*,lastb.1*,logger.1*,login.1*,look.1*,lscpu.1*,lsipc.1*,lslogins.1*,lsmem.1*} %{_mandir}/man1/{mcookie.1*,mesg.1*,more.1*,mountpoint.1*,namei.1*,nsenter.1*,prlimit.1*,rename.1*,renice.1*} %{_mandir}/man1/{rev.1*,runuser.1*,script.1*,scriptreplay.1*,setpriv.1*,setsid.1*,setterm.1*,su.1*,taskset.1*} -%{_mandir}/man1/{ul.1*,unshare.1*,utmpdump.1.gz,uuidgen.1*,uuidparse.1*,wall.1*,whereis.1*,write.1*,choom.1*} +%{_mandir}/man1/{ul.1*,unshare.1*,utmpdump.1.gz,uuidgen.1*,uuidparse.1*,wall.1*,whereis.1*,write.1*,choom.1*,scriptlive*,hardlink.1*} %{_mandir}/man3/{libblkid.3*,uuid.3*,uuid_clear.3*,uuid_compare.3*,uuid_copy.3*,uuid_generate.3*,uuid_generate_random.3*} %{_mandir}/man3/{uuid_generate_time_safe.3*,uuid_is_null.3*,uuid_parse.3*,uuid_time.3*,uuid_unparse.3*,uuid_generate_time.3*} %{_mandir}/man5/{fstab.5*,terminal-colors.d.5*,adjtime_config.5.*} @@ -384,6 +385,12 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Thu Jul 23 2020 yang_zhuang_zhuang - 2.35.2-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:update version to 2.35.2 + * Mon Jun 29 2020 Liquor - 2.34-9 - Type:bugfix - ID:NA