1 Index: src/configfile-glue.c
2 ===================================================================
3 --- src/configfile-glue.c (.../tags/lighttpd-1.4.18) (revision 2025)
4 +++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2025)
9 + case COMP_HTTP_SCHEME:
10 + l = con->uri.scheme;
17 ===================================================================
18 --- src/array.h (.../tags/lighttpd-1.4.18) (revision 2025)
19 +++ src/array.h (.../branches/lighttpd-1.4.x) (revision 2025)
23 COMP_HTTP_QUERYSTRING,
28 Index: src/mod_staticfile.c
29 ===================================================================
30 --- src/mod_staticfile.c (.../tags/lighttpd-1.4.18) (revision 2025)
31 +++ src/mod_staticfile.c (.../branches/lighttpd-1.4.x) (revision 2025)
33 /* if the value is the same as our ETag, we do a Range-request,
34 * otherwise a full 200 */
36 - if (!buffer_is_equal(ds->value, con->physical.etag)) {
37 + if (ds->value->ptr[0] == '"') {
39 + * client wants a ETag
41 + if (!con->physical.etag) {
42 + do_range_request = 0;
43 + } else if (!buffer_is_equal(ds->value, con->physical.etag)) {
44 + do_range_request = 0;
46 + } else if (!mtime) {
48 + * we don't have a Last-Modified and can match the If-Range:
53 + } else if (!buffer_is_equal(ds->value, mtime)) {
54 + do_range_request = 0;
59 ===================================================================
60 --- src/response.c (.../tags/lighttpd-1.4.18) (revision 2025)
61 +++ src/response.c (.../branches/lighttpd-1.4.x) (revision 2025)
63 buffer_copy_string_buffer(con->uri.authority, con->request.http_host);
64 buffer_to_lower(con->uri.authority);
66 + config_patch_connection(srv, con, COMP_HTTP_SCHEME); /* Scheme: */
67 config_patch_connection(srv, con, COMP_HTTP_HOST); /* Host: */
68 config_patch_connection(srv, con, COMP_HTTP_REMOTEIP); /* Client-IP */
69 config_patch_connection(srv, con, COMP_HTTP_REFERER); /* Referer: */
70 Index: src/configparser.y
71 ===================================================================
72 --- src/configparser.y (.../tags/lighttpd-1.4.18) (revision 2025)
73 +++ src/configparser.y (.../branches/lighttpd-1.4.x) (revision 2025)
75 { COMP_HTTP_COOKIE, CONST_STR_LEN("HTTP[\"cookie\"]" ) },
76 { COMP_HTTP_REMOTEIP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
77 { COMP_HTTP_QUERYSTRING, CONST_STR_LEN("HTTP[\"querystring\"]") },
78 + { COMP_HTTP_SCHEME, CONST_STR_LEN("HTTP[\"scheme\"]" ) },
79 { COMP_UNSET, NULL, 0 },
82 Index: src/spawn-fcgi.c
83 ===================================================================
84 --- src/spawn-fcgi.c (.../tags/lighttpd-1.4.18) (revision 2025)
85 +++ src/spawn-fcgi.c (.../branches/lighttpd-1.4.x) (revision 2025)
90 -int fcgi_spawn_connection(char *appPath, char *addr, unsigned short port, const char *unixsocket, int child_count, int pid_fd, int nofork) {
91 +int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int child_count, int pid_fd, int nofork) {
93 int socket_type, status;
94 struct timeval tv = { 0, 100 * 1000 };
103 - /* is save as we limit to 256 childs */
104 + /* is safe as we limit to 256 childs */
105 sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
107 if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
108 @@ -160,13 +159,18 @@
111 /* fork and replace shell */
112 - b = malloc(strlen("exec ") + strlen(appPath) + 1);
113 - strcpy(b, "exec ");
114 - strcat(b, appPath);
116 + execv(appArgv[0], appArgv);
119 - execl("/bin/sh", "sh", "-c", b, (char *)NULL);
121 + char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
122 + strcpy(b, "exec ");
123 + strcat(b, appPath);
126 + execl("/bin/sh", "sh", "-c", b, (char *)NULL);
136 - char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
137 -" - spawns fastcgi processes\n" \
140 +"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
142 +"spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \
145 " -f <fcgiapp> filename of the fcgi-application\n" \
146 " -a <addr> bind to ip address\n" \
147 " -p <port> bind to tcp-port\n" \
149 char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
150 *groupname = NULL, *unixsocket = NULL, *pid_file = NULL,
152 + char **fcgi_app_argv = { NULL };
153 unsigned short port = 0;
158 i_am_root = (getuid() == 0);
160 - while(-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:s:P:"))) {
161 + while(-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:s:P:"))) {
163 case 'f': fcgi_app = optarg; break;
164 case 'a': addr = optarg;/* ip addr */ break;
169 - if (fcgi_app == NULL || (port == 0 && unixsocket == NULL)) {
170 + if (optind < argc) {
171 + fcgi_app_argv = &argv[optind];
174 + if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) {
183 + * Change group before chroot, when we have access
187 + setgid(grp->gr_gid);
188 + setgroups(0, NULL);
190 + initgroups(username, grp->gr_gid);
195 if (-1 == chroot(changeroot)) {
196 fprintf(stderr, "%s.%d: %s %s\n",
197 @@ -420,18 +444,12 @@
200 /* drop root privs */
202 - setgid(grp->gr_gid);
206 - initgroups(username, grp->gr_gid);
212 - return fcgi_spawn_connection(fcgi_app, addr, port, unixsocket, child_count, pid_fd, nofork);
213 + return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, child_count, pid_fd, nofork);
218 ===================================================================
219 --- src/server.c (.../tags/lighttpd-1.4.18) (revision 2025)
220 +++ src/server.c (.../branches/lighttpd-1.4.x) (revision 2025)
227 + * Change group before chroot, when we have access
230 + if (srv->srvconf.groupname->used) {
231 + setgid(grp->gr_gid);
232 + setgroups(0, NULL);
233 + if (srv->srvconf.username->used) {
234 + initgroups(srv->srvconf.username->ptr, grp->gr_gid);
239 if (srv->srvconf.changeroot->used) {
244 /* drop root privs */
245 - if (srv->srvconf.groupname->used) {
246 - setgid(grp->gr_gid);
247 - setgroups(0, NULL);
250 if (srv->srvconf.username->used) {
251 - if (srv->srvconf.groupname->used) {
252 - initgroups(srv->srvconf.username->ptr, grp->gr_gid);
257 Index: doc/configuration.txt
258 ===================================================================
259 --- doc/configuration.txt (.../tags/lighttpd-1.4.18) (revision 2025)
260 +++ doc/configuration.txt (.../branches/lighttpd-1.4.x) (revision 2025)
271 ===================================================================
272 --- Makefile.am (.../tags/lighttpd-1.4.18) (revision 2025)
273 +++ Makefile.am (.../branches/lighttpd-1.4.x) (revision 2025)
275 SUBDIRS=src doc tests cygwin openwrt
277 -EXTRA_DIST=lighttpd.spec
278 +EXTRA_DIST=lighttpd.spec SConstruct
280 ===================================================================
281 --- NEWS (.../tags/lighttpd-1.4.18) (revision 2025)
282 +++ NEWS (.../branches/lighttpd-1.4.x) (revision 2025)
289 + * added support for If-Range: <date> (#1346)
290 + * added support for matching $HTTP["scheme"] in configs
291 + * fixed initgroups() called after chroot (#1384)
292 + * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428)
294 - 1.4.18 - 2007-09-09
296 * fixed compile error on IRIX 6.5.x on prctl() (#1333)
297 Index: lighttpd.spec.in
298 ===================================================================
299 --- lighttpd.spec.in (.../tags/lighttpd-1.4.18) (revision 2025)
300 +++ lighttpd.spec.in (.../branches/lighttpd-1.4.x) (revision 2025)
302 Packager: Jan Kneschke <jan@kneschke.de>
304 Group: Networking/Daemons
305 -URL: http://jan.kneschke.de/projects/lighttpd/
306 +URL: http://www.lighttpd.net/
307 Requires: pcre >= 3.1 zlib
308 -BuildPrereq: libtool zlib-devel
309 +BuildRequires: libtool zlib-devel
310 BuildRoot: %{_tmppath}/%{name}-root
314 lighttpd is intented to be a frontend for ad-servers which have to deliver
315 small files concurrently to many connections.
317 -Available rpmbuild rebuild options :
318 ---with : ssl mysql lua memcache
319 +Available rpmbuild rebuild options:
320 +--with: ssl mysql lua memcache
334 mkdir -p %{buildroot}%{_sysconfdir}/{init.d,sysconfig}
335 -if test -f /etc/redhat-release -o -f /etc/fedora-release; then
336 - install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
337 +if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then
338 + install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
340 - install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
341 + install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
343 install -m 644 doc/sysconfig.lighttpd %{buildroot}%{_sysconfdir}/sysconfig/lighttpd
348 ## read http://www.fedora.us/docs/spec.html next time :)
349 -if test "$1" = "1"; then
350 - # real install, not upgrade
351 - /sbin/chkconfig --add lighttpd
352 +if [ "$1" = "1" ]; then
353 + # real install, not upgrade
354 + /sbin/chkconfig --add lighttpd
358 -if test "$1" = "0"; then
359 - # real uninstall, not upgrade
360 - %{_sysconfdir}/init.d/lighttpd stop
361 - /sbin/chkconfig --del lighttpd
362 +if [ "$1" = "0"]; then
363 + # real uninstall, not upgrade
364 + %{_sysconfdir}/init.d/lighttpd stop
365 + /sbin/chkconfig --del lighttpd