projects/aports·commit 1db6e899

core/apk-tools: fix another fd leak. patch from upstream

1db6e899 · Natanael Copa <[email protected]> · 2009-06-15 08:32:32 +00:00

Commit
1db6e899072d31a2704533903cfe8f6fab1c98ec
Parents
eb7bedd3

Changes

2 files changed · +37 −3

FileStatusAddDelContent
core/apk-tools/APKBUILDmodified+7−3View file
core/apk-tools/fd-leak2.patchadded+30−0View file

core/apk-tools/APKBUILD

View file
diff --git a/core/apk-tools/APKBUILD b/core/apk-tools/APKBUILD
index f4ece5d..8f4b171 100644
--- a/core/apk-tools/APKBUILD
+++ b/core/apk-tools/APKBUILD
@@ -1,18 +1,21 @@
# Maintainer: Natanael Copa <[email protected]>
pkgname=apk-tools
pkgver=2.0_pre12
-pkgrel=1
+pkgrel=2
pkgdesc="Alpine Package Keeper - package manager for alpine"
depends=
makedepends="zlib-dev"
source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
- fd-leak.patch"
+ fd-leak.patch
+ fd-leak2.patch"
+
url="http://git.alpinelinux.org/cgit/apk-tools/"
license=GPL-2
build() {
cd "$srcdir/$pkgname-$pkgver"
patch -p1 < ../fd-leak.patch || return 1
+ patch -p1 < ../fd-leak2.patch || return 1
sed -i -e 's:-Werror::' Make.rules
make || return 1
make DESTDIR="$pkgdir" install
@@ -26,4 +29,5 @@ build() {
}
md5sums="042d28b5cb8ddafe6add63766bc6c17a apk-tools-2.0_pre12.tar.bz2
-66e915fb667e5ac382ecb801decf2c1c fd-leak.patch"
+66e915fb667e5ac382ecb801decf2c1c fd-leak.patch
+aafaa226c07f97f46cefe42a9335ea35 fd-leak2.patch"

core/apk-tools/fd-leak2.patch

View file
diff --git a/core/apk-tools/fd-leak2.patch b/core/apk-tools/fd-leak2.patch
new file mode 100644
index 0000000..033bc0d
--- /dev/null
+++ b/core/apk-tools/fd-leak2.patch
@@ -0,0 +1,30 @@
+commit 49c904c993d39cfac7d3373c66f5b910e755f203
+Author: Timo Teras <[email protected]>
+Date: Thu Jun 11 13:03:10 2009 +0300
+
+ io: fix mmap bstream fd leak
+
+ We need to close the fd on destruction. This is what the corresponding
+ istream variant does too.
+
+diff --git a/src/io.c b/src/io.c
+index e0a9c9b..defbe46 100644
+--- a/src/io.c
++++ b/src/io.c
+@@ -4,7 +4,7 @@
+ * Copyright (C) 2008 Timo Teräs <[email protected]>
+ * All rights reserved.
+ *
+- * This program is free software; you can redistribute it and/or modify it
++ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation. See http://www.gnu.org/ for details.
+ */
+@@ -257,6 +257,7 @@ static void mmap_close(void *stream, csum_t csum, size_t *size)
+ *size = mbs->size;
+
+ munmap(mbs->ptr, mbs->size);
++ close(mbs->fd);
+ free(mbs);
+ }
+