summaryrefslogtreecommitdiffstats
path: root/main/dansguardian
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-08-31 12:32:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-08-31 12:32:58 +0000
commit91ff21db0a1a924cf94b56c79eb49c9f5b068af2 (patch)
tree4b47e401c509e6fe4d37d67a6408422a06255c88 /main/dansguardian
parentf156d54f7f58c5e04795446c544406bc27939a3d (diff)
downloadaports-91ff21db0a1a924cf94b56c79eb49c9f5b068af2.tar.bz2
aports-91ff21db0a1a924cf94b56c79eb49c9f5b068af2.tar.xz
main/dansguardian: fix for ftp credentials
Patch from http://tech.groups.yahoo.com/group/dansguardian/message/23013 fixes #146
Diffstat (limited to 'main/dansguardian')
-rw-r--r--main/dansguardian/APKBUILD7
-rw-r--r--main/dansguardian/ftp-credential.patch41
2 files changed, 46 insertions, 2 deletions
diff --git a/main/dansguardian/APKBUILD b/main/dansguardian/APKBUILD
index 8e15b043c..dc6dee7cd 100644
--- a/main/dansguardian/APKBUILD
+++ b/main/dansguardian/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dansguardian
pkgver=2.10.1.1
-pkgrel=1
+pkgrel=2
pkgdesc="Web content filter"
url="http://dansguardian.org"
license="GPL"
@@ -13,10 +13,12 @@ subpackages="$pkgname-doc"
source="http://dansguardian.org/downloads/2/Stable/$pkgname-$pkgver.tar.gz
dansguardian.initd
dansguardian.logrotate
+ ftp-credential.patch
"
build() {
cd "$srcdir/$pkgname-$pkgver"
+ patch -p1 -i ../ftp-credential.patch || return 1
export CXX=${CXX_UC:-g++-uc}
./configure --prefix=/usr \
@@ -37,4 +39,5 @@ build() {
md5sums="0987a1c9bfbdf398118386f10279611a dansguardian-2.10.1.1.tar.gz
0c04f74cd5db9fc7a8e80b407ec34214 dansguardian.initd
-85b6de01c9508e8ceff5ebb55752f8d3 dansguardian.logrotate"
+85b6de01c9508e8ceff5ebb55752f8d3 dansguardian.logrotate
+475c46026e8553181d293d5a4feaf6d9 ftp-credential.patch"
diff --git a/main/dansguardian/ftp-credential.patch b/main/dansguardian/ftp-credential.patch
new file mode 100644
index 000000000..cfe472909
--- /dev/null
+++ b/main/dansguardian/ftp-credential.patch
@@ -0,0 +1,41 @@
+If anyone is interested I updated the workaround ftp credential patch
+for 2.10.1.1. The previous one bombed on urls with email addresses in them.
+
+This one will probably bomb someplace else :)
+
+7/9/2009 ftp patch:
+
+--- a/src/HTTPHeader.cpp 2009-06-13 14:10:15.000000000 -0500
++++ b/src/HTTPHeader.cpp 2009-07-09 17:29:16.000000000 -0500
+@@ -402,7 +402,7 @@
+ // modifies the URL in all relevant header lines after a regexp search and replace
+ // setURL Code originally from from Ton Gorter 2004
+ void HTTPHeader::setURL(String &url) {
+- String hostname;
++ String hostname,credentials;
+ bool https = (url.before("://") == "https");
+ int port = (https ? 443 : 80);
+
+@@ -420,12 +420,18 @@
+ }
+ hostname = hostname.before(":"); // chop off the port bit
+ }
++ //Restore stripped credentials
++ credentials="";
++ if (header.front().after("://").before(hostname.toCharArray()).contains("@")) { // Contains a username:password combo
++ credentials = header.front().after("://").before(hostname.toCharArray());
++ }
++
+
+ #ifdef DGDEBUG
+ std::cout << "setURL: header.front() changed from: " << header.front() << std::endl;
+ #endif
+ if (!https)
+- header.front() = header.front().before(" ") + " " + url + " " + header.front().after(" ").after(" ");
++ header.front() = header.front().before(" ") + " " + url.before("://") + "://" + credentials + url.after("://") + " " + header.front().after(" ").after(" ");
+ else
+ // Should take form of "CONNECT example.com:443 HTTP/1.0" for SSL
+ header.front() = header.front().before(" ") + " " + hostname + ":" + String(port) + " " + header.front().after(" ").after(" ");
+
+
+