diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-06-15 08:32:32 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-06-15 08:32:32 +0000 |
commit | 1db6e899072d31a2704533903cfe8f6fab1c98ec (patch) | |
tree | 5f32bb8db0fa191097a6031dd0a40be147f4ae30 | |
parent | eb7bedd371a0cacabd9f1b2c628fafb1d42bdbfc (diff) | |
download | alpine_aports-1.9.0_alpha14.tar.bz2 alpine_aports-1.9.0_alpha14.tar.xz alpine_aports-1.9.0_alpha14.zip |
core/apk-tools: fix another fd leak. patch from upstreamv1.9.0_alpha14
-rw-r--r-- | core/apk-tools/APKBUILD | 10 | ||||
-rw-r--r-- | core/apk-tools/fd-leak2.patch | 30 |
2 files changed, 37 insertions, 3 deletions
diff --git a/core/apk-tools/APKBUILD b/core/apk-tools/APKBUILD index f4ece5d32c..8f4b1718f0 100644 --- a/core/apk-tools/APKBUILD +++ b/core/apk-tools/APKBUILD | |||
@@ -1,18 +1,21 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=apk-tools | 2 | pkgname=apk-tools |
3 | pkgver=2.0_pre12 | 3 | pkgver=2.0_pre12 |
4 | pkgrel=1 | 4 | pkgrel=2 |
5 | pkgdesc="Alpine Package Keeper - package manager for alpine" | 5 | pkgdesc="Alpine Package Keeper - package manager for alpine" |
6 | depends= | 6 | depends= |
7 | makedepends="zlib-dev" | 7 | makedepends="zlib-dev" |
8 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 | 8 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 |
9 | fd-leak.patch" | 9 | fd-leak.patch |
10 | fd-leak2.patch" | ||
11 | |||
10 | url="http://git.alpinelinux.org/cgit/apk-tools/" | 12 | url="http://git.alpinelinux.org/cgit/apk-tools/" |
11 | license=GPL-2 | 13 | license=GPL-2 |
12 | 14 | ||
13 | build() { | 15 | build() { |
14 | cd "$srcdir/$pkgname-$pkgver" | 16 | cd "$srcdir/$pkgname-$pkgver" |
15 | patch -p1 < ../fd-leak.patch || return 1 | 17 | patch -p1 < ../fd-leak.patch || return 1 |
18 | patch -p1 < ../fd-leak2.patch || return 1 | ||
16 | sed -i -e 's:-Werror::' Make.rules | 19 | sed -i -e 's:-Werror::' Make.rules |
17 | make || return 1 | 20 | make || return 1 |
18 | make DESTDIR="$pkgdir" install | 21 | make DESTDIR="$pkgdir" install |
@@ -26,4 +29,5 @@ build() { | |||
26 | } | 29 | } |
27 | 30 | ||
28 | md5sums="042d28b5cb8ddafe6add63766bc6c17a apk-tools-2.0_pre12.tar.bz2 | 31 | md5sums="042d28b5cb8ddafe6add63766bc6c17a apk-tools-2.0_pre12.tar.bz2 |
29 | 66e915fb667e5ac382ecb801decf2c1c fd-leak.patch" | 32 | 66e915fb667e5ac382ecb801decf2c1c fd-leak.patch |
33 | aafaa226c07f97f46cefe42a9335ea35 fd-leak2.patch" | ||
diff --git a/core/apk-tools/fd-leak2.patch b/core/apk-tools/fd-leak2.patch new file mode 100644 index 0000000000..033bc0dc19 --- /dev/null +++ b/core/apk-tools/fd-leak2.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | commit 49c904c993d39cfac7d3373c66f5b910e755f203 | ||
2 | Author: Timo Teras <timo.teras@iki.fi> | ||
3 | Date: Thu Jun 11 13:03:10 2009 +0300 | ||
4 | |||
5 | io: fix mmap bstream fd leak | ||
6 | |||
7 | We need to close the fd on destruction. This is what the corresponding | ||
8 | istream variant does too. | ||
9 | |||
10 | diff --git a/src/io.c b/src/io.c | ||
11 | index e0a9c9b..defbe46 100644 | ||
12 | --- a/src/io.c | ||
13 | +++ b/src/io.c | ||
14 | @@ -4,7 +4,7 @@ | ||
15 | * Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi> | ||
16 | * All rights reserved. | ||
17 | * | ||
18 | - * This program is free software; you can redistribute it and/or modify it | ||
19 | + * This program is free software; you can redistribute it and/or modify it | ||
20 | * under the terms of the GNU General Public License version 2 as published | ||
21 | * by the Free Software Foundation. See http://www.gnu.org/ for details. | ||
22 | */ | ||
23 | @@ -257,6 +257,7 @@ static void mmap_close(void *stream, csum_t csum, size_t *size) | ||
24 | *size = mbs->size; | ||
25 | |||
26 | munmap(mbs->ptr, mbs->size); | ||
27 | + close(mbs->fd); | ||
28 | free(mbs); | ||
29 | } | ||
30 | |||