import Oracle_OSS mtools-4.0.26-5.el9_7

This commit is contained in:
AlmaLinux RelEng Bot 2026-03-12 11:29:29 -04:00
parent c8339593b3
commit 7a3bc6865e
4 changed files with 56 additions and 2 deletions

View File

@ -0,0 +1,13 @@
diff -up mtools-4.0.26/mcopy.c.orig mtools-4.0.26/mcopy.c
--- mtools-4.0.26/mcopy.c.orig 2024-08-20 18:41:43.957181199 +0200
+++ mtools-4.0.26/mcopy.c 2024-08-20 18:40:51.921966014 +0200
@@ -108,7 +108,8 @@ static int _unix_write(MainParam_t *mp,
Stream_t *Target, *Source;
struct MT_STAT stbuf;
int ret;
- char errmsg[80];
+ /* matches buffer size in SimpleFileOpenWithLm() */
+ char errmsg[200];
File->Class->get_data(File, &mtime, 0, 0, 0);

View File

@ -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);

View File

@ -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;

View File

@ -1,11 +1,14 @@
Summary: Programs for accessing MS-DOS disks without mounting the disks
Name: mtools
Version: 4.0.26
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv3+
Source0: ftp://ftp.gnu.org/gnu/mtools/mtools-%{version}.tar.gz
Url: https://www.gnu.org/software/mtools/
Patch0: mtools-3.9.6-config.patch
Patch1: mtools-4.0.26-errmsgsize.patch
Patch2: mtools-4.0.43-iconv_close.patch
Patch3: mtools-4.0.43-close.patch
BuildRequires: make
BuildRequires: gcc
@ -23,7 +26,10 @@ Mtools should be installed if you need to use MS-DOS disks
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .conf
%patch 0 -p1 -b .conf
%patch 1 -p1
%patch 2 -p1
%patch 3 -p1
%build
autoreconf -fiv
@ -55,6 +61,11 @@ ln -s mtools.5.gz %{buildroot}%{_mandir}/man5/mtools.conf.5.gz
%{_infodir}/mtools.info*
%changelog
* Mon Feb 16 2026 Pavel Cahyna <pcahyna@redhat.com> - 4.0.26-5
- Increase error message buffer size
- Prevent a leak of iconv_t
- Prevent a file descriptor leak
* Tue Jun 7 2022 Pavel Cahyna <pcahyna@redhat.com> - 4.0.26-4
- Add dependency on glibc-gconv-extra
mtools need codepage 850, which was split from glibc into a subpackage.