summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/thttpd')
-rw-r--r--www-servers/thttpd/ChangeLog12
-rw-r--r--www-servers/thttpd/files/digest-thttpd-2.25b-r73
-rw-r--r--www-servers/thttpd/files/thttpd-2.25/additional-input-validation-httpd.c.diff62
-rw-r--r--www-servers/thttpd/files/thttpd.logrotate12
-rw-r--r--www-servers/thttpd/thttpd-2.25b-r7.ebuild67
5 files changed, 155 insertions, 1 deletions
diff --git a/www-servers/thttpd/ChangeLog b/www-servers/thttpd/ChangeLog
index ba6bb23e67a0..c9858da37806 100644
--- a/www-servers/thttpd/ChangeLog
+++ b/www-servers/thttpd/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for www-servers/thttpd
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/ChangeLog,v 1.21 2007/02/02 13:36:58 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/ChangeLog,v 1.22 2007/02/28 22:48:06 bangert Exp $
+
+*thttpd-2.25b-r7 (28 Feb 2007)
+
+ 28 Feb 2007; Thilo Bangert <bangert@gentoo.org>
+ +files/thttpd-2.25/additional-input-validation-httpd.c.diff,
+ +files/thttpd.logrotate, +thttpd-2.25b-r7.ebuild:
+ add logrotate script (bug #150993)
+ run under thttpd user instead of nobody (bug #151227)
+ extra input sanitation for htpasswd (bug #128165)
+ einfo -> elog
02 Feb 2007; Gustavo Zacarias <gustavoz@gentoo.org>
thttpd-2.25b-r6.ebuild:
diff --git a/www-servers/thttpd/files/digest-thttpd-2.25b-r7 b/www-servers/thttpd/files/digest-thttpd-2.25b-r7
new file mode 100644
index 000000000000..f7daceb58ecf
--- /dev/null
+++ b/www-servers/thttpd/files/digest-thttpd-2.25b-r7
@@ -0,0 +1,3 @@
+MD5 a0e9cd87455d3a0ea11e5ea7e947adf6 thttpd-2.25b.tar.gz 132363
+RMD160 15020e8d04d27b30c4da3104387a281e35d58025 thttpd-2.25b.tar.gz 132363
+SHA256 4ceaa30ef55702d5cfdffdccd3a2dee8d3090e852c18c7ce8d17d692ad0bf024 thttpd-2.25b.tar.gz 132363
diff --git a/www-servers/thttpd/files/thttpd-2.25/additional-input-validation-httpd.c.diff b/www-servers/thttpd/files/thttpd-2.25/additional-input-validation-httpd.c.diff
new file mode 100644
index 000000000000..04f59eac8e39
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-2.25/additional-input-validation-httpd.c.diff
@@ -0,0 +1,62 @@
+--- thttpd-2.25b/extras/htpasswd.c.orig 2006-03-31 04:12:42.281317000 +0000
++++ thttpd-2.25b/extras/htpasswd.c 2006-03-31 05:21:37.741632392 +0000
+@@ -151,6 +151,7 @@ void interrupted(int signo) {
+ int main(int argc, char *argv[]) {
+ FILE *tfp,*f;
+ char user[MAX_STRING_LEN];
++ char pwfilename[MAX_STRING_LEN];
+ char line[MAX_STRING_LEN];
+ char l[MAX_STRING_LEN];
+ char w[MAX_STRING_LEN];
+@@ -168,6 +169,25 @@ int main(int argc, char *argv[]) {
+ perror("fopen");
+ exit(1);
+ }
++ if (strlen(argv[2]) > (sizeof(pwfilename) - 1)) {
++ fprintf(stderr, "%s: filename is too long\n", argv[0]);
++ exit(1);
++ }
++ if (((strchr(argv[2], ';')) != NULL) || ((strchr(argv[2], '>')) != NULL)) {
++ fprintf(stderr, "%s: filename contains an illegal character\n",
++ argv[0]);
++ exit(1);
++ }
++ if (strlen(argv[3]) > (sizeof(user) - 1)) {
++ fprintf(stderr, "%s: username is too long\n", argv[0],
++ sizeof(user) - 1);
++ exit(1);
++ }
++ if ((strchr(argv[3], ':')) != NULL) {
++ fprintf(stderr, "%s: username contains an illegal character\n",
++ argv[0]);
++ exit(1);
++ }
+ printf("Adding password for %s.\n",argv[3]);
+ add_password(argv[3],tfp);
+ fclose(tfp);
+@@ -180,6 +200,25 @@ int main(int argc, char *argv[]) {
+ exit(1);
+ }
+
++ if (strlen(argv[1]) > (sizeof(pwfilename) - 1)) {
++ fprintf(stderr, "%s: filename is too long\n", argv[0]);
++ exit(1);
++ }
++ if (((strchr(argv[1], ';')) != NULL) || ((strchr(argv[1], '>')) != NULL)) {
++ fprintf(stderr, "%s: filename contains an illegal character\n",
++ argv[0]);
++ exit(1);
++ }
++ if (strlen(argv[2]) > (sizeof(user) - 1)) {
++ fprintf(stderr, "%s: username is too long\n", argv[0],
++ sizeof(user) - 1);
++ exit(1);
++ }
++ if ((strchr(argv[2], ':')) != NULL) {
++ fprintf(stderr, "%s: username contains an illegal character\n",
++ argv[0]);
++ exit(1);
++ }
+ if(!(f = fopen(argv[1],"r"))) {
+ fprintf(stderr,
+ "Could not open passwd file %s for reading.\n",argv[1]);
diff --git a/www-servers/thttpd/files/thttpd.logrotate b/www-servers/thttpd/files/thttpd.logrotate
new file mode 100644
index 000000000000..7e75c813524a
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.logrotate
@@ -0,0 +1,12 @@
+/var/log/thttpd.log {
+ daily
+ rotate 5
+ compress
+ delaycompress
+ missingok
+ notifempty
+ sharedscripts
+ postrotate
+ kill -HUP `cat /var/run/thttpd.pid 2>/dev/null` 2>/dev/null || true
+ endscript
+}
diff --git a/www-servers/thttpd/thttpd-2.25b-r7.ebuild b/www-servers/thttpd/thttpd-2.25b-r7.ebuild
new file mode 100644
index 000000000000..3dbe78140de3
--- /dev/null
+++ b/www-servers/thttpd/thttpd-2.25b-r7.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/thttpd-2.25b-r7.ebuild,v 1.1 2007/02/28 22:48:06 bangert Exp $
+
+inherit eutils flag-o-matic
+
+MY_P="${P%[a-z]*}"
+
+DESCRIPTION="Small and fast multiplexing webserver."
+HOMEPAGE="http://www.acme.com/software/thttpd/"
+SRC_URI="http://www.acme.com/software/thttpd/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~mips ~ppc ~sparc ~x86 ~x86-fbsd"
+IUSE="static"
+
+THTTPD_USER=thttpd
+THTTPD_GROUP=thttpd
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${MY_P}/*.diff
+}
+
+pkg_setup() {
+ enewgroup ${THTTPD_GROUP}
+ enewuser ${THTTPD_USER} -1 -1 -1 ${THTTPD_GROUP}
+}
+
+src_compile() {
+ ## TODO: what to do with IPv6?
+
+ append-ldflags $(bindnow-flags)
+ use static && append-ldflags -static
+
+ econf || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install () {
+ dodir /usr/share/man/man1
+ make prefix=${D}/usr \
+ MANDIR=${D}/usr/share/man \
+ WEBGROUP=${THTTPD_GROUP} \
+ WEBDIR=${D}/var/www/localhost \
+ "$@" install || die "make install failed"
+
+ mv ${D}/usr/sbin/{,th_}htpasswd
+ mv ${D}/usr/share/man/man1/{,th_}htpasswd.1
+
+ newinitd ${FILESDIR}/${MY_P}/thttpd.init thttpd
+ newconfd ${FILESDIR}/${MY_P}/thttpd.confd thttpd
+
+ dodoc README INSTALL TODO
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/thttpd.logrotate" thttpd
+
+ insinto /etc/thttpd
+ doins ${FILESDIR}/${MY_P}/thttpd.conf.sample
+}
+
+pkg_postinst() {
+ elog "Adjust THTTPD_DOCROOT in /etc/conf.d/thttpd !"
+}