diff --git a/0001-remove-sample-in-mtools-conf-file.patch b/1001-remove-sample-in-mtools-conf-file.patch similarity index 100% rename from 0001-remove-sample-in-mtools-conf-file.patch rename to 1001-remove-sample-in-mtools-conf-file.patch diff --git a/mtools-4.0.42.tar.bz2 b/mtools-4.0.42.tar.bz2 deleted file mode 100644 index 0d67a1b716b6922d7055c7740d7c1a091afaf7c6..0000000000000000000000000000000000000000 Binary files a/mtools-4.0.42.tar.bz2 and /dev/null differ diff --git a/mtools-4.0.43-close.patch b/mtools-4.0.43-close.patch new file mode 100644 index 0000000000000000000000000000000000000000..df379829de1daf79ff40341542502d3512ae1e52 --- /dev/null +++ b/mtools-4.0.43-close.patch @@ -0,0 +1,11 @@ +diff -ur mtools-4.0.44/mpartition.c mtools-4.0.44-memleaks/mpartition.c +--- mtools-4.0.44/mpartition.c 2022-10-29 11:48:23.000000000 +0200 ++++ mtools-4.0.44-memleaks/mpartition.c 2024-08-21 13:53:03.699524744 +0200 +@@ -483,6 +483,7 @@ + perror("read MBR"); + exit(1); + } ++ close(fd); + } + memset((char *)(partTable+1), 0, 4*sizeof(*partTable)); + set_word(((unsigned char*)buf)+510, 0xaa55); diff --git a/mtools-4.0.43-errmsgsize.patch b/mtools-4.0.43-errmsgsize.patch new file mode 100644 index 0000000000000000000000000000000000000000..ab3a724bc872a59f938012420c888dc068872e1c --- /dev/null +++ b/mtools-4.0.43-errmsgsize.patch @@ -0,0 +1,13 @@ +diff -up mtools-4.0.43/mcopy.c.orig mtools-4.0.43/mcopy.c +--- mtools-4.0.43/mcopy.c.orig 2024-08-20 18:41:43.957181199 +0200 ++++ mtools-4.0.43/mcopy.c 2024-08-20 18:40:51.921966014 +0200 +@@ -196,7 +196,8 @@ static int _unix_write(MainParam_t *mp, + Stream_t *File=mp->File; + Stream_t *Target, *Source; + struct MT_STAT stbuf; +- char errmsg[80]; ++ /* matches buffer size in SimpleFileOpenWithLm() */ ++ char errmsg[200]; + + File->Class->get_data(File, &mtime, 0, 0, 0); + diff --git a/mtools-4.0.43-iconv_close.patch b/mtools-4.0.43-iconv_close.patch new file mode 100644 index 0000000000000000000000000000000000000000..5a98229ea85f5ed1579bbe1f8f75e8e0993a92f8 --- /dev/null +++ b/mtools-4.0.43-iconv_close.patch @@ -0,0 +1,19 @@ +diff -ur mtools-4.0.44/charsetConv.c mtools-4.0.44-memleaks/charsetConv.c +--- mtools-4.0.44/charsetConv.c 2022-09-24 10:43:03.000000000 +0200 ++++ mtools-4.0.44-memleaks/charsetConv.c 2024-08-20 18:05:05.252088712 +0200 +@@ -70,6 +70,7 @@ + res = iconv(test, + &inbuf, &inbufLen, + &outbufP, &outbufLen); ++ iconv_close(test); + if(res != 0 || outbufLen != 0 || inbufLen != 0) + goto fail; + if(memcmp(outbuf, "ab", 2)) +@@ -77,7 +78,6 @@ + /* fprintf(stderr, "%s ok\n", testCp); */ + return 1; + fail: +- iconv_close(test); + fail0: + /*fprintf(stderr, "%s fail\n", testCp);*/ + return 0; diff --git a/mtools-4.0.43.tar.gz b/mtools-4.0.43.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..64a0255999ca6e8fad2dbbcaee85174f840c566e Binary files /dev/null and b/mtools-4.0.43.tar.gz differ diff --git a/mtools.spec b/mtools.spec index 08aefe8740cd23e17cf943bf18d5324ee1b4c670..d3a3b2314d5e593139c5ce9489bcbe645be591bf 100644 --- a/mtools.spec +++ b/mtools.spec @@ -1,13 +1,16 @@ %define anolis_release 1 Summary: Programs for accessing MS-DOS disks without mounting the disks Name: mtools -Version: 4.0.42 +Version: 4.0.43 Release: %{anolis_release}%{?dist} License: GPLv3+ -Source0: ftp://ftp.gnu.org/gnu/mtools/mtools-%{version}.tar.bz2 +Source0: ftp://ftp.gnu.org/gnu/mtools/mtools-%{version}.tar.gz Url: https://www.gnu.org/software/mtools/ -Patch0: 0001-remove-sample-in-mtools-conf-file.patch +Patch0: mtools-4.0.43-errmsgsize.patch +Patch1: mtools-4.0.43-iconv_close.patch +Patch2: mtools-4.0.43-close.patch +Patch1001: 1001-remove-sample-in-mtools-conf-file.patch BuildRequires: make BuildRequires: gcc @@ -60,6 +63,14 @@ ln -s mtools.5 %{buildroot}%{_mandir}/man5/mtools.conf.5 %doc README Release.notes %changelog +* Thu Mar 20 2025 Xiaoping Liu - 4.0.43-1 +- update to 4.0.43 from 4.0.42 +- Increase error message buffer size +- Prevent a leak of iconv_t +- Prevent a file descriptor leak + [Patches cherry-pick from c10s. Original changelog: + - Prevent a file descriptor leak. ( 4.0.43-6 )] + * Tue Dec 20 2022 Funda Wang - 4.0.42-1 - New version 4.0.42