summaryrefslogtreecommitdiffstats
path: root/main/squid
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-08-02 07:32:34 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-08-02 07:33:21 +0000
commit4ecda1eeb24bee90b13fb2c4a3ddac458c22ffd1 (patch)
tree6ed53162347c7f3d55c6ddf1caf8f36b9c7a3ced /main/squid
parentc0e41e982cb5e05760c89c20d51454b53086c74a (diff)
downloadaports-4ecda1eeb24bee90b13fb2c4a3ddac458c22ffd1.tar.bz2
aports-4ecda1eeb24bee90b13fb2c4a3ddac458c22ffd1.tar.xz
main/squid: fix file descriptor leak
ref #1297
Diffstat (limited to 'main/squid')
-rw-r--r--main/squid/APKBUILD4
-rw-r--r--main/squid/bug3577.patch59
2 files changed, 62 insertions, 1 deletions
diff --git a/main/squid/APKBUILD b/main/squid/APKBUILD
index eca7b01fc..351900ca1 100644
--- a/main/squid/APKBUILD
+++ b/main/squid/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=squid
pkgver=3.2.0.18
-pkgrel=0
+pkgrel=1
pkgdesc="A full-featured Web proxy cache server."
url="http://www.squid-cache.org"
install="squid.pre-install squid.pre-upgrade"
@@ -21,6 +21,7 @@ langdir="/usr/share/squid/errors"
source="http://www.squid-cache.org/Versions/v3/3.2/squid-$pkgver.tar.bz2
squid-3.2.0.16-loggable-urlgroup.patch
cf_gen-pthread.patch
+ bug3577.patch
squid.initd
squid.confd
$pkgname.logrotate
@@ -107,6 +108,7 @@ squid_kerb_auth() {
md5sums="c062829bc5aff6cd76f3a09ca7ec4026 squid-3.2.0.18.tar.bz2
16e3b38996d4c5858e1478f8eb650876 squid-3.2.0.16-loggable-urlgroup.patch
c60237de253c02937f272d3b189d7679 cf_gen-pthread.patch
+609bb6ab7b999d7070caa5141758e325 bug3577.patch
905e57c6d41414f54a75a5c0f9f7fac7 squid.initd
2897c725c201be53d3c9a7db0101bdf0 squid.confd
58823e0b86bc2dc71d270208b7b284b4 squid.logrotate"
diff --git a/main/squid/bug3577.patch b/main/squid/bug3577.patch
new file mode 100644
index 000000000..35c97bd4b
--- /dev/null
+++ b/main/squid/bug3577.patch
@@ -0,0 +1,59 @@
+--- squid-3.2.0.18.orig/src/comm/ConnOpener.cc
++++ squid-3.2.0.18/src/comm/ConnOpener.cc
+@@ -131,6 +131,7 @@
+ }
+
+ if (temporaryFd_ >= 0) {
++ debugs(5, 4, HERE << conn_ << " closing temp FD " << temporaryFd_);
+ // it never reached fully open, so cleanup the FD handlers
+ // Note that comm_close() sequence does not happen for partially open FD
+ Comm::SetSelect(temporaryFd_, COMM_SELECT_WRITE, NULL, NULL, 0);
+@@ -141,6 +142,7 @@
+ }
+ fd_table[temporaryFd_].timeoutHandler = NULL;
+ fd_table[temporaryFd_].timeout = 0;
++ close(temporaryFd_);
+ fd_close(temporaryFd_);
+ temporaryFd_ = -1;
+ }
+--- squid-3.2.0.18.orig/src/forward.cc
++++ squid-3.2.0.18/src/forward.cc
+@@ -84,6 +84,11 @@
+
+ if (Comm::IsConnOpen(fwd->serverConnection())) {
+ comm_remove_close_handler(fwd->serverConnection()->fd, fwdServerClosedWrapper, fwd);
++ debugs(17, 3, HERE << "store entry aborted; closing " <<
++ fwd->serverConnection());
++ fwd->serverConnection()->close();
++ } else {
++ debugs(17, 7, HERE << "store entry aborted; no connection to close");
+ }
+ fwd->serverDestinations.clean();
+ fwd->self = NULL;
+--- squid-3.2.0.18.orig/src/http.cc
++++ squid-3.2.0.18/src/http.cc
+@@ -1067,7 +1067,7 @@
+ }
+
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+- // TODO: should we call abortTransaction() here?
++ abortTransaction("store entry aborted while reading reply");
+ return;
+ }
+
+@@ -1346,12 +1346,9 @@
+ }
+
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+- /*
+- * The above writeReplyBody() call could ABORT this entry,
+- * in that case, the server FD should already be closed.
+- * there's nothing for us to do.
+- */
+- (void) 0;
++ // The above writeReplyBody() call may have aborted the store entry.
++ abortTransaction("store entry aborted while storing reply");
++ return;
+ } else
+ switch (persistentConnStatus()) {
+ case INCOMPLETE_MSG: {