Prevent a file descriptor leak

Resolves: RHEL-44911
This commit is contained in:
Pavel Cahyna 2024-08-21 14:02:54 +02:00
parent 94f8f529d5
commit bb4602a1cb
2 changed files with 13 additions and 0 deletions

11
mtools-4.0.43-close.patch Normal file
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

@ -8,6 +8,7 @@ Url: https://www.gnu.org/software/mtools/
Patch0: mtools-3.9.6-config.patch Patch0: mtools-3.9.6-config.patch
Patch1: mtools-4.0.43-errmsgsize.patch Patch1: mtools-4.0.43-errmsgsize.patch
Patch2: mtools-4.0.43-iconv_close.patch Patch2: mtools-4.0.43-iconv_close.patch
Patch3: mtools-4.0.43-close.patch
BuildRequires: make BuildRequires: make
BuildRequires: gcc BuildRequires: gcc
@ -35,6 +36,7 @@ Mtools should be installed if you need to use MS-DOS disks
%patch 0 -p1 -b .conf %patch 0 -p1 -b .conf
%patch 1 -p1 %patch 1 -p1
%patch 2 -p1 %patch 2 -p1
%patch 3 -p1
%build %build
autoreconf -fiv autoreconf -fiv