summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-03-24 02:59:02 +0000
committerAnthony G. Basile <blueness@gentoo.org>2012-03-24 02:59:02 +0000
commit129b8bbd4b9306f934184bc16a8fd8f8d021c73d (patch)
treef5cc0b37a37023279aa5f69245a682bd388fde6a /www-servers/thttpd
parentlayout.conf: comment on bug #406407 (diff)
downloadhistorical-129b8bbd4b9306f934184bc16a8fd8f8d021c73d.tar.gz
historical-129b8bbd4b9306f934184bc16a8fd8f8d021c73d.tar.bz2
historical-129b8bbd4b9306f934184bc16a8fd8f8d021c73d.zip
Address bugs #370373, #373629, #373631, #406243. Clean up init scripts.
Package-Manager: portage-2.1.10.49/cvs/Linux x86_64
Diffstat (limited to 'www-servers/thttpd')
-rw-r--r--www-servers/thttpd/ChangeLog13
-rw-r--r--www-servers/thttpd/Manifest17
-rw-r--r--www-servers/thttpd/files/thttpd-2.25b-additional-input-validation.patch62
-rw-r--r--www-servers/thttpd/files/thttpd-2.25b-default-to-octet-stream.patch12
-rw-r--r--www-servers/thttpd/files/thttpd-2.25b-fix-buffer-overflow.patch21
-rw-r--r--www-servers/thttpd/files/thttpd-2.25b-fix-insecure-tmp-creation.patch21
-rw-r--r--www-servers/thttpd/files/thttpd-2.25b-ogg-mime-type.patch12
-rw-r--r--www-servers/thttpd/files/thttpd.conf.sample38
-rw-r--r--www-servers/thttpd/files/thttpd.confd27
-rw-r--r--www-servers/thttpd/files/thttpd.init26
-rw-r--r--www-servers/thttpd/thttpd-2.25b-r9.ebuild78
11 files changed, 322 insertions, 5 deletions
diff --git a/www-servers/thttpd/ChangeLog b/www-servers/thttpd/ChangeLog
index eef4db09fac5..6bf4a9ee86cd 100644
--- a/www-servers/thttpd/ChangeLog
+++ b/www-servers/thttpd/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for www-servers/thttpd
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/ChangeLog,v 1.34 2012/03/21 12:21:08 blueness Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/ChangeLog,v 1.35 2012/03/24 02:59:02 blueness Exp $
+
+*thttpd-2.25b-r9 (24 Mar 2012)
+
+ 24 Mar 2012; Anthony G. Basile <blueness@gentoo.org> +thttpd-2.25b-r9.ebuild,
+ +files/thttpd-2.25b-additional-input-validation.patch,
+ +files/thttpd-2.25b-default-to-octet-stream.patch,
+ +files/thttpd-2.25b-fix-buffer-overflow.patch,
+ +files/thttpd-2.25b-fix-insecure-tmp-creation.patch,
+ +files/thttpd-2.25b-ogg-mime-type.patch, +files/thttpd.conf.sample,
+ +files/thttpd.confd, +files/thttpd.init:
+ Address bugs #370373, #373629, #373631, #406243. Clean up init scripts.
21 Mar 2012; Anthony G. Basile <blueness@gentoo.org> metadata.xml:
Will give it love, added myself as maintainer
diff --git a/www-servers/thttpd/Manifest b/www-servers/thttpd/Manifest
index 5a26e2a19ef9..b7f36886c5cb 100644
--- a/www-servers/thttpd/Manifest
+++ b/www-servers/thttpd/Manifest
@@ -7,22 +7,31 @@ AUX thttpd-2.25/fix-insecure-tmp-creation-CVE-2005-3124.diff 724 RMD160 45ebedb4
AUX thttpd-2.25/thttpd.conf.sample 672 RMD160 fd44c3f0c094b06aa6a18ff2b360e4cf9174ffc5 SHA1 2bd69756e0c17fe5e79a4eb76486d300defbd671 SHA256 36c778f749a1277569c72b23f9c4e25b80e10c7c74a43f493c99648ec8e5b787
AUX thttpd-2.25/thttpd.confd 1152 RMD160 78503da6afa0bae20ecace503a3f5f8b7532c4ee SHA1 8599769e121d620eea18b27d51ce3d85414ee75d SHA256 cb723bdc62b339a20c238989d45d26bfcd79fa3a8d31e9bd666fdef979c31c54
AUX thttpd-2.25/thttpd.init 745 RMD160 cb2eda2714728f8cee568b83013f3b5bb70974e7 SHA1 83fdd54a3ac959dc5c6a066a181a41c1d898ed9c SHA256 5e4512079ef620a442833a3ff05c0c4ac2856c6c65cc13da8191bd67d0b1b5da
+AUX thttpd-2.25b-additional-input-validation.patch 2249 RMD160 ad101512e54d1c154dc039d616067456e0130a7e SHA1 88eebce793c19d16a7a394b6142f412d92e511a2 SHA256 28fb9fa693a636df82627701df1e777bc28ffcefe90132391cbed1dc901ce51c
+AUX thttpd-2.25b-default-to-octet-stream.patch 470 RMD160 51123b9375c39f8a077534569385699ef47c8656 SHA1 dc058f10e1c2b46835bfee557de6223cbe50d9d8 SHA256 3700e15c0fdec670f534ae252cb1ed0a93aabca23a3d784f4904812599d2d74b
+AUX thttpd-2.25b-fix-buffer-overflow.patch 947 RMD160 30b80b19e792e0dce3eb238f664501a61bc5a3a7 SHA1 645316b836c731dc0385cfa7851c4dea8edc530c SHA256 3ef0b098398b052eb37711d1a0eb2f0cff556f606c3427d1d0529042368ce1ad
AUX thttpd-2.25b-fix-illegal-path-info.patch 646 RMD160 e83cc6adcd4ac49893922b38157301b5d472b4b3 SHA1 2822d63bb8c9eec63280071d8d52afff2d860c12 SHA256 7dd3de6fea9de73b3f8352ad4b61d0d0d758edf4cf51b32d68e96eddeca3c16a
+AUX thttpd-2.25b-fix-insecure-tmp-creation.patch 749 RMD160 c86a1a2311f90e569c8da5f157402a2ef2382122 SHA1 386f78222136a88812f76961ae10f6c102c9399a SHA256 a2c39287ae89b2cfb92736bd753ce682437176003c0b100eb02a9f3d2348e745
AUX thttpd-2.25b-glibc-2.10.patch 691 RMD160 0fa29c1e864e75fd4a0e0dd097a304435379f63d SHA1 f7a7d121bbfcbfc87d3c500743484db9b415094c SHA256 30ad7d07c03b45497e8067dd9d5ef2abe2a8fc86de7ce40184c178144b3f03b3
AUX thttpd-2.25b-monolithic-timer.patch 3764 RMD160 630a9ecf7f986156cd3e886357427d668e9392c5 SHA1 d8459c47e7596a6a0bf95634ef1575c35e52e0ef SHA256 b37d4a3b32fd30bf21b307a865dc4bb04d97cd846037fdb002847164b6668f56
+AUX thttpd-2.25b-ogg-mime-type.patch 376 RMD160 f3f401f188e04338039920b184f96ff6aa68ed47 SHA1 51fc44340295db3bc3d2755aba59e46165eb1760 SHA256 815bfcf4ecbff603b0eba50eac3e77afaf11a03f0d67f601df910be0e345d039
AUX thttpd-2.25b-respect-CFLAGS--dont-link-static.patch 1722 RMD160 af3b614bc3b9f9f916d2097559766473a29d969c SHA1 53b0ecba535daa8d1825fc5f878a06e66a81ffbb SHA256 5916e36cc5666e8f07d5bfb096fa2a139d637d28d5ed763679f3ff0929dbfa49
AUX thttpd-2.25b-use-Status-header.patch 486 RMD160 51cc1029b88f8527ff8d6c5aececba33a9d4d06a SHA1 9610f7b002d6679b625959edbdea51e1350168bd SHA256 bd7b51245a96f876160d3d97da665d646347f768d9f8b73135efdeb133195bb2
AUX thttpd-2.25b-use-X-Forwarded-For-header.patch 606 RMD160 b3f7c330a8fb9bb2c036a83527f5e536d559bacb SHA1 0495d26c4827151a306329aff5c9c123ac278d1c SHA256 9db45110e0729b0f5ff5ea65ca1ebbf636e3cd41afcc9572cc6b477035798fd9
+AUX thttpd.conf.sample 670 RMD160 4d84d544e4f69ff675ee0cdbe1744bd1231d8d96 SHA1 f7ffe4e0d5a0fcb50ebfffc63956f0b05a75531f SHA256 abdf9f7c6685f846ee2bd482d60b8f8cedc3747cbc3d32c0dd21d6ca8a4dd8de
+AUX thttpd.confd 1140 RMD160 4a29feb4aff4229f2b29bc7cbe5eec3caea879a7 SHA1 6e5ef7e2f1ed8c0f5ae4817a954d97b0aa028073 SHA256 e40877613014041646c5bd3af8aa9a1cdcd37f1bdf8496f014b4a729868be1de
+AUX thttpd.init 689 RMD160 1d794efed66800329d09d28fb532646548b895fc SHA1 4fde72a009c046e4cc0c1cfa6c99d582e6627125 SHA256 1702eae9920794188e3405b629c49ce68bce42e42c439862f90e6900fc26c403
AUX thttpd.logrotate 197 RMD160 28c782571b226e49680a80bcbe5313ccc2a92d5c SHA1 384127ca1725a08fcfcd08de46a200c53966c24e SHA256 0399d9fdc31a5555307d33c4744b21271e9d7d4d6ded78573fb9b2210f593bc6
DIST thttpd-2.25b.tar.gz 132363 RMD160 15020e8d04d27b30c4da3104387a281e35d58025 SHA1 51bc25ef035d7557c869a02ce353580a1cadfa2c SHA256 4ceaa30ef55702d5cfdffdccd3a2dee8d3090e852c18c7ce8d17d692ad0bf024
EBUILD thttpd-2.25b-r7.ebuild 1578 RMD160 b8cdcfc2fc24fdcd8c0ccef8999ac633bd3e32d8 SHA1 18e4c99ec97d51731563105c29b5b443c29e0072 SHA256 df2f96c1da3633d0799fb250544bde270d936ebf0fea4f414f09569457fe1d3d
EBUILD thttpd-2.25b-r8.ebuild 1951 RMD160 f975a8ce7bcf0ea31ad0b7b6d38f9b13081a4ae2 SHA1 f233e77e26df5c2facd783227363d448059ffb23 SHA256 dc82770a4487b9864fa61e890266f11cab8f5335851a5198f6e4b743684bf391
-MISC ChangeLog 6697 RMD160 f04b7f90d233b340bd94d811eb017864e607ba31 SHA1 12383b445a8503ed570d48a1dc482385389e9c50 SHA256 ad85a4bd26c8dda4602366478c53eeaec7dfdde20d95f8bc8288948277ab9319
+EBUILD thttpd-2.25b-r9.ebuild 2119 RMD160 580f35a4cc5e319b2b83334b50683a08f73e35f9 SHA1 5e907e36abd8a1798e78f8f1b1c844a36a446d13 SHA256 89c113a8764fed3b75cef6f62798bf1bb3bf32dd6a3dedf7b57bb886316f6d88
+MISC ChangeLog 7211 RMD160 885ae55921b3bbfd0b9b402ed50958596217c3f3 SHA1 453229cc38c3b6fe737e41a143a2b28399f057ed SHA256 22c89e4e61f00e56ac44d25ab3737aa3d861cf9a5e15d9558728fc928e20bc4d
MISC metadata.xml 234 RMD160 59e569023e48130b98d1b9f67416af7ef133a7c5 SHA1 8c7c05396c1846e09239cef8844ef3417ce96bbc SHA256 86b598d5029ad9988722ec63434ea041be297ddbb0b2e290025f3b9737427ae9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iEYEAREIAAYFAk9px8AACgkQl5yvQNBFVTXaQACeKKQjB2JAXJRCi+QiJtqgPnx1
-m+kAoIoYMSTprwmbc8/z+mm/K29zWCOC
-=sG6/
+iEYEAREIAAYFAk9tOIIACgkQl5yvQNBFVTXGdgCeNmTa6pX1bnX6vMDCcp2MKipj
+Tp0An1yBmDTwvdBjXx2302OzDLJWQFJ8
+=o9ii
-----END PGP SIGNATURE-----
diff --git a/www-servers/thttpd/files/thttpd-2.25b-additional-input-validation.patch b/www-servers/thttpd/files/thttpd-2.25b-additional-input-validation.patch
new file mode 100644
index 000000000000..04f59eac8e39
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-2.25b-additional-input-validation.patch
@@ -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-2.25b-default-to-octet-stream.patch b/www-servers/thttpd/files/thttpd-2.25b-default-to-octet-stream.patch
new file mode 100644
index 000000000000..f056c1409290
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-2.25b-default-to-octet-stream.patch
@@ -0,0 +1,12 @@
+diff -rupN a/libhttpd.c b/libhttpd.c
+--- a/libhttpd.c 2012-02-21 05:43:57.949988934 +0000
++++ b/libhttpd.c 2012-02-21 05:46:44.446655700 +0000
+@@ -2549,7 +2549,7 @@ figure_mime( httpd_conn* hc )
+ size_t ext_len, encodings_len;
+ int i, top, bot, mid;
+ int r;
+- char* default_type = "text/plain; charset=%s";
++ char* default_type = "application/octet-stream";
+
+ /* Peel off encoding extensions until there aren't any more. */
+ n_me_indexes = 0;
diff --git a/www-servers/thttpd/files/thttpd-2.25b-fix-buffer-overflow.patch b/www-servers/thttpd/files/thttpd-2.25b-fix-buffer-overflow.patch
new file mode 100644
index 000000000000..cacd7321486a
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-2.25b-fix-buffer-overflow.patch
@@ -0,0 +1,21 @@
+diff -Nrup thttpd-2.25b.orig/libhttpd.c thttpd-2.25b/libhttpd.c
+--- thttpd-2.25b.orig/libhttpd.c 2003-12-25 19:06:05.000000000 +0000
++++ thttpd-2.25b/libhttpd.c 2007-01-08 21:43:28.000000000 +0000
+@@ -1469,7 +1469,7 @@ expand_symlinks( char* path, char** rest
+ httpd_realloc_str( &checked, &maxchecked, checkedlen );
+ (void) strcpy( checked, path );
+ /* Trim trailing slashes. */
+- while ( checked[checkedlen - 1] == '/' )
++ while ( checkedlen && checked[checkedlen - 1] == '/' )
+ {
+ checked[checkedlen - 1] = '\0';
+ --checkedlen;
+@@ -1488,7 +1488,7 @@ expand_symlinks( char* path, char** rest
+ restlen = strlen( path );
+ httpd_realloc_str( &rest, &maxrest, restlen );
+ (void) strcpy( rest, path );
+- if ( rest[restlen - 1] == '/' )
++ if ( restlen && rest[restlen - 1] == '/' )
+ rest[--restlen] = '\0'; /* trim trailing slash */
+ if ( ! tildemapped )
+ /* Remove any leading slashes. */
diff --git a/www-servers/thttpd/files/thttpd-2.25b-fix-insecure-tmp-creation.patch b/www-servers/thttpd/files/thttpd-2.25b-fix-insecure-tmp-creation.patch
new file mode 100644
index 000000000000..2918db11ed17
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-2.25b-fix-insecure-tmp-creation.patch
@@ -0,0 +1,21 @@
+Addresses CVE-2005-3124
+
+diff -ru thttpd-2.23beta1.orig/extras/syslogtocern thttpd-2.23beta1/extras/syslogtocern
+--- thttpd-2.23beta1.orig/extras/syslogtocern 1999-09-15 18:00:54.000000000 +0200
++++ thttpd-2.23beta1/extras/syslogtocern 2005-10-26 01:45:34.000000000 +0200
+@@ -31,8 +31,8 @@
+ exit 1
+ fi
+
+-tmp1=/tmp/stc1.$$
+-rm -f $tmp1
++tmp1=``mktemp -t stc1.XXXXXX` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++trap " [ -f \"$tmp1\" ] && /bin/rm -f -- \"$tmp1\"" 0 1 2 3 13 15
+
+ # Gather up all the thttpd entries.
+ egrep ' thttpd\[' $* > $tmp1
+@@ -65,4 +65,3 @@
+ sed -e "s,\([A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\) [^ ]* thttpd\[[0-9]*\]: \(.*\),[\1 ${year}] \2," > error_log
+
+ # Done.
+-rm -f $tmp1
diff --git a/www-servers/thttpd/files/thttpd-2.25b-ogg-mime-type.patch b/www-servers/thttpd/files/thttpd-2.25b-ogg-mime-type.patch
new file mode 100644
index 000000000000..a7801052577b
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-2.25b-ogg-mime-type.patch
@@ -0,0 +1,12 @@
+diff -durPN mime_types.txt mime_types.txt
+--- mime_types.txt 2003-10-26 11:00:45.000000000 -0600
++++ mime_types.txt 2011-06-06 11:30:57.000000000 -0500
+@@ -95,7 +95,7 @@
+ nc application/x-netcdf
+ o application/octet-stream
+ oda application/oda
+-ogg application/x-ogg
++ogg application/ogg
+ pac application/x-ns-proxy-autoconfig
+ pbm image/x-portable-bitmap
+ pdb chemical/x-pdb
diff --git a/www-servers/thttpd/files/thttpd.conf.sample b/www-servers/thttpd/files/thttpd.conf.sample
new file mode 100644
index 000000000000..462bd0c198d0
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.conf.sample
@@ -0,0 +1,38 @@
+## /etc/thttpd.conf
+##
+## do not leave empty lines in here!
+## format is: key=value
+##
+## run in debug-mode?
+#debug
+##
+## what interface to bind to?
+## (default is binding to any interface)
+#host=www.example.org
+port=80
+user=thttpd
+##
+## CGI:
+## ? match a single char
+## * matches any string excluding "/"
+## ** matches any string including "/"
+## separate multiple patterns with "|"
+#cgipat=**.sh|**.cgi
+##
+## chroot:
+chroot
+#nochroot
+##
+logfile=/var/log/thttpd.log
+pidfile=/var/run/thttpd.pid
+##
+charset=iso-8859-1
+##
+## control the caching: (in secs)
+#maxage 60
+##
+## virtual hosting:
+#vhost
+##
+## cache-control: send this "max-age" in all HTTP-responses:
+#max-age=0
diff --git a/www-servers/thttpd/files/thttpd.confd b/www-servers/thttpd/files/thttpd.confd
new file mode 100644
index 000000000000..222d25f1548e
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.confd
@@ -0,0 +1,27 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/files/thttpd.confd,v 1.1 2012/03/24 02:59:02 blueness Exp $
+
+## Config file for /etc/init.d/thttpd
+
+## the startup-dir of thttpd is the docroot, so we specify it here
+## and the init-script does a "cd" prior to startup:
+THTTPD_DOCROOT="/var/www/localhost"
+
+## There are 2 ways to configure thttpd:
+## 1) specify all params on the cmd-line
+## 2) use a config-file (and start with "-C <conf-file>")
+## Note: 1) and 2) can be mixed.
+##
+## We choose 1) here -- if you have a more complicated setup read
+## thttpd(8) for details on 2).
+
+THTTPD_OPTS="-p 80 -u thttpd -r -i /var/run/thttpd.pid -l /var/log/thttpd.log"
+
+## For a more complex setup (e.g. cgi-support) use an external configfile:
+## comment the THTTPD_OPTS line above und use the one below.
+#THTTPD_OPTS="-C /etc/thttpd/thttpd.conf"
+
+## If you know what you are doing you can add cgi-support with the line below;
+## but you _should_ use the extern-configfile version!
+#THTTPD_OPTS="$THTTPD_OPTS -c **.cgi|**.sh"
diff --git a/www-servers/thttpd/files/thttpd.init b/www-servers/thttpd/files/thttpd.init
new file mode 100644
index 000000000000..6e1878f740fa
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.init
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/files/thttpd.init,v 1.1 2012/03/24 02:59:02 blueness Exp $
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting thttpd"
+ if [ ! -d "$THTTPD_DOCROOT" ]; then
+ eend 1 "THTTPD_DOCROOT not set correctly in /etc/conf.d/thttpd"
+ exit 1
+ fi
+ start-stop-daemon --quiet --start --exec /usr/sbin/thttpd \
+ --pidfile /var/run/thttpd.pid --chdir "$THTTPD_DOCROOT" -- \
+ ${THTTPD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping thttpd"
+ start-stop-daemon --quiet --stop --pidfile /var/run/thttpd.pid
+ eend $?
+}
diff --git a/www-servers/thttpd/thttpd-2.25b-r9.ebuild b/www-servers/thttpd/thttpd-2.25b-r9.ebuild
new file mode 100644
index 000000000000..3e765fe74a68
--- /dev/null
+++ b/www-servers/thttpd/thttpd-2.25b-r9.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/thttpd-2.25b-r9.ebuild,v 1.1 2012/03/24 02:59:02 blueness Exp $
+
+EAPI="4"
+
+WANT_AUTOCONF=2.1
+inherit eutils flag-o-matic autotools
+
+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"
+
+RDEPEND=""
+DEPEND="sys-devel/autoconf:2.1"
+
+THTTPD_USER=thttpd
+THTTPD_GROUP=thttpd
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-additional-input-validation.patch
+ epatch "${FILESDIR}"/${P}-fix-buffer-overflow.patch
+ epatch "${FILESDIR}"/${P}-fix-insecure-tmp-creation.patch
+ epatch "${FILESDIR}"/${P}-glibc-2.10.patch
+ epatch "${FILESDIR}"/${P}-fix-illegal-path-info.patch
+ epatch "${FILESDIR}"/${P}-monolithic-timer.patch
+ epatch "${FILESDIR}"/${P}-use-Status-header.patch
+ epatch "${FILESDIR}"/${P}-use-X-Forwarded-For-header.patch
+ epatch "${FILESDIR}"/${P}-respect-CFLAGS--dont-link-static.patch
+ epatch "${FILESDIR}"/${P}-ogg-mime-type.patch
+ epatch "${FILESDIR}"/${P}-default-to-octet-stream.patch
+ eautoreconf
+}
+
+pkg_setup() {
+ ebegin "Creating thttpd user and group"
+ enewgroup ${THTTPD_GROUP}
+ enewuser ${THTTPD_USER} -1 -1 -1 ${THTTPD_GROUP}
+ eend ${?}
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ tc-export CC
+ econf
+}
+
+src_install () {
+ dodir /usr/share/man/man1
+ make prefix="${ED}"/usr \
+ MANDIR="${ED}"/usr/share/man \
+ WEBGROUP=${THTTPD_GROUP} \
+ WEBDIR="${ED}"/var/www/localhost \
+ "$@" install || die "make install failed"
+
+ mv "${ED}"/usr/sbin/{,th_}htpasswd
+ mv "${ED}"/usr/share/man/man1/{,th_}htpasswd.1
+
+ newinitd "${FILESDIR}"/thttpd.init thttpd
+ newconfd "${FILESDIR}"/thttpd.confd thttpd
+
+ dodoc README INSTALL TODO
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/thttpd.logrotate" thttpd
+
+ insinto /etc/thttpd
+ doins "${FILESDIR}"/thttpd.conf.sample
+}
+
+pkg_postinst() {
+ elog "Adjust THTTPD_DOCROOT in /etc/conf.d/thttpd !"
+}