]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd-branch.diff
- update to r2199:
[packages/lighttpd.git] / lighttpd-branch.diff
1 Index: lighttpd.spec.in
2 ===================================================================
3 --- lighttpd.spec.in    (.../tags/lighttpd-1.4.19)      (revision 2199)
4 +++ lighttpd.spec.in    (.../branches/lighttpd-1.4.x)   (revision 2199)
5 @@ -1,83 +0,0 @@
6 -Summary: A fast webserver with minimal memory-footprint (lighttpd)
7 -Name: lighttpd
8 -Version: @VERSION@
9 -Release: 1
10 -Source: http://jan.kneschke.de/projects/lighttpd/download/lighttpd-%version.tar.gz
11 -Packager: Jan Kneschke <jan@kneschke.de>
12 -License: BSD
13 -Group: Networking/Daemons
14 -URL: http://www.lighttpd.net/
15 -Requires: pcre >= 3.1 zlib
16 -BuildRequires: libtool zlib-devel
17 -BuildRoot: %{_tmppath}/%{name}-root
18 -
19 -%description
20 -lighttpd is intented to be a frontend for ad-servers which have to deliver
21 -small files concurrently to many connections.
22 -
23 -Available rpmbuild rebuild options:
24 ---with: ssl mysql lua memcache
25 -
26 -%prep
27 -%setup -q
28 -
29 -%build
30 -rm -rf %{buildroot}
31 -%configure \
32 -    %{?_with_mysql:       --with-mysql} \
33 -    %{?_with_lua:         --with-lua} \
34 -    %{?_with_memcache:    --with-memcache} \
35 -    %{?_with_ssl:         --with-openssl}
36 -make
37 -
38 -%install
39 -%makeinstall
40 -
41 -mkdir -p %{buildroot}%{_sysconfdir}/{init.d,sysconfig}
42 -if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then
43 -       install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
44 -else
45 -       install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
46 -fi
47 -install -m 644 doc/sysconfig.lighttpd %{buildroot}%{_sysconfdir}/sysconfig/lighttpd
48 -
49 -%clean
50 -rm -rf %{buildroot}
51 -
52 -%post
53 -## read http://www.fedora.us/docs/spec.html next time :)
54 -if [ "$1" = "1" ]; then
55 -       # real install, not upgrade
56 -       /sbin/chkconfig --add lighttpd
57 -fi
58 -
59 -%preun
60 -if [ "$1" = "0"]; then
61 -       # real uninstall, not upgrade
62 -       %{_sysconfdir}/init.d/lighttpd stop
63 -       /sbin/chkconfig --del lighttpd
64 -fi
65 -
66 -%files
67 -%defattr(-,root,root)
68 -%doc doc/lighttpd.conf doc/lighttpd.user README INSTALL ChangeLog COPYING AUTHORS
69 -%doc doc/*.txt
70 -%config(noreplace) %attr(0755,root,root) %{_sysconfdir}/init.d/lighttpd
71 -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/lighttpd
72 -%{_mandir}/*
73 -%{_libdir}/*
74 -%{_sbindir}/*
75 -%{_bindir}/*
76 -
77 -%changelog
78 -* Thu Sep 30 2004 12:41 <jan@kneschke.de> 1.3.1
79 -- upgraded to 1.3.1
80 -
81 -* Tue Jun 29 2004 17:26 <jan@kneschke.de> 1.2.3
82 -- rpmlint'ed the package
83 -- added URL
84 -- added (noreplace) to start-script
85 -- change group to Networking/Daemon (like apache)
86 -
87 -* Sun Feb 23 2003 15:04 <jan@kneschke.de>
88 -- initial version
89 Index: configure.in
90 ===================================================================
91 Index: src/mod_ssi_exprparser.h
92 ===================================================================
93 --- src/mod_ssi_exprparser.h    (.../tags/lighttpd-1.4.19)      (revision 2199)
94 +++ src/mod_ssi_exprparser.h    (.../branches/lighttpd-1.4.x)   (revision 2199)
95 @@ -1,12 +0,0 @@
96 -#define TK_AND                             1
97 -#define TK_OR                              2
98 -#define TK_EQ                              3
99 -#define TK_NE                              4
100 -#define TK_GT                              5
101 -#define TK_GE                              6
102 -#define TK_LT                              7
103 -#define TK_LE                              8
104 -#define TK_NOT                             9
105 -#define TK_LPARAN                         10
106 -#define TK_RPARAN                         11
107 -#define TK_VALUE                          12
108 Index: src/configfile-glue.c
109 ===================================================================
110 --- src/configfile-glue.c       (.../tags/lighttpd-1.4.19)      (revision 2199)
111 +++ src/configfile-glue.c       (.../branches/lighttpd-1.4.x)   (revision 2199)
112 @@ -529,7 +529,7 @@
113  int config_append_cond_match_buffer(connection *con, data_config *dc, buffer *buf, int n)
114  {
115         cond_cache_t *cache = &con->cond_cache[dc->context_ndx];
116 -       if (n > cache->patterncount) {
117 +       if (n >= cache->patterncount) {
118                 return 0;
119         }
120  
121 Index: src/mod_cgi.c
122 ===================================================================
123 --- src/mod_cgi.c       (.../tags/lighttpd-1.4.19)      (revision 2199)
124 +++ src/mod_cgi.c       (.../branches/lighttpd-1.4.x)   (revision 2199)
125 @@ -987,6 +987,8 @@
126                         *c = '/';
127                 }
128  
129 +               openDevNull(STDERR_FILENO);
130 +
131                 /* we don't need the client socket */
132                 for (i = 3; i < 256; i++) {
133                         if (i != srv->errorlog_fd) close(i);
134 @@ -995,7 +997,7 @@
135                 /* exec the cgi */
136                 execve(args[0], args, env.ptr);
137  
138 -               log_error_write(srv, __FILE__, __LINE__, "sss", "CGI failed:", strerror(errno), args[0]);
139 +               /* log_error_write(srv, __FILE__, __LINE__, "sss", "CGI failed:", strerror(errno), args[0]); */
140  
141                 /* */
142                 SEGFAULT();
143 @@ -1058,8 +1060,9 @@
144                                                 switch(errno) {
145                                                 case ENOSPC:
146                                                         con->http_status = 507;
147 -
148                                                         break;
149 +                                               case EINTR:
150 +                                                       continue;
151                                                 default:
152                                                         con->http_status = 403;
153                                                         break;
154 @@ -1071,8 +1074,9 @@
155                                                 switch(errno) {
156                                                 case ENOSPC:
157                                                         con->http_status = 507;
158 -
159                                                         break;
160 +                                               case EINTR:
161 +                                                       continue;
162                                                 default:
163                                                         con->http_status = 403;
164                                                         break;
165 @@ -1087,6 +1091,8 @@
166                                         c->offset += r;
167                                         cq->bytes_out += r;
168                                 } else {
169 +                                       log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno)); 
170 +                                       con->http_status = 500;
171                                         break;
172                                 }
173                                 chunkqueue_remove_finished_chunks(cq);
174 Index: src/mod_rewrite.c
175 ===================================================================
176 --- src/mod_rewrite.c   (.../tags/lighttpd-1.4.19)      (revision 2199)
177 +++ src/mod_rewrite.c   (.../branches/lighttpd-1.4.x)   (revision 2199)
178 @@ -385,8 +385,7 @@
179  
180                         start = 0; end = pattern_len;
181                         for (k = 0; k < pattern_len; k++) {
182 -                               if ((pattern[k] == '$' || pattern[k] == '%') &&
183 -                                   isdigit((unsigned char)pattern[k + 1])) {
184 +                               if (pattern[k] == '$' || pattern[k] == '%') {
185                                         /* got one */
186  
187                                         size_t num = pattern[k + 1] - '0';
188 @@ -395,7 +394,10 @@
189  
190                                         buffer_append_string_len(con->request.uri, pattern + start, end - start);
191  
192 -                                       if (pattern[k] == '$') {
193 +                                       if (!isdigit((unsigned char)pattern[k + 1])) {
194 +                                               /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
195 +                                               buffer_append_string_len(con->request.uri, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
196 +                                       } else if (pattern[k] == '$') {
197                                                 /* n is always > 0 */
198                                                 if (num < (size_t)n) {
199                                                         buffer_append_string(con->request.uri, list[num]);
200 Index: src/lempar.c
201 ===================================================================
202 --- src/lempar.c        (.../tags/lighttpd-1.4.19)      (revision 2199)
203 +++ src/lempar.c        (.../branches/lighttpd-1.4.x)   (revision 2199)
204 @@ -210,7 +210,7 @@
205  */
206  const char *ParseTokenName(int tokenType){
207  #ifndef NDEBUG
208 -  if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
209 +  if( tokenType>0 && (size_t)tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
210      return yyTokenName[tokenType];
211    }else{
212      return "Unknown";
213 @@ -335,7 +335,7 @@
214      return YY_NO_ACTION;
215    }
216    i += iLookAhead;
217 -  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
218 +  if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
219  #ifdef YYFALLBACK
220      int iFallback;            /* Fallback token */
221      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
222 @@ -378,7 +378,7 @@
223      return YY_NO_ACTION;
224    }
225    i += iLookAhead;
226 -  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
227 +  if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
228      return yy_default[stateno];
229    }else{
230      return yy_action[i];
231 @@ -456,7 +456,7 @@
232    yymsp = &yypParser->yystack[yypParser->yyidx];
233  #ifndef NDEBUG
234    if( yyTraceFILE && yyruleno>=0
235 -        && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
236 +        && (size_t)yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
237      fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
238        yyRuleName[yyruleno]);
239    }
240 @@ -511,6 +511,8 @@
241    int yymajor,                   /* The major type of the error token */
242    YYMINORTYPE yyminor            /* The minor type of the error token */
243  ){
244 +  UNUSED(yymajor);
245 +  UNUSED(yyminor);
246    ParseARG_FETCH;
247  #define TOKEN (yyminor.yy0)
248  %%
249 Index: src/connections.c
250 ===================================================================
251 --- src/connections.c   (.../tags/lighttpd-1.4.19)      (revision 2199)
252 +++ src/connections.c   (.../branches/lighttpd-1.4.x)   (revision 2199)
253 @@ -199,6 +199,7 @@
254  
255         /* don't resize the buffer if we were in SSL_ERROR_WANT_* */
256  
257 +       ERR_clear_error();
258         do {
259                 if (!con->ssl_error_want_reuse_buffer) {
260                         b = buffer_init();
261 @@ -299,6 +300,8 @@
262  
263         return 0;
264  #else
265 +       UNUSED(srv);
266 +       UNUSED(con);
267         return -1;
268  #endif
269  }
270 @@ -427,21 +430,22 @@
271         }
272  
273         switch(con->http_status) {
274 -       case 400: /* class: header + custom body */
275 -       case 401:
276 -       case 403:
277 -       case 404:
278 -       case 408:
279 -       case 409:
280 -       case 411:
281 -       case 416:
282 -       case 423:
283 -       case 500:
284 -       case 501:
285 -       case 503:
286 -       case 505:
287 +       case 204: /* class: header only */
288 +       case 205:
289 +       case 304:
290 +               /* disable chunked encoding again as we have no body */
291 +               con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
292 +               con->parsed_response &= ~HTTP_CONTENT_LENGTH;
293 +               chunkqueue_reset(con->write_queue);
294 +
295 +               con->file_finished = 1;
296 +               break;
297 +       default: /* class: header + body */
298                 if (con->mode != DIRECT) break;
299  
300 +               /* only custom body for 4xx and 5xx */
301 +               if (con->http_status < 400 || con->http_status >= 600) break;
302 +
303                 con->file_finished = 0;
304  
305                 buffer_reset(con->physical.path);
306 @@ -451,7 +455,8 @@
307                         stat_cache_entry *sce = NULL;
308  
309                         buffer_copy_string_buffer(con->physical.path, con->conf.errorfile_prefix);
310 -                       buffer_append_string(con->physical.path, get_http_status_body_name(con->http_status));
311 +                       buffer_append_long(con->physical.path, con->http_status);
312 +                       buffer_append_string_len(con->physical.path, CONST_STR_LEN(".html"));
313  
314                         if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
315                                 con->file_finished = 1;
316 @@ -497,30 +502,7 @@
317  
318                         response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
319                 }
320 -               /* fall through */
321 -       case 207:
322 -       case 200: /* class: header + body */
323 -       case 201:
324 -       case 300:
325 -       case 301:
326 -       case 302:
327 -       case 303:
328 -       case 307:
329                 break;
330 -
331 -       case 206: /* write_queue is already prepared */
332 -               break;
333 -       case 204:
334 -       case 205: /* class: header only */
335 -       case 304:
336 -       default:
337 -               /* disable chunked encoding again as we have no body */
338 -               con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
339 -               con->parsed_response &= ~HTTP_CONTENT_LENGTH;
340 -               chunkqueue_reset(con->write_queue);
341 -
342 -               con->file_finished = 1;
343 -               break;
344         }
345  
346         if (con->file_finished) {
347 @@ -544,7 +526,7 @@
348                                 data_string *ds;
349                                 /* no Content-Body, no Content-Length */
350                                 if (NULL != (ds = (data_string*) array_get_element(con->response.headers, "Content-Length"))) {
351 -                                       buffer_reset(ds->value); // Headers with empty values are ignored for output
352 +                                       buffer_reset(ds->value); /* Headers with empty values are ignored for output */
353                                 }
354                         } else if (qlen > 0 || con->request.http_method != HTTP_METHOD_HEAD) {
355                                 /* qlen = 0 is important for Redirects (301, ...) as they MAY have
356 @@ -846,7 +828,7 @@
357         }
358  
359         /* The cond_cache gets reset in response.c */
360 -//     config_cond_cache_reset(srv, con);
361 +       /* config_cond_cache_reset(srv, con); */
362  
363  #ifdef USE_OPENSSL
364         if (con->ssl_error_want_reuse_buffer) {
365 @@ -1668,21 +1650,51 @@
366                         }
367  #ifdef USE_OPENSSL
368                         if (srv_sock->is_ssl) {
369 -                               int ret;
370 +                               int ret, ssl_r;
371 +                               unsigned long err;
372 +                               ERR_clear_error();
373                                 switch ((ret = SSL_shutdown(con->ssl))) {
374                                 case 1:
375                                         /* ok */
376                                         break;
377                                 case 0:
378 -                                       SSL_shutdown(con->ssl);
379 -                                       break;
380 +                                       ERR_clear_error();
381 +                                       if (-1 != (ret = SSL_shutdown(con->ssl))) break;
382 +
383 +                                       /* fall through */
384                                 default:
385 -                                       log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
386 -                                                       SSL_get_error(con->ssl, ret),
387 -                                                       ERR_error_string(ERR_get_error(), NULL));
388 -                                       return -1;
389 +
390 +                                       switch ((ssl_r = SSL_get_error(con->ssl, ret))) {
391 +                                       case SSL_ERROR_WANT_WRITE:
392 +                                       case SSL_ERROR_WANT_READ:
393 +                                               break;
394 +                                       case SSL_ERROR_SYSCALL:
395 +                                               /* perhaps we have error waiting in our error-queue */
396 +                                               if (0 != (err = ERR_get_error())) {
397 +                                                       do {
398 +                                                               log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
399 +                                                                               ssl_r, ret,
400 +                                                                               ERR_error_string(err, NULL));
401 +                                                       } while((err = ERR_get_error()));
402 +                                               } else {
403 +                                                       log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
404 +                                                                       ssl_r, ret, errno,
405 +                                                                       strerror(errno));
406 +                                               }
407 +       
408 +                                               break;
409 +                                       default:
410 +                                               while((err = ERR_get_error())) {
411 +                                                       log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
412 +                                                                       ssl_r, ret,
413 +                                                                       ERR_error_string(err, NULL));
414 +                                               }
415 +       
416 +                                               break;
417 +                                       }
418                                 }
419                         }
420 +                       ERR_clear_error();
421  #endif
422  
423                         switch(con->mode) {
424 Index: src/configfile.c
425 ===================================================================
426 --- src/configfile.c    (.../tags/lighttpd-1.4.19)      (revision 2199)
427 +++ src/configfile.c    (.../branches/lighttpd-1.4.x)   (revision 2199)
428 @@ -7,6 +7,7 @@
429  #include <string.h>
430  #include <stdio.h>
431  #include <ctype.h>
432 +#include <limits.h>
433  #include <assert.h>
434  
435  #include "server.h"
436 @@ -305,9 +306,6 @@
437                 data_config *dc = (data_config *)srv->config_context->data[i];
438                 specific_config *s = srv->config_storage[i];
439  
440 -               /* not our stage */
441 -               if (comp != dc->comp) continue;
442 -
443                 /* condition didn't match */
444                 if (!config_check_cond(srv, con, dc)) continue;
445  
446 @@ -410,8 +408,8 @@
447  
448  #if 0
449  static int tokenizer_open(server *srv, tokenizer_t *t, buffer *basedir, const char *fn) {
450 -       if (buffer_is_empty(basedir) &&
451 -                       (fn[0] == '/' || fn[0] == '\\') &&
452 +       if (buffer_is_empty(basedir) ||
453 +                       (fn[0] == '/' || fn[0] == '\\') ||
454                         (fn[0] == '.' && (fn[1] == '/' || fn[1] == '\\'))) {
455                 t->file = buffer_init_string(fn);
456         } else {
457 @@ -884,8 +882,8 @@
458         int ret;
459         buffer *filename;
460  
461 -       if (buffer_is_empty(context->basedir) &&
462 -                       (fn[0] == '/' || fn[0] == '\\') &&
463 +       if (buffer_is_empty(context->basedir) ||
464 +                       (fn[0] == '/' || fn[0] == '\\') ||
465                         (fn[0] == '.' && (fn[1] == '/' || fn[1] == '\\'))) {
466                 filename = buffer_init_string(fn);
467         } else {
468 @@ -912,15 +910,39 @@
469         return ret;
470  }
471  
472 +static char* getCWD() {
473 +       char *s, *s1;
474 +       size_t len;
475 +#ifdef PATH_MAX
476 +       len = PATH_MAX;
477 +#else
478 +       len = 4096;
479 +#endif
480 +
481 +       s = malloc(len);
482 +       if (!s) return NULL;
483 +       while (NULL == getcwd(s, len)) {
484 +               if (errno != ERANGE || SSIZE_MAX - len < len) return NULL;
485 +               len *= 2;
486 +               s1 = realloc(s, len);
487 +               if (!s1) {
488 +                       free(s);
489 +                       return NULL;
490 +               }
491 +               s = s1;
492 +       }
493 +       return s;
494 +}
495 +
496  int config_parse_cmd(server *srv, config_t *context, const char *cmd) {
497         proc_handler_t proc;
498         tokenizer_t t;
499         int ret;
500         buffer *source;
501         buffer *out;
502 -       char oldpwd[PATH_MAX];
503 +       char *oldpwd;
504  
505 -       if (NULL == getcwd(oldpwd, sizeof(oldpwd))) {
506 +       if (NULL == (oldpwd = getCWD())) {
507                 log_error_write(srv, __FILE__, __LINE__, "s",
508                                 "cannot get cwd", strerror(errno));
509                 return -1;
510 @@ -945,6 +967,7 @@
511         buffer_free(source);
512         buffer_free(out);
513         chdir(oldpwd);
514 +       free(oldpwd);
515         return ret;
516  }
517  
518 Index: src/lemon.c
519 ===================================================================
520 --- src/lemon.c (.../tags/lighttpd-1.4.19)      (revision 2199)
521 +++ src/lemon.c (.../branches/lighttpd-1.4.x)   (revision 2199)
522 @@ -12,6 +12,19 @@
523  #include <ctype.h>
524  #include <stdlib.h>
525  
526 +#ifdef HAVE_CONFIG_H
527 +#include "config.h"
528 +#endif
529 +
530 +#ifdef HAVE_STDINT_H
531 +# include <stdint.h>
532 +#endif
533 +#ifdef HAVE_INTTYPES_H
534 +# include <inttypes.h>
535 +#endif
536 +
537 +#define UNUSED(x) ( (void)(x) )
538 +
539  extern void qsort();
540  extern double strtod();
541  extern long strtol();
542 @@ -983,6 +996,7 @@
543  {
544    struct symbol *spx, *spy;
545    int errcnt = 0;
546 +  UNUSED(errsym);
547    assert( apx->sp==apy->sp );  /* Otherwise there would be no conflict */
548    if( apx->type==SHIFT && apy->type==REDUCE ){
549      spx = apx->sp;
550 @@ -1347,6 +1361,7 @@
551    struct lemon lem;
552    char *def_tmpl_name = "lempar.c";
553  
554 +  UNUSED(argc);
555    OptInit(argv,options,stderr);
556    if( version ){
557       printf("Lemon version 1.0\n");
558 @@ -1651,7 +1666,7 @@
559    }else if( op[j].type==OPT_FLAG ){
560      *((int*)op[j].arg) = v;
561    }else if( op[j].type==OPT_FFLAG ){
562 -    (*(void(*)())(op[j].arg))(v);
563 +    (*(void(*)())(intptr_t)(op[j].arg))(v);
564    }else{
565      if( err ){
566        fprintf(err,"%smissing argument on switch.\n",emsg);
567 @@ -1733,19 +1748,19 @@
568          *(double*)(op[j].arg) = dv;
569          break;
570        case OPT_FDBL:
571 -        (*(void(*)())(op[j].arg))(dv);
572 +        (*(void(*)())(intptr_t)(op[j].arg))(dv);
573          break;
574        case OPT_INT:
575          *(int*)(op[j].arg) = lv;
576          break;
577        case OPT_FINT:
578 -        (*(void(*)())(op[j].arg))((int)lv);
579 +        (*(void(*)())(intptr_t)(op[j].arg))((int)lv);
580          break;
581        case OPT_STR:
582          *(char**)(op[j].arg) = sv;
583          break;
584        case OPT_FSTR:
585 -        (*(void(*)())(op[j].arg))(sv);
586 +        (*(void(*)())(intptr_t)(op[j].arg))(sv);
587          break;
588      }
589    }
590 @@ -2286,10 +2301,10 @@
591  ** token is passed to the function "parseonetoken" which builds all
592  ** the appropriate data structures in the global state vector "gp".
593  */
594 +struct pstate ps;
595  void Parse(gp)
596  struct lemon *gp;
597  {
598 -  struct pstate ps;
599    FILE *fp;
600    char *filebuf;
601    size_t filesize;
602 Index: src/mod_scgi.c
603 ===================================================================
604 --- src/mod_scgi.c      (.../tags/lighttpd-1.4.19)      (revision 2199)
605 +++ src/mod_scgi.c      (.../branches/lighttpd-1.4.x)   (revision 2199)
606 @@ -202,6 +202,15 @@
607          *
608          */
609  
610 +       /*
611 +        * workaround for program when prefix="/"
612 +        *
613 +        * rule to build PATH_INFO is hardcoded for when check_local is disabled
614 +        * enable this option to use the workaround
615 +        *
616 +        */
617 +
618 +       unsigned short fix_root_path_name;
619         ssize_t load; /* replace by host->load */
620  
621         size_t max_id; /* corresponds most of the time to
622 @@ -233,6 +242,7 @@
623  typedef struct {
624         buffer *key; /* like .php */
625  
626 +       int note_is_sent;
627         scgi_extension_host **hosts;
628  
629         size_t used;
630 @@ -968,6 +978,7 @@
631  
632                                                 { "bin-environment",   NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },        /* 11 */
633                                                 { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },     /* 12 */
634 +                                               { "fix-root-scriptname",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },   /* 13 */
635  
636  
637                                                 { NULL,                NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
638 @@ -990,6 +1001,7 @@
639                                         df->max_load_per_proc = 1;
640                                         df->idle_timeout = 60;
641                                         df->disable_time = 60;
642 +                                       df->fix_root_path_name = 0;
643  
644                                         fcv[0].destination = df->host;
645                                         fcv[1].destination = df->docroot;
646 @@ -1006,6 +1018,7 @@
647  
648                                         fcv[11].destination = df->bin_env;
649                                         fcv[12].destination = df->bin_env_copy;
650 +                                       fcv[13].destination = &(df->fix_root_path_name);
651  
652  
653                                         if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
654 @@ -2668,10 +2681,10 @@
655         plugin_data *p = p_d;
656         size_t s_len;
657         int used = -1;
658 -       int ndx;
659         size_t k;
660         buffer *fn;
661         scgi_extension *extension = NULL;
662 +       scgi_extension_host *host = NULL;
663  
664         /* Possibly, we processed already this request */
665         if (con->file_started == 1) return HANDLER_GO_ON;
666 @@ -2712,95 +2725,59 @@
667         }
668  
669         /* get best server */
670 -       for (k = 0, ndx = -1; k < extension->used; k++) {
671 -               scgi_extension_host *host = extension->hosts[k];
672 +       for (k = 0; k < extension->used; k++) {
673 +               scgi_extension_host *h = extension->hosts[k];
674  
675 -               /* we should have at least one proc that can do somthing */
676 -               if (host->active_procs == 0) continue;
677 +               /* we should have at least one proc that can do something */
678 +               if (h->active_procs == 0) {
679 +                       continue;
680 +               }
681  
682 -               if (used == -1 || host->load < used) {
683 -                       used = host->load;
684 +               if (used == -1 || h->load < used) {
685 +                       used = h->load;
686  
687 -                       ndx = k;
688 +                       host = h;
689                 }
690         }
691  
692 -       /* found a server */
693 -       if (ndx != -1) {
694 -               scgi_extension_host *host = extension->hosts[ndx];
695 +       if (!host) {
696 +               /* sorry, we don't have a server alive for this ext */
697 +               buffer_reset(con->physical.path);
698 +               con->http_status = 500;
699  
700 -               /*
701 -                * if check-local is disabled, use the uri.path handler
702 -                *
703 -                */
704 +               /* only send the 'no handler' once */
705 +               if (!extension->note_is_sent) {
706 +                       extension->note_is_sent = 1;
707  
708 -               /* init handler-context */
709 -               if (uri_path_handler) {
710 -                       if (host->check_local == 0) {
711 -                               handler_ctx *hctx;
712 -                               char *pathinfo;
713 +                       log_error_write(srv, __FILE__, __LINE__, "sbsbs",
714 +                                       "all handlers for ", con->uri.path,
715 +                                       "on", extension->key,
716 +                                       "are down.");
717 +               }
718  
719 -                               hctx = handler_ctx_init();
720 +               return HANDLER_FINISHED;
721 +       }
722  
723 -                               hctx->remote_conn      = con;
724 -                               hctx->plugin_data      = p;
725 -                               hctx->host             = host;
726 -                               hctx->proc             = NULL;
727 +       /* a note about no handler is not sent yet */
728 +       extension->note_is_sent = 0;
729  
730 -                               hctx->conf.exts        = p->conf.exts;
731 -                               hctx->conf.debug       = p->conf.debug;
732 +       /*
733 +        * if check-local is disabled, use the uri.path handler
734 +        *
735 +        */
736  
737 -                               con->plugin_ctx[p->id] = hctx;
738 +       /* init handler-context */
739 +       if (uri_path_handler) {
740 +               if (host->check_local == 0) {
741 +                       handler_ctx *hctx;
742 +                       char *pathinfo;
743  
744 -                               host->load++;
745 -
746 -                               con->mode = p->id;
747 -
748 -                               if (con->conf.log_request_handling) {
749 -                                       log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_scgi");
750 -                               }
751 -
752 -                               /* the prefix is the SCRIPT_NAME,
753 -                                * everthing from start to the next slash
754 -                                * this is important for check-local = "disable"
755 -                                *
756 -                                * if prefix = /admin.fcgi
757 -                                *
758 -                                * /admin.fcgi/foo/bar
759 -                                *
760 -                                * SCRIPT_NAME = /admin.fcgi
761 -                                * PATH_INFO   = /foo/bar
762 -                                *
763 -                                * if prefix = /fcgi-bin/
764 -                                *
765 -                                * /fcgi-bin/foo/bar
766 -                                *
767 -                                * SCRIPT_NAME = /fcgi-bin/foo
768 -                                * PATH_INFO   = /bar
769 -                                *
770 -                                */
771 -
772 -                               /* the rewrite is only done for /prefix/? matches */
773 -                               if (extension->key->ptr[0] == '/' &&
774 -                                   con->uri.path->used > extension->key->used &&
775 -                                   NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
776 -                                       /* rewrite uri.path and pathinfo */
777 -
778 -                                       buffer_copy_string(con->request.pathinfo, pathinfo);
779 -
780 -                                       con->uri.path->used -= con->request.pathinfo->used - 1;
781 -                                       con->uri.path->ptr[con->uri.path->used - 1] = '\0';
782 -                               }
783 -                       }
784 -                       return HANDLER_GO_ON;
785 -               } else {
786 -                       handler_ctx *hctx;
787                         hctx = handler_ctx_init();
788  
789                         hctx->remote_conn      = con;
790                         hctx->plugin_data      = p;
791                         hctx->host             = host;
792 -                       hctx->proc             = NULL;
793 +                       hctx->proc             = NULL;
794  
795                         hctx->conf.exts        = p->conf.exts;
796                         hctx->conf.debug       = p->conf.debug;
797 @@ -2812,22 +2789,69 @@
798                         con->mode = p->id;
799  
800                         if (con->conf.log_request_handling) {
801 -                               log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
802 +                               log_error_write(srv, __FILE__, __LINE__, "s",
803 +                               "handling it in mod_fastcgi");
804                         }
805  
806 -                       return HANDLER_GO_ON;
807 +                       /* the prefix is the SCRIPT_NAME,
808 +                        * everything from start to the next slash
809 +                        * this is important for check-local = "disable"
810 +                        *
811 +                        * if prefix = /admin.fcgi
812 +                        *
813 +                        * /admin.fcgi/foo/bar
814 +                        *
815 +                        * SCRIPT_NAME = /admin.fcgi
816 +                        * PATH_INFO   = /foo/bar
817 +                        *
818 +                        * if prefix = /fcgi-bin/
819 +                        *
820 +                        * /fcgi-bin/foo/bar
821 +                        *
822 +                        * SCRIPT_NAME = /fcgi-bin/foo
823 +                        * PATH_INFO   = /bar
824 +                        *
825 +                        */
826 +
827 +                       /* the rewrite is only done for /prefix/? matches */
828 +                       if (extension->key->ptr[0] == '/' &&
829 +                           con->uri.path->used > extension->key->used &&
830 +                           NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
831 +                               /* rewrite uri.path and pathinfo */
832 +
833 +                               buffer_copy_string(con->request.pathinfo, pathinfo);
834 +
835 +                               con->uri.path->used -= con->request.pathinfo->used - 1;
836 +                               con->uri.path->ptr[con->uri.path->used - 1] = '\0';
837 +                       } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
838 +                               buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
839 +                               con->uri.path->used = 1;
840 +                               con->uri.path->ptr[con->uri.path->used - 1] = '\0';
841 +                       }
842                 }
843         } else {
844 -               /* no handler found */
845 -               buffer_reset(con->physical.path);
846 -               con->http_status = 500;
847 +               handler_ctx *hctx;
848 +               hctx = handler_ctx_init();
849  
850 -               log_error_write(srv, __FILE__, __LINE__,  "sb",
851 -                               "no fcgi-handler found for:",
852 -                               fn);
853 +               hctx->remote_conn      = con;
854 +               hctx->plugin_data      = p;
855 +               hctx->host             = host;
856 +               hctx->proc             = NULL;
857  
858 -               return HANDLER_FINISHED;
859 +               hctx->conf.exts        = p->conf.exts;
860 +               hctx->conf.debug       = p->conf.debug;
861 +
862 +               con->plugin_ctx[p->id] = hctx;
863 +
864 +               host->load++;
865 +
866 +               con->mode = p->id;
867 +
868 +               if (con->conf.log_request_handling) {
869 +                       log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
870 +               }
871         }
872 +
873         return HANDLER_GO_ON;
874  }
875  
876 Index: src/lighttpd-angel.c
877 ===================================================================
878 --- src/lighttpd-angel.c        (.../tags/lighttpd-1.4.19)      (revision 2199)
879 +++ src/lighttpd-angel.c        (.../branches/lighttpd-1.4.x)   (revision 2199)
880 @@ -28,9 +28,12 @@
881  static volatile sig_atomic_t graceful_restart = 0;
882  static volatile pid_t pid = -1;
883  
884 +#define UNUSED(x) ( (void)(x) )
885 +
886  static void sigaction_handler(int sig, siginfo_t *si, void *context) {
887         int exitcode;
888  
889 +       UNUSED(context);
890         switch (sig) {
891         case SIGINT: 
892         case SIGTERM:
893 @@ -60,6 +63,8 @@
894         int is_shutdown = 0;
895         struct sigaction act;
896  
897 +       UNUSED(argc);
898 +
899         /**
900          * we are running as root BEWARE
901          */
902 Index: src/mod_rrdtool.c
903 ===================================================================
904 --- src/mod_rrdtool.c   (.../tags/lighttpd-1.4.19)      (revision 2199)
905 +++ src/mod_rrdtool.c   (.../branches/lighttpd-1.4.x)   (revision 2199)
906 @@ -148,6 +148,8 @@
907                 args[i++] = dash;
908                 args[i++] = NULL;
909  
910 +               openDevNull(STDERR_FILENO);
911 +       
912                 /* we don't need the client socket */
913                 for (i = 3; i < 256; i++) {
914                         close(i);
915 @@ -156,7 +158,7 @@
916                 /* exec the cgi */
917                 execv(args[0], args);
918  
919 -               log_error_write(srv, __FILE__, __LINE__, "sss", "spawing rrdtool failed: ", strerror(errno), args[0]);
920 +               /* log_error_write(srv, __FILE__, __LINE__, "sss", "spawing rrdtool failed: ", strerror(errno), args[0]); */
921  
922                 /* */
923                 SEGFAULT();
924 Index: src/response.c
925 ===================================================================
926 --- src/response.c      (.../tags/lighttpd-1.4.19)      (revision 2199)
927 +++ src/response.c      (.../branches/lighttpd-1.4.x)   (revision 2199)
928 @@ -101,7 +101,7 @@
929         if (!have_server) {
930                 if (buffer_is_empty(con->conf.server_tag)) {
931                         BUFFER_APPEND_STRING_CONST(b, "\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION);
932 -               } else {
933 +               } else if (con->conf.server_tag->used > 1) {
934                         BUFFER_APPEND_STRING_CONST(b, "\r\nServer: ");
935                         buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);
936                 }
937 @@ -152,7 +152,7 @@
938                  *  */
939  
940                 config_cond_cache_reset(srv, con);
941 -               config_setup_connection(srv, con); // Perhaps this could be removed at other places.
942 +               config_setup_connection(srv, con); /* Perhaps this could be removed at other places. */
943  
944                 if (con->conf.log_condition_handling) {
945                         log_error_write(srv, __FILE__, __LINE__,  "s",  "run condition");
946 Index: src/plugin.c
947 ===================================================================
948 --- src/plugin.c        (.../tags/lighttpd-1.4.19)      (revision 2199)
949 +++ src/plugin.c        (.../branches/lighttpd-1.4.x)   (revision 2199)
950 @@ -197,7 +197,7 @@
951  
952  #else
953  #if 1
954 -               init = (int (*)(plugin *))dlsym(p->lib, srv->tmp_buf->ptr);
955 +               init = (int (*)(plugin *))(intptr_t)dlsym(p->lib, srv->tmp_buf->ptr);
956  #else
957                 *(void **)(&init) = dlsym(p->lib, srv->tmp_buf->ptr);
958  #endif
959 Index: src/SConscript
960 ===================================================================
961 --- src/SConscript      (.../tags/lighttpd-1.4.19)      (revision 2199)
962 +++ src/SConscript      (.../branches/lighttpd-1.4.x)   (revision 2199)
963 @@ -43,6 +43,7 @@
964         'mod_cgi' : { 'src' : [ 'mod_cgi.c' ] },
965         'mod_fastcgi' : { 'src' : [ 'mod_fastcgi.c' ] },
966         'mod_scgi' : { 'src' : [ 'mod_scgi.c' ] },
967 +       'mod_extforward' : { 'src' : [ 'mod_extforward.c' ] },
968         'mod_staticfile' : { 'src' : [ 'mod_staticfile.c' ] },
969         'mod_dirlisting' : { 'src' : [ 'mod_dirlisting.c' ], 'lib' : [ env['LIBPCRE'] ] },
970         'mod_indexfile' : { 'src' : [ 'mod_indexfile.c' ] },
971 Index: src/mod_extforward.c
972 ===================================================================
973 --- src/mod_extforward.c        (.../tags/lighttpd-1.4.19)      (revision 2199)
974 +++ src/mod_extforward.c        (.../branches/lighttpd-1.4.x)   (revision 2199)
975 @@ -281,8 +281,9 @@
976  static const char *last_not_in_array(array *a, plugin_data *p)
977  {
978         array *forwarder = p->conf.forwarder;
979 +       int i;
980  
981 -       for (int i = a->used - 1; i >= 0; i--) {
982 +       for (i = a->used - 1; i >= 0; i--) {
983                 data_string *ds = (data_string *)a->data[i];
984                 const char *ip = ds->value->ptr;
985  
986 Index: src/Makefile.am
987 ===================================================================
988 --- src/Makefile.am     (.../tags/lighttpd-1.4.19)      (revision 2199)
989 +++ src/Makefile.am     (.../branches/lighttpd-1.4.x)   (revision 2199)
990 @@ -16,20 +16,17 @@
991  configparser.c configparser.h:
992  mod_ssi_exprparser.c mod_ssi_exprparser.h:
993  else
994 -$(srcdir)/configparser.y: lemon
995 -$(srcdir)/mod_ssi_exprparser.y: lemon
996 -
997 -configparser.c configparser.h: $(srcdir)/configparser.y
998 +configparser.c configparser.h: lemon $(srcdir)/configparser.y $(srcdir)/lempar.c
999         rm -f configparser.h
1000         $(LEMON) -q $(srcdir)/configparser.y $(srcdir)/lempar.c
1001  
1002 -mod_ssi_exprparser.c mod_ssi_exprparser.h: $(srcdir)/mod_ssi_exprparser.y
1003 +mod_ssi_exprparser.c mod_ssi_exprparser.h: lemon $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
1004         rm -f mod_ssi_exprparser.h
1005         $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
1006  endif
1007  
1008 -$(srcdir)/configfile.c: configparser.h
1009 -$(srcdir)/mod_ssi_expr.c: mod_ssi_exprparser.h
1010 +configfile.o: configparser.h
1011 +mod_ssi_expr.o: mod_ssi_exprparser.h
1012  
1013  common_src=buffer.c log.c \
1014        keyvalue.c chunk.c  \
1015 Index: src/network_openssl.c
1016 ===================================================================
1017 --- src/network_openssl.c       (.../tags/lighttpd-1.4.19)      (revision 2199)
1018 +++ src/network_openssl.c       (.../branches/lighttpd-1.4.x)   (revision 2199)
1019 @@ -85,6 +85,7 @@
1020                          *
1021                          */
1022  
1023 +                       ERR_clear_error();
1024                         if ((r = SSL_write(ssl, offset, toSend)) <= 0) {
1025                                 unsigned long err;
1026  
1027 @@ -187,6 +188,7 @@
1028  
1029                                 close(ifd);
1030  
1031 +                               ERR_clear_error();
1032                                 if ((r = SSL_write(ssl, s, toSend)) <= 0) {
1033                                         unsigned long err;
1034  
1035 Index: src/mod_redirect.c
1036 ===================================================================
1037 --- src/mod_redirect.c  (.../tags/lighttpd-1.4.19)      (revision 2199)
1038 +++ src/mod_redirect.c  (.../branches/lighttpd-1.4.x)   (revision 2199)
1039 @@ -215,8 +215,7 @@
1040  
1041                         start = 0; end = pattern_len;
1042                         for (k = 0; k < pattern_len; k++) {
1043 -                               if ((pattern[k] == '$' || pattern[k] == '%') &&
1044 -                                   isdigit((unsigned char)pattern[k + 1])) {
1045 +                               if (pattern[k] == '$' || pattern[k] == '%') {
1046                                         /* got one */
1047  
1048                                         size_t num = pattern[k + 1] - '0';
1049 @@ -225,7 +224,10 @@
1050  
1051                                         buffer_append_string_len(p->location, pattern + start, end - start);
1052  
1053 -                                       if (pattern[k] == '$') {
1054 +                                       if (!isdigit((unsigned char)pattern[k + 1])) {
1055 +                                               /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
1056 +                                               buffer_append_string_len(p->location, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
1057 +                                       } else if (pattern[k] == '$') {
1058                                                 /* n is always > 0 */
1059                                                 if (num < (size_t)n) {
1060                                                         buffer_append_string(p->location, list[num]);
1061 Index: src/mod_webdav.c
1062 ===================================================================
1063 --- src/mod_webdav.c    (.../tags/lighttpd-1.4.19)      (revision 2199)
1064 +++ src/mod_webdav.c    (.../branches/lighttpd-1.4.x)   (revision 2199)
1065 @@ -570,6 +570,8 @@
1066                                 /* */
1067                         }
1068                 }
1069 +#else
1070 +               UNUSED(p);
1071  #endif
1072         }
1073  
1074 @@ -730,6 +732,8 @@
1075                         }
1076                 }
1077         }
1078 +#else
1079 +       UNUSED(p);
1080  #endif
1081         return status;
1082  }
1083 @@ -1154,6 +1158,7 @@
1084         int has_lock = 1;
1085  
1086  #ifdef USE_LOCKS
1087 +       UNUSED(srv);
1088         data_string *ds;
1089  
1090         /**
1091 @@ -1192,6 +1197,11 @@
1092                         has_lock = 0;
1093                 }
1094         }
1095 +#else
1096 +       UNUSED(srv);
1097 +       UNUSED(con);
1098 +       UNUSED(p);
1099 +       UNUSED(uri);
1100  #endif
1101  
1102         return has_lock;
1103 Index: src/md5.c
1104 ===================================================================
1105 --- src/md5.c   (.../tags/lighttpd-1.4.19)      (revision 2199)
1106 +++ src/md5.c   (.../branches/lighttpd-1.4.x)   (revision 2199)
1107 @@ -52,9 +52,9 @@
1108  #define S43 15
1109  #define S44 21
1110  
1111 -static void MD5Transform (UINT4 [4], unsigned char [64]);
1112 +static void MD5Transform (UINT4 [4], const unsigned char [64]);
1113  static void Encode (unsigned char *, UINT4 *, unsigned int);
1114 -static void Decode (UINT4 *, unsigned char *, unsigned int);
1115 +static void Decode (UINT4 *, const unsigned char *, unsigned int);
1116  
1117  #ifdef HAVE_MEMCPY
1118  #define MD5_memcpy(output, input, len) memcpy((output), (input), (len))
1119 @@ -126,12 +126,13 @@
1120    operation, processing another message block, and updating the
1121    context.
1122   */
1123 -void MD5_Update (context, input, inputLen)
1124 +void MD5_Update (context, _input, inputLen)
1125  MD5_CTX *context;                                        /* context */
1126 -unsigned char *input;                                /* input block */
1127 +const void *_input;                                /* input block */
1128  unsigned int inputLen;                     /* length of input block */
1129  {
1130    unsigned int i, ndx, partLen;
1131 +  const unsigned char *input = (const unsigned char*) _input;
1132  
1133    /* Compute number of bytes mod 64 */
1134    ndx = (unsigned int)((context->count[0] >> 3) & 0x3F);
1135 @@ -200,7 +201,7 @@
1136   */
1137  static void MD5Transform (state, block)
1138  UINT4 state[4];
1139 -unsigned char block[64];
1140 +const unsigned char block[64];
1141  {
1142    UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
1143  
1144 @@ -313,7 +314,7 @@
1145   */
1146  static void Decode (output, input, len)
1147  UINT4 *output;
1148 -unsigned char *input;
1149 +const unsigned char *input;
1150  unsigned int len;
1151  {
1152    unsigned int i, j;
1153 Index: src/mod_compress.c
1154 ===================================================================
1155 --- src/mod_compress.c  (.../tags/lighttpd-1.4.19)      (revision 2199)
1156 +++ src/mod_compress.c  (.../branches/lighttpd-1.4.x)   (revision 2199)
1157 @@ -102,7 +102,7 @@
1158         return HANDLER_GO_ON;
1159  }
1160  
1161 -// 0 on success, -1 for error
1162 +/* 0 on success, -1 for error */
1163  int mkdir_recursive(char *dir) {
1164         char *p = dir;
1165  
1166 @@ -118,13 +118,13 @@
1167                 }
1168  
1169                 *p++ = '/';
1170 -               if (!*p) return 0; // Ignore trailing slash
1171 +               if (!*p) return 0; /* Ignore trailing slash */
1172         }
1173  
1174         return (mkdir(dir, 0700) != 0) && (errno != EEXIST) ? -1 : 0;
1175  }
1176  
1177 -// 0 on success, -1 for error
1178 +/* 0 on success, -1 for error */
1179  int mkdir_for_file(char *filename) {
1180         char *p = filename;
1181  
1182 @@ -140,7 +140,7 @@
1183                 }
1184  
1185                 *p++ = '/';
1186 -               if (!*p) return -1; // Unexpected trailing slash in filename
1187 +               if (!*p) return -1; /* Unexpected trailing slash in filename */
1188         }
1189  
1190         return 0;
1191 @@ -178,9 +178,9 @@
1192                 }
1193  
1194                 if (!buffer_is_empty(s->compress_cache_dir)) {
1195 +                       struct stat st;
1196                         mkdir_recursive(s->compress_cache_dir->ptr);
1197  
1198 -                       struct stat st;
1199                         if (0 != stat(s->compress_cache_dir->ptr, &st)) {
1200                                 log_error_write(srv, __FILE__, __LINE__, "sbs", "can't stat compress.cache-dir",
1201                                                 s->compress_cache_dir, strerror(errno));
1202 Index: src/md5.h
1203 ===================================================================
1204 --- src/md5.h   (.../tags/lighttpd-1.4.19)      (revision 2199)
1205 +++ src/md5.h   (.../branches/lighttpd-1.4.x)   (revision 2199)
1206 @@ -42,6 +42,6 @@
1207  } MD5_CTX;
1208  
1209  void MD5_Init (MD5_CTX *);
1210 -void MD5_Update (MD5_CTX *, unsigned char *, unsigned int);
1211 +void MD5_Update (MD5_CTX *, const void *, unsigned int);
1212  void MD5_Final (unsigned char [16], MD5_CTX *);
1213  
1214 Index: src/spawn-fcgi.c
1215 ===================================================================
1216 --- src/spawn-fcgi.c    (.../tags/lighttpd-1.4.19)      (revision 2199)
1217 +++ src/spawn-fcgi.c    (.../branches/lighttpd-1.4.x)   (revision 2199)
1218 @@ -37,9 +37,9 @@
1219  #endif
1220  
1221  #ifdef HAVE_SYS_UN_H
1222 -int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int child_count, int pid_fd, int nofork) {
1223 +int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) {
1224         int fcgi_fd;
1225 -       int socket_type, status;
1226 +       int socket_type, status, rc = 0;
1227         struct timeval tv = { 0, 100 * 1000 };
1228  
1229         struct sockaddr_un fcgi_addr_un;
1230 @@ -48,9 +48,6 @@
1231  
1232         socklen_t servlen;
1233  
1234 -       pid_t child;
1235 -       int val;
1236 -
1237         if (child_count < 2) {
1238                 child_count = 5;
1239         }
1240 @@ -74,25 +71,6 @@
1241  #endif
1242                 socket_type = AF_UNIX;
1243                 fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
1244 -
1245 -               /* check if some backend is listening on the socket
1246 -                * as if we delete the socket-file and rebind there will be no "socket already in use" error
1247 -                */
1248 -               if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
1249 -                       fprintf(stderr, "%s.%d\n",
1250 -                               __FILE__, __LINE__);
1251 -                       return -1;
1252 -               }
1253 -
1254 -               if (-1 != connect(fcgi_fd, fcgi_addr, servlen)) {
1255 -                       fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
1256 -                               __FILE__, __LINE__);
1257 -                       return -1;
1258 -               }
1259 -
1260 -               /* cleanup previous socket if it exists */
1261 -               unlink(unixsocket);
1262 -               close(fcgi_fd);
1263         } else {
1264                 fcgi_addr_in.sin_family = AF_INET;
1265                  if (addr != NULL) {
1266 @@ -107,133 +85,176 @@
1267                 fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
1268         }
1269  
1270 -       /* open socket */
1271         if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
1272                 fprintf(stderr, "%s.%d\n",
1273                         __FILE__, __LINE__);
1274                 return -1;
1275         }
1276  
1277 -       val = 1;
1278 -       if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
1279 -               fprintf(stderr, "%s.%d\n",
1280 -                       __FILE__, __LINE__);
1281 -               return -1;
1282 -       }
1283 +       if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
1284 +               /* server is not up, spawn in  */
1285 +               pid_t child;
1286 +               int val;
1287  
1288 -       /* create socket */
1289 -       if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
1290 -               fprintf(stderr, "%s.%d: bind failed: %s\n",
1291 -                       __FILE__, __LINE__,
1292 -                       strerror(errno));
1293 -               return -1;
1294 -       }
1295 +               if (unixsocket) unlink(unixsocket);
1296  
1297 -       if (-1 == listen(fcgi_fd, 1024)) {
1298 -               fprintf(stderr, "%s.%d: fd = -1\n",
1299 -                       __FILE__, __LINE__);
1300 -               return -1;
1301 -       }
1302 +               close(fcgi_fd);
1303  
1304 -       if (!nofork) {
1305 -               child = fork();
1306 -       } else {
1307 -               child = 0;
1308 -       }
1309 +               /* reopen socket */
1310 +               if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
1311 +                       fprintf(stderr, "%s.%d\n",
1312 +                               __FILE__, __LINE__);
1313 +                       return -1;
1314 +               }
1315  
1316 -       switch (child) {
1317 -       case 0: {
1318 -               char cgi_childs[64];
1319 +               val = 1;
1320 +               if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
1321 +                       fprintf(stderr, "%s.%d\n",
1322 +                               __FILE__, __LINE__);
1323 +                       return -1;
1324 +               }
1325  
1326 -               int i = 0;
1327 -
1328 -               /* is safe as we limit to 256 childs */
1329 -               sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
1330 -
1331 -               if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
1332 -                       close(FCGI_LISTENSOCK_FILENO);
1333 -                       dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
1334 -                       close(fcgi_fd);
1335 +               /* create socket */
1336 +               if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
1337 +                       fprintf(stderr, "%s.%d: bind failed: %s\n",
1338 +                               __FILE__, __LINE__,
1339 +                               strerror(errno));
1340 +                       return -1;
1341                 }
1342  
1343 -               /* we don't need the client socket */
1344 -               for (i = 3; i < 256; i++) {
1345 -                       close(i);
1346 +               if (-1 == listen(fcgi_fd, 1024)) {
1347 +                       fprintf(stderr, "%s.%d: fd = -1\n",
1348 +                               __FILE__, __LINE__);
1349 +                       return -1;
1350                 }
1351  
1352 -               /* create environment */
1353 +               while (fork_count-- > 0) {
1354  
1355 -               putenv(cgi_childs);
1356 +                       if (!nofork) {
1357 +                               child = fork();
1358 +                       } else {
1359 +                               child = 0;
1360 +                       }
1361  
1362 -               /* fork and replace shell */
1363 -               if (appArgv) {
1364 -                       execv(appArgv[0], appArgv);
1365 +                       switch (child) {
1366 +                       case 0: {
1367 +                               char cgi_childs[64];
1368 +                               int max_fd = 0;
1369  
1370 -               } else {
1371 -                       char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
1372 -                       strcpy(b, "exec ");
1373 -                       strcat(b, appPath);
1374 +                               int i = 0;
1375  
1376 -                       /* exec the cgi */
1377 -                       execl("/bin/sh", "sh", "-c", b, (char *)NULL);
1378 -               }
1379 +                               /* loose control terminal */
1380 +                               setsid();
1381  
1382 -               exit(errno);
1383 +                               /* is safe as we limit to 256 childs */
1384 +                               sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
1385  
1386 -               break;
1387 -       }
1388 -       case -1:
1389 -               /* error */
1390 -               break;
1391 -       default:
1392 -               /* father */
1393 +                               if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
1394 +                                       close(FCGI_LISTENSOCK_FILENO);
1395 +                                       dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
1396 +                                       close(fcgi_fd);
1397 +                               }
1398  
1399 -               /* wait */
1400 -               select(0, NULL, NULL, NULL, &tv);
1401 +                               max_fd = open("/dev/null", O_RDWR);
1402 +                               close(STDERR_FILENO);
1403 +                               dup2(max_fd, STDERR_FILENO);
1404 +                               close(max_fd);
1405  
1406 -               switch (waitpid(child, &status, WNOHANG)) {
1407 -               case 0:
1408 -                       fprintf(stderr, "%s.%d: child spawned successfully: PID: %d\n",
1409 -                               __FILE__, __LINE__,
1410 -                               child);
1411 +                               max_fd = open("/dev/null", O_RDWR);
1412 +                               close(STDOUT_FILENO);
1413 +                               dup2(max_fd, STDOUT_FILENO);
1414 +                               close(max_fd);
1415  
1416 -                       /* write pid file */
1417 -                       if (pid_fd != -1) {
1418 -                               /* assume a 32bit pid_t */
1419 -                               char pidbuf[12];
1420 +                               /* we don't need the client socket */
1421 +                               for (i = 3; i < max_fd; i++) {
1422 +                                       if (i != FCGI_LISTENSOCK_FILENO) close(i);
1423 +                               }
1424  
1425 -                               snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
1426 +                               /* create environment */
1427  
1428 -                               write(pid_fd, pidbuf, strlen(pidbuf));
1429 -                               close(pid_fd);
1430 -                               pid_fd = -1;
1431 +                               putenv(cgi_childs);
1432 +
1433 +                               /* fork and replace shell */
1434 +                               if (appArgv) {
1435 +                                       execv(appArgv[0], appArgv);
1436 +
1437 +                               } else {
1438 +                                       char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
1439 +                                       strcpy(b, "exec ");
1440 +                                       strcat(b, appPath);
1441 +
1442 +                                       /* exec the cgi */
1443 +                                       execl("/bin/sh", "sh", "-c", b, (char *)NULL);
1444 +                               }
1445 +
1446 +                               exit(errno);
1447 +
1448 +                               break;
1449                         }
1450 +                       case -1:
1451 +                               /* error */
1452 +                               break;
1453 +                       default:
1454 +                               /* father */
1455  
1456 -                       break;
1457 -               case -1:
1458 -                       break;
1459 -               default:
1460 -                       if (WIFEXITED(status)) {
1461 -                               fprintf(stderr, "%s.%d: child exited with: %d, %s\n",
1462 -                                       __FILE__, __LINE__,
1463 -                                       WEXITSTATUS(status), strerror(WEXITSTATUS(status)));
1464 -                       } else if (WIFSIGNALED(status)) {
1465 -                               fprintf(stderr, "%s.%d: child signaled: %d\n",
1466 -                                       __FILE__, __LINE__,
1467 -                                       WTERMSIG(status));
1468 -                       } else {
1469 -                               fprintf(stderr, "%s.%d: child died somehow: %d\n",
1470 -                                       __FILE__, __LINE__,
1471 -                                       status);
1472 +                               /* wait */
1473 +                               select(0, NULL, NULL, NULL, &tv);
1474 +
1475 +                               switch (waitpid(child, &status, WNOHANG)) {
1476 +                               case 0:
1477 +                                       fprintf(stdout, "%s.%d: child spawned successfully: PID: %d\n",
1478 +                                               __FILE__, __LINE__,
1479 +                                               child);
1480 +
1481 +                                       /* write pid file */
1482 +                                       if (pid_fd != -1) {
1483 +                                               /* assume a 32bit pid_t */
1484 +                                               char pidbuf[12];
1485 +
1486 +                                               snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
1487 +
1488 +                                               write(pid_fd, pidbuf, strlen(pidbuf));
1489 +                                               /* avoid eol for the last one */
1490 +                                               if (fork_count != 0) {
1491 +                                                       write(pid_fd, "\n", 1);
1492 +                                               }
1493 +                                       }
1494 +
1495 +                                       break;
1496 +                               case -1:
1497 +                                       break;
1498 +                               default:
1499 +                                       if (WIFEXITED(status)) {
1500 +                                               fprintf(stderr, "%s.%d: child exited with: %d\n",
1501 +                                                       __FILE__, __LINE__, WEXITSTATUS(status));
1502 +                                               rc = WEXITSTATUS(status);
1503 +                                       } else if (WIFSIGNALED(status)) {
1504 +                                               fprintf(stderr, "%s.%d: child signaled: %d\n",
1505 +                                                       __FILE__, __LINE__,
1506 +                                                       WTERMSIG(status));
1507 +                                               rc = 1;
1508 +                                       } else {
1509 +                                               fprintf(stderr, "%s.%d: child died somehow: %d\n",
1510 +                                                       __FILE__, __LINE__,
1511 +                                                       status);
1512 +                                               rc = status;
1513 +                                       }
1514 +                               }
1515 +
1516 +                               break;
1517                         }
1518                 }
1519 -
1520 -               break;
1521 +               close(pid_fd);
1522 +               pid_fd = -1;
1523 +       } else {
1524 +               fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
1525 +                       __FILE__, __LINE__);
1526 +               return -1;
1527         }
1528  
1529         close(fcgi_fd);
1530  
1531 -       return 0;
1532 +       return rc;
1533  }
1534  
1535  
1536 @@ -256,6 +277,7 @@
1537  " -p <port>    bind to tcp-port\n" \
1538  " -s <path>    bind to unix-domain socket\n" \
1539  " -C <childs>  (PHP only) numbers of childs to spawn (default 5)\n" \
1540 +" -F <childs>  numbers of childs to fork (default 1)\n" \
1541  " -P <path>    name of PID-file for spawed process\n" \
1542  " -n           no fork (for daemontools)\n" \
1543  " -v           show version\n" \
1544 @@ -276,20 +298,21 @@
1545         char **fcgi_app_argv = { NULL };
1546         unsigned short port = 0;
1547         int child_count = 5;
1548 +       int fork_count = 1;
1549         int i_am_root, o;
1550         int pid_fd = -1;
1551         int nofork = 0;
1552         struct sockaddr_un un;
1553 -       const size_t sun_path_len = sizeof(un.sun_path);
1554  
1555         i_am_root = (getuid() == 0);
1556  
1557 -       while(-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:s:P:"))) {
1558 +       while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) {
1559                 switch(o) {
1560                 case 'f': fcgi_app = optarg; break;
1561                 case 'a': addr = optarg;/* ip addr */ break;
1562                 case 'p': port = strtol(optarg, NULL, 10);/* port */ break;
1563                 case 'C': child_count = strtol(optarg, NULL, 10);/*  */ break;
1564 +               case 'F': fork_count = strtol(optarg, NULL, 10);/*  */ break;
1565                 case 's': unixsocket = optarg; /* unix-domain socket */ break;
1566                 case 'c': if (i_am_root) { changeroot = optarg; }/* chroot() */ break;
1567                 case 'u': if (i_am_root) { username = optarg; } /* set user */ break;
1568 @@ -321,7 +344,7 @@
1569                 return -1;
1570         }
1571  
1572 -       if (unixsocket && strlen(unixsocket) > sun_path_len - 1) {
1573 +       if (unixsocket && strlen(unixsocket) > sizeof(un.sun_path) - 1) {
1574                 fprintf(stderr, "%s.%d: %s\n",
1575                         __FILE__, __LINE__,
1576                         "path of the unix socket is too long\n");
1577 @@ -416,18 +439,15 @@
1578                                         "I will not set gid to 0\n");
1579                                 return -1;
1580                         }
1581 -               }
1582  
1583 -               /*
1584 -                * Change group before chroot, when we have access
1585 -                * to /etc/group
1586 -                */
1587 -               if (groupname) {
1588 +                       /* do the change before we do the chroot() */
1589                         setgid(grp->gr_gid);
1590 -                       setgroups(0, NULL);
1591 +                       setgroups(0, NULL); 
1592 +
1593                         if (username) {
1594                                 initgroups(username, grp->gr_gid);
1595                         }
1596 +
1597                 }
1598  
1599                 if (changeroot) {
1600 @@ -451,7 +471,7 @@
1601                 }
1602         }
1603  
1604 -       return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, child_count, pid_fd, nofork);
1605 +       return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork);
1606  }
1607  #else
1608  int main() {
1609 Index: src/mod_auth.c
1610 ===================================================================
1611 --- src/mod_auth.c      (.../tags/lighttpd-1.4.19)      (revision 2199)
1612 +++ src/mod_auth.c      (.../branches/lighttpd-1.4.x)   (revision 2199)
1613 @@ -519,85 +519,86 @@
1614  
1615  handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s) {
1616  #ifdef USE_LDAP
1617 -                       int ret;
1618 +       int ret;
1619  #if 0
1620 -                       if (s->auth_ldap_basedn->used == 0) {
1621 -                               log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.base-dn has to be set");
1622 +       if (s->auth_ldap_basedn->used == 0) {
1623 +               log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.base-dn has to be set");
1624  
1625 -                               return HANDLER_ERROR;
1626 -                       }
1627 +               return HANDLER_ERROR;
1628 +       }
1629  #endif
1630  
1631 -                       if (s->auth_ldap_filter->used) {
1632 -                               char *dollar;
1633 +       if (s->auth_ldap_filter->used) {
1634 +               char *dollar;
1635  
1636 -                               /* parse filter */
1637 +               /* parse filter */
1638  
1639 -                               if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) {
1640 -                                       log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'");
1641 +               if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) {
1642 +                       log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'");
1643  
1644 -                                       return HANDLER_ERROR;
1645 -                               }
1646 +                       return HANDLER_ERROR;
1647 +               }
1648  
1649 -                               buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr);
1650 -                               buffer_copy_string(s->ldap_filter_post, dollar+1);
1651 -                       }
1652 +               buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr);
1653 +               buffer_copy_string(s->ldap_filter_post, dollar+1);
1654 +       }
1655  
1656 -                       if (s->auth_ldap_hostname->used) {
1657 -                               if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
1658 -                                       log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
1659 +       if (s->auth_ldap_hostname->used) {
1660 +               if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
1661 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
1662  
1663 -                                       return HANDLER_ERROR;
1664 -                               }
1665 +                       return HANDLER_ERROR;
1666 +               }
1667  
1668 -                               ret = LDAP_VERSION3;
1669 -                               if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(s->ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) {
1670 -                                       log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
1671 +               ret = LDAP_VERSION3;
1672 +               if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(s->ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) {
1673 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
1674  
1675 +                       return HANDLER_ERROR;
1676 +               }
1677 +
1678 +               if (s->auth_ldap_starttls) {
1679 +                       /* if no CA file is given, it is ok, as we will use encryption
1680 +                               * if the server requires a CAfile it will tell us */
1681 +                       if (!buffer_is_empty(s->auth_ldap_cafile)) {
1682 +                               if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE,
1683 +                                                               s->auth_ldap_cafile->ptr))) {
1684 +                                       log_error_write(srv, __FILE__, __LINE__, "ss",
1685 +                                                       "Loading CA certificate failed:", ldap_err2string(ret));
1686 +
1687                                         return HANDLER_ERROR;
1688                                 }
1689 +                       }
1690  
1691 -                               if (s->auth_ldap_starttls) {
1692 -                                       /* if no CA file is given, it is ok, as we will use encryption
1693 -                                        * if the server requires a CAfile it will tell us */
1694 -                                       if (!buffer_is_empty(s->auth_ldap_cafile)) {
1695 -                                               if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE,
1696 -                                                                               s->auth_ldap_cafile->ptr))) {
1697 -                                                       log_error_write(srv, __FILE__, __LINE__, "ss",
1698 -                                                                       "Loading CA certificate failed:", ldap_err2string(ret));
1699 +                       if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(s->ldap, NULL,  NULL))) {
1700 +                               log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret));
1701  
1702 -                                                       return HANDLER_ERROR;
1703 -                                               }
1704 -                                       }
1705 +                               return HANDLER_ERROR;
1706 +                       }
1707 +               }
1708  
1709 -                                       if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(s->ldap, NULL,  NULL))) {
1710 -                                               log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret));
1711  
1712 -                                               return HANDLER_ERROR;
1713 -                                       }
1714 -                               }
1715 +               /* 1. */
1716 +               if (s->auth_ldap_binddn->used) {
1717 +                       if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, s->auth_ldap_binddn->ptr, s->auth_ldap_bindpw->ptr))) {
1718 +                               log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
1719  
1720 +                               return HANDLER_ERROR;
1721 +                       }
1722 +               } else {
1723 +                       if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, NULL, NULL))) {
1724 +                               log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
1725  
1726 -                               /* 1. */
1727 -                               if (s->auth_ldap_binddn->used) {
1728 -                                       if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, s->auth_ldap_binddn->ptr, s->auth_ldap_bindpw->ptr))) {
1729 -                                               log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
1730 -
1731 -                                               return HANDLER_ERROR;
1732 -                                       }
1733 -                               } else {
1734 -                                       if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, NULL, NULL))) {
1735 -                                               log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
1736 -
1737 -                                               return HANDLER_ERROR;
1738 -                                       }
1739 -                               }
1740 +                               return HANDLER_ERROR;
1741                         }
1742 +               }
1743 +       }
1744 +       return HANDLER_GO_ON;
1745  #else
1746 -                       log_error_write(srv, __FILE__, __LINE__, "s", "no ldap support available");
1747 -                       return HANDLER_ERROR;
1748 +       UNUSED(s);
1749 +       log_error_write(srv, __FILE__, __LINE__, "s", "no ldap support available");
1750 +       return HANDLER_ERROR;
1751  #endif
1752 -               return HANDLER_GO_ON;
1753  }
1754  
1755  int mod_auth_plugin_init(plugin *p) {
1756 Index: src/mod_fastcgi.c
1757 ===================================================================
1758 --- src/mod_fastcgi.c   (.../tags/lighttpd-1.4.19)      (revision 2199)
1759 +++ src/mod_fastcgi.c   (.../branches/lighttpd-1.4.x)   (revision 2199)
1760 @@ -236,6 +236,16 @@
1761         unsigned short break_scriptfilename_for_php;
1762  
1763         /*
1764 +        * workaround for program when prefix="/"
1765 +        *
1766 +        * rule to build PATH_INFO is hardcoded for when check_local is disabled
1767 +        * enable this option to use the workaround
1768 +        *
1769 +        */
1770 +
1771 +       unsigned short fix_root_path_name;
1772 +
1773 +       /*
1774          * If the backend includes X-LIGHTTPD-send-file in the response
1775          * we use the value as filename and ignore the content.
1776          *
1777 @@ -937,6 +947,8 @@
1778                                 close(fcgi_fd);
1779                         }
1780  
1781 +                       openDevNull(STDERR_FILENO);
1782 +
1783                         /* we don't need the client socket */
1784                         for (i = 3; i < 256; i++) {
1785                                 close(i);
1786 @@ -1000,8 +1012,8 @@
1787                         /* exec the cgi */
1788                         execve(arg.ptr[0], arg.ptr, env.ptr);
1789  
1790 -                       log_error_write(srv, __FILE__, __LINE__, "sbs",
1791 -                                       "execve failed for:", host->bin_path, strerror(errno));
1792 +                       /* log_error_write(srv, __FILE__, __LINE__, "sbs",
1793 +                                       "execve failed for:", host->bin_path, strerror(errno)); */
1794  
1795                         exit(errno);
1796  
1797 @@ -1193,6 +1205,7 @@
1798                                                 { "allow-x-send-file",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },      /* 15 */
1799                                                 { "strip-request-uri",  NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },      /* 16 */
1800                                                 { "kill-signal",        NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },      /* 17 */
1801 +                                               { "fix-root-scriptname",   NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },  /* 18 */
1802  
1803                                                 { NULL,                NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
1804                                         };
1805 @@ -1220,6 +1233,7 @@
1806                                         host->break_scriptfilename_for_php = 0;
1807                                         host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */
1808                                         host->kill_signal = SIGTERM;
1809 +                                       host->fix_root_path_name = 0;
1810  
1811                                         fcv[0].destination = host->host;
1812                                         fcv[1].destination = host->docroot;
1813 @@ -1241,6 +1255,7 @@
1814                                         fcv[15].destination = &(host->allow_xsendfile);
1815                                         fcv[16].destination = host->strip_request_uri;
1816                                         fcv[17].destination = &(host->kill_signal);
1817 +                                       fcv[18].destination = &(host->fix_root_path_name);
1818  
1819                                         if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
1820                                                 return HANDLER_ERROR;
1821 @@ -2544,7 +2559,10 @@
1822                                         stat_cache_entry *sce;
1823  
1824                                         if (HANDLER_ERROR != stat_cache_get_entry(srv, con, ds->value, &sce)) {
1825 -                                               data_string *dcls = data_string_init();
1826 +                                               data_string *dcls;
1827 +                                               if (NULL == (dcls = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
1828 +                                                       dcls = data_response_init();
1829 +                                               }
1830                                                 /* found */
1831                                                 http_chunk_append_file(srv, con, ds->value, 0, sce->st.st_size);
1832                                                 hctx->send_content_body = 0; /* ignore the content */
1833 @@ -3074,7 +3092,7 @@
1834  
1835                 /* check if the next server has no load. */
1836                 ndx = hctx->ext->last_used_ndx + 1;
1837 -               if(ndx >= hctx->ext->used || ndx < 0) ndx = 0;
1838 +               if(ndx >= (int) hctx->ext->used || ndx < 0) ndx = 0;
1839                 host = hctx->ext->hosts[ndx];
1840                 if (host->load > 0) {
1841                         /* get backend with the least load. */
1842 @@ -3480,13 +3498,12 @@
1843  
1844                         ct_len = extension->key->used - 1;
1845  
1846 -                       if (s_len < ct_len) continue;
1847 -
1848 -                       /* check extension in the form "/fcgi_pattern" */
1849 -                       if (*(extension->key->ptr) == '/') {
1850 -                               if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0)
1851 +                       /* check _url_ in the form "/fcgi_pattern" */
1852 +                       if (extension->key->ptr[0] == '/') {
1853 +                               if ((ct_len <= con->uri.path->used -1) &&
1854 +                                   (strncmp(con->uri.path->ptr, extension->key->ptr, ct_len) == 0))
1855                                         break;
1856 -                       } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
1857 +                       } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len))) {
1858                                 /* check extension in the form ".fcg" */
1859                                 break;
1860                         }
1861 @@ -3499,16 +3516,15 @@
1862  
1863         /* check if we have at least one server for this extension up and running */
1864         for (k = 0; k < extension->used; k++) {
1865 -               host = extension->hosts[k];
1866 +               fcgi_extension_host *h = extension->hosts[k];
1867  
1868                 /* we should have at least one proc that can do something */
1869 -               if (host->active_procs == 0) {
1870 -                       host = NULL;
1871 -
1872 +               if (h->active_procs == 0) {
1873                         continue;
1874                 }
1875  
1876                 /* we found one host that is alive */
1877 +               host = h;
1878                 break;
1879         }
1880  
1881 @@ -3582,6 +3598,13 @@
1882                          * SCRIPT_NAME = /fcgi-bin/foo
1883                          * PATH_INFO   = /bar
1884                          *
1885 +                        * if prefix = /, and fix-root-path-name is enable
1886 +                        *
1887 +                        * /fcgi-bin/foo/bar
1888 +                        *
1889 +                        * SCRIPT_NAME = /fcgi-bin/foo
1890 +                        * PATH_INFO   = /bar
1891 +                        *
1892                          */
1893  
1894                         /* the rewrite is only done for /prefix/? matches */
1895 @@ -3594,6 +3617,10 @@
1896  
1897                                 con->uri.path->used -= con->request.pathinfo->used - 1;
1898                                 con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1899 +                       } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1900 +                               buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1901 +                               con->uri.path->used = 1;
1902 +                               con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1903                         }
1904                 }
1905         } else {
1906 Index: src/mod_accesslog.c
1907 ===================================================================
1908 --- src/mod_accesslog.c (.../tags/lighttpd-1.4.19)      (revision 2199)
1909 +++ src/mod_accesslog.c (.../branches/lighttpd-1.4.x)   (revision 2199)
1910 @@ -473,7 +473,7 @@
1911                         continue;
1912                 }
1913  
1914 -               if (buffer_is_empty(s->access_logfile)) continue;
1915 +               if (s->access_logfile->used < 2) continue;
1916  
1917                 if (s->access_logfile->ptr[0] == '|') {
1918  #ifdef HAVE_FORK
1919 @@ -498,6 +498,8 @@
1920                                 /* not needed */
1921                                 close(to_log_fds[1]);
1922  
1923 +                               openDevNull(STDERR_FILENO);
1924 +
1925                                 /* we don't need the client socket */
1926                                 for (i = 3; i < 256; i++) {
1927                                         close(i);
1928 @@ -570,7 +572,7 @@
1929                 }
1930  
1931                 if (s->use_syslog == 0 &&
1932 -                   !buffer_is_empty(s->access_logfile) &&
1933 +                   s->access_logfile->used > 1 &&
1934                     s->access_logfile->ptr[0] != '|') {
1935  
1936                         close(s->log_access_fd);
1937 @@ -647,6 +649,9 @@
1938  
1939         mod_accesslog_patch_connection(srv, con, p);
1940  
1941 +       /* No output device, nothing to do */
1942 +       if (!p->conf.use_syslog && p->conf.log_access_fd == -1) return HANDLER_GO_ON;
1943 +
1944         b = p->conf.access_logbuffer;
1945         if (b->used == 0) {
1946                 buffer_copy_string(b, "");
1947 @@ -806,7 +811,14 @@
1948                                 buffer_append_string(b, "%");
1949                                 break;
1950                         case FORMAT_SERVER_PORT:
1951 -                               buffer_append_long(b, srv->srvconf.port);
1952 +                               {
1953 +                                       char *colon = strchr(((server_socket*)(con->srv_socket))->srv_token->ptr, ':');
1954 +                                       if (colon) {
1955 +                                               buffer_append_string(b, colon+1);
1956 +                                       } else {
1957 +                                               buffer_append_long(b, srv->srvconf.port);
1958 +                                       }
1959 +                               }
1960                                 break;
1961                         case FORMAT_QUERY_STRING:
1962                                 buffer_append_string_buffer(b, con->uri.query);
1963 Index: src/server.c
1964 ===================================================================
1965 --- src/server.c        (.../tags/lighttpd-1.4.19)      (revision 2199)
1966 +++ src/server.c        (.../branches/lighttpd-1.4.x)   (revision 2199)
1967 @@ -573,20 +573,9 @@
1968         }
1969  
1970         /* close stdin and stdout, as they are not needed */
1971 -       /* move stdin to /dev/null */
1972 -       if (-1 != (fd = open("/dev/null", O_RDONLY))) {
1973 -               close(STDIN_FILENO);
1974 -               dup2(fd, STDIN_FILENO);
1975 -               close(fd);
1976 -       }
1977 +       openDevNull(STDIN_FILENO);
1978 +       openDevNull(STDOUT_FILENO);
1979  
1980 -       /* move stdout to /dev/null */
1981 -       if (-1 != (fd = open("/dev/null", O_WRONLY))) {
1982 -               close(STDOUT_FILENO);
1983 -               dup2(fd, STDOUT_FILENO);
1984 -               close(fd);
1985 -       }
1986 -
1987         if (0 != config_set_defaults(srv)) {
1988                 log_error_write(srv, __FILE__, __LINE__, "s",
1989                                 "setting default values failed");
1990 @@ -893,8 +882,8 @@
1991                 pid_fd = -1;
1992         }
1993  
1994 -       // Close stderr ASAP in the child process to make sure that nothing
1995 -       // is being written to that fd which may not be valid anymore.
1996 +       /* Close stderr ASAP in the child process to make sure that nothing
1997 +        * is being written to that fd which may not be valid anymore. */
1998         if (-1 == log_error_open(srv)) {
1999                 log_error_write(srv, __FILE__, __LINE__, "s", "Opening errorlog failed. Going down.");
2000  
2001 Index: src/mod_dirlisting.c
2002 ===================================================================
2003 --- src/mod_dirlisting.c        (.../tags/lighttpd-1.4.19)      (revision 2199)
2004 +++ src/mod_dirlisting.c        (.../branches/lighttpd-1.4.x)   (revision 2199)
2005 @@ -841,11 +841,11 @@
2006  
2007         /* Insert possible charset to Content-Type */
2008         if (buffer_is_empty(p->conf.encoding)) {
2009 -               response_header_insert(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
2010 +               response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
2011         } else {
2012                 buffer_copy_string(p->content_charset, "text/html; charset=");
2013                 buffer_append_string_buffer(p->content_charset, p->conf.encoding);
2014 -               response_header_insert(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->content_charset));
2015 +               response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->content_charset));
2016         }
2017  
2018         con->file_finished = 1;
2019 Index: src/mod_magnet.c
2020 ===================================================================
2021 --- src/mod_magnet.c    (.../tags/lighttpd-1.4.19)      (revision 2199)
2022 +++ src/mod_magnet.c    (.../branches/lighttpd-1.4.x)   (revision 2199)
2023 @@ -414,10 +414,16 @@
2024         case MAGNET_ENV_URI_AUTHORITY: dest = con->uri.authority; break;
2025         case MAGNET_ENV_URI_QUERY: dest = con->uri.query; break;
2026  
2027 -       case MAGNET_ENV_REQUEST_METHOD:   break;
2028 +       case MAGNET_ENV_REQUEST_METHOD:
2029 +               buffer_copy_string(srv->tmp_buf, get_http_method_name(con->request.http_method));
2030 +               dest = srv->tmp_buf;
2031 +               break;
2032         case MAGNET_ENV_REQUEST_URI:      dest = con->request.uri; break;
2033         case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
2034 -       case MAGNET_ENV_REQUEST_PROTOCOL: break;
2035 +       case MAGNET_ENV_REQUEST_PROTOCOL:
2036 +               buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
2037 +               dest = srv->tmp_buf;
2038 +               break;
2039  
2040         case MAGNET_ENV_UNSET: break;
2041         }
2042 @@ -761,11 +767,13 @@
2043  
2044         if (lua_return_value > 99) {
2045                 con->http_status = lua_return_value;
2046 -               con->file_finished = 1;
2047  
2048                 /* try { ...*/
2049                 if (0 == setjmp(exceptionjmp)) {
2050                         magnet_attach_content(srv, con, p, L);
2051 +                       if (!chunkqueue_is_empty(con->write_queue)) {
2052 +                               con->mode = p->id;
2053 +                       }
2054                 } else {
2055                         /* } catch () { */
2056                         con->http_status = 500;
2057 Index: src/log.c
2058 ===================================================================
2059 --- src/log.c   (.../tags/lighttpd-1.4.19)      (revision 2199)
2060 +++ src/log.c   (.../branches/lighttpd-1.4.x)   (revision 2199)
2061 @@ -31,6 +31,29 @@
2062  # define O_LARGEFILE 0
2063  #endif
2064  
2065 +/* Close fd and _try_ to get a /dev/null for it instead.
2066 + * close() alone may trigger some bugs when a
2067 + * process opens another file and gets fd = STDOUT_FILENO or STDERR_FILENO
2068 + * and later tries to just print on stdout/stderr
2069 + *
2070 + * Returns 0 on success and -1 on failure (fd gets closed in all cases)
2071 + */
2072 +int openDevNull(int fd) {
2073 +       int tmpfd;
2074 +       close(fd);
2075 +#if defined(__WIN32)
2076 +       /* Cygwin should work with /dev/null */
2077 +       tmpfd = open("nul", O_RDWR);
2078 +#else
2079 +       tmpfd = open("/dev/null", O_RDWR);
2080 +#endif
2081 +       if (tmpfd != -1 && tmpfd != fd) {
2082 +               dup2(tmpfd, fd);
2083 +               close(tmpfd);
2084 +       }
2085 +       return (tmpfd != -1) ? 0 : -1;
2086 +}
2087 +
2088  /**
2089   * open the errorlog
2090   *
2091 @@ -44,7 +67,6 @@
2092   */
2093  
2094  int log_error_open(server *srv) {
2095 -       int fd;
2096         int close_stderr = 1;
2097  
2098  #ifdef HAVE_SYSLOG_H
2099 @@ -78,15 +100,16 @@
2100         /* don't close stderr for debugging purposes if run in valgrind */
2101         if (RUNNING_ON_VALGRIND) close_stderr = 0;
2102  #endif
2103 -       if (srv->errorlog_mode == ERRORLOG_STDERR) close_stderr = 0;
2104  
2105 +       if (srv->errorlog_mode == ERRORLOG_STDERR && srv->srvconf.dont_daemonize) {
2106 +               /* We can only log to stderr in dont-daemonize mode;
2107 +                * if we do daemonize and no errorlog file is specified, we log into /dev/null
2108 +                */
2109 +               close_stderr = 0;
2110 +       }
2111 +
2112         /* move stderr to /dev/null */
2113 -       if (close_stderr &&
2114 -           -1 != (fd = open("/dev/null", O_WRONLY))) {
2115 -               close(STDERR_FILENO);
2116 -               dup2(fd, STDERR_FILENO);
2117 -               close(fd);
2118 -       }
2119 +       if (close_stderr) openDevNull(STDERR_FILENO);
2120         return 0;
2121  }
2122  
2123 Index: src/log.h
2124 ===================================================================
2125 --- src/log.h   (.../tags/lighttpd-1.4.19)      (revision 2199)
2126 +++ src/log.h   (.../branches/lighttpd-1.4.x)   (revision 2199)
2127 @@ -3,6 +3,11 @@
2128  
2129  #include "server.h"
2130  
2131 +/* Close fd and _try_ to get a /dev/null for it instead.
2132 + * Returns 0 on success and -1 on failure (fd gets closed in all cases)
2133 + */
2134 +int openDevNull(int fd);
2135 +
2136  #define WP() log_error_write(srv, __FILE__, __LINE__, "");
2137  
2138  int log_error_open(server *srv);
2139
2140 Property changes on: tests/symlink.t
2141 ___________________________________________________________________
2142 Name: svn:executable
2143    + *
2144
2145 Index: tests/request.t
2146 ===================================================================
2147 --- tests/request.t     (.../tags/lighttpd-1.4.19)      (revision 2199)
2148 +++ tests/request.t     (.../branches/lighttpd-1.4.x)   (revision 2199)
2149 @@ -101,7 +101,7 @@
2150  Expect: 100-continue
2151  EOF
2152   );
2153 -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417, '-HTTP-Content' => ''} ];
2154 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417 } ];
2155  ok($tf->handle_http($t) == 0, 'Continue, Expect');
2156  
2157  ## ranges
2158
2159 Property changes on: tests/env-variables.t
2160 ___________________________________________________________________
2161 Name: svn:executable
2162    + *
2163
2164 Index: tests/mod-fastcgi.t
2165 ===================================================================
2166 --- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.19)      (revision 2199)
2167 +++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x)   (revision 2199)
2168 @@ -65,7 +65,7 @@
2169  EOF
2170   );
2171         $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/get-server-env.php' } ];
2172 -       ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]');
2173 +       ok($tf->handle_http($t) == 0, '$_SERVER["SCRIPT_NAME"]');
2174  
2175         $t->{REQUEST}  = ( <<EOF
2176  GET /get-server-env.php/foo?env=PATH_INFO HTTP/1.0
2177 Index: tests/docroot/www/get-env.php
2178 ===================================================================
2179 --- tests/docroot/www/get-env.php       (.../tags/lighttpd-1.4.19)      (revision 2199)
2180 +++ tests/docroot/www/get-env.php       (.../branches/lighttpd-1.4.x)   (revision 2199)
2181 @@ -1,3 +1,4 @@
2182  <?php
2183 -       print $_ENV[$_GET["env"]];
2184 +       $env = $_GET["env"];
2185 +       print isset($_ENV[$env]) ? $_ENV[$env] : '';
2186  ?>
2187
2188 Property changes on: tests/core-404-handler.t
2189 ___________________________________________________________________
2190 Name: svn:executable
2191    + *
2192
2193 Index: doc/userdir.txt
2194 ===================================================================
2195 --- doc/userdir.txt     (.../tags/lighttpd-1.4.19)      (revision 2199)
2196 +++ doc/userdir.txt     (.../branches/lighttpd-1.4.x)   (revision 2199)
2197 @@ -46,10 +46,10 @@
2198  Options
2199  =======
2200  
2201 -userdir.path
2202 +userdir.path (required option)
2203    usually it should be set to "public_html" to take ~/public_html/ as the document root
2204  
2205 -  Default: empty (document root is the home directory)
2206 +  Default: unset (mod_userdir disabled; set it to "" if you want the home directory to be the document root as it was the default before 1.4.19)
2207    Example: ::
2208  
2209      userdir.path = "public_html"
2210 Index: SConstruct
2211 ===================================================================
2212 --- SConstruct  (.../tags/lighttpd-1.4.19)      (revision 2199)
2213 +++ SConstruct  (.../branches/lighttpd-1.4.x)   (revision 2199)
2214 @@ -5,7 +5,7 @@
2215  from stat import *
2216  
2217  package = 'lighttpd'
2218 -version = '1.4.19'
2219 +version = '1.4.20'
2220  
2221  def checkCHeaders(autoconf, hdrs):
2222         p = re.compile('[^A-Z0-9]')
2223 Index: Makefile.am
2224 ===================================================================
2225 --- Makefile.am (.../tags/lighttpd-1.4.19)      (revision 2199)
2226 +++ Makefile.am (.../branches/lighttpd-1.4.x)   (revision 2199)
2227 @@ -1,3 +1,3 @@
2228  SUBDIRS=src doc tests cygwin openwrt
2229  
2230 -EXTRA_DIST=lighttpd.spec autogen.sh SConstruct
2231 +EXTRA_DIST=autogen.sh SConstruct
2232 Index: NEWS
2233 ===================================================================
2234 --- NEWS        (.../tags/lighttpd-1.4.19)      (revision 2199)
2235 +++ NEWS        (.../branches/lighttpd-1.4.x)   (revision 2199)
2236 @@ -3,8 +3,33 @@
2237  NEWS
2238  ====
2239  
2240 -- 1.4.19 -
2241 +- 1.4.20 -
2242  
2243 +  * Fix mod_compress to compile with old gcc version (#1592)
2244 +  * Fix mod_extforward to compile with old gcc version (#1591)
2245 +  * Update documentation for #1587
2246 +  * Fix #285 again: read error after SSL_shutdown (thx marton.illes@balabit.com) and clear the error queue before some other calls (CVE-2008-1531)
2247 +  * Fix mod_magnet: enable "request.method" and "request.protocol" in lighty.env (#1308)
2248 +  * Fix segfault for appending matched parts if there was no regex matching (just give empty strings) (#1601)
2249 +  * Use data_response_init in mod_fastcgi x-sendfile handling for response.headers, fix a small "memleak" (#1628)
2250 +  * Don't send empty Server headers (#1620)
2251 +  * Fix conditional interpretation of core options
2252 +  * Enable escaping of % and $ in redirect/rewrite; only two cases changed their behaviour: "%%" => "%", "$$" => "$"
2253 +  * Fix accesslog port (should be port from the connection, not the "server.port") (#1618)
2254 +  * Fix mod_fastcgi prefix matching: match the prefix always against url, not the absolute filepath (regardless of check-local)
2255 +  * Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst
2256 +  * Handle EINTR in mod_cgi during write() (#1640)
2257 +  * Allow all http status codes by default; disable body only for 204,205 and 304; generate error pages for 4xx and 5xx (#1639)
2258 +  * Fix mod_magnet to set con->mode = p->id if it generates content, so returning 4xx/5xx doesn't append an error page
2259 +  * Remove lighttpd.spec* from source, fixing all problems with it ;-)
2260 +  * Do not rely on PATH_MAX (POSIX does not require it) (#580)
2261 +  * Disable logging to access.log if filename is an empty string
2262 +  * Implement a clean way to open /dev/null and use it to close stdin/out/err in the needed places (#624)
2263 +  * merge spawn-fcgi changes from trunk (from @2191)
2264 +  * let spawn-fcgi propagate exit code from spawned fcgi application
2265 +
2266 +- 1.4.19 - 2008-03-10
2267 +
2268    * added support for If-Range: <date> (#1346)
2269    * added support for matching $HTTP["scheme"] in configs
2270    * fixed initgroups() called after chroot (#1384)
2271 Index: .cvsignore
2272 ===================================================================
2273 --- .cvsignore  (.../tags/lighttpd-1.4.19)      (revision 2199)
2274 +++ .cvsignore  (.../branches/lighttpd-1.4.x)   (revision 2199)
2275 @@ -3,7 +3,6 @@
2276  configure
2277  depcomp
2278  config.*
2279 -lighttpd.spec
2280  mkinstalldirs
2281  distribute.sh
2282  autom4te.cache
2283
2284 Property changes on: .
2285 ___________________________________________________________________
2286 Name: svk:merge
2287    - 152afb58-edef-0310-8abb-c4023f1b3aa9:/branches/lighttpd-1.3.x:499
2288 152afb58-edef-0310-8abb-c4023f1b3aa9:/branches/lighttpd-1.4.11-ssl-fixes:1346
2289 152afb58-edef-0310-8abb-c4023f1b3aa9:/branches/lighttpd-merge-1.4.x:1041
2290 152afb58-edef-0310-8abb-c4023f1b3aa9:/tags/lighttpd-1.4.11:1042
2291 152afb58-edef-0310-8abb-c4023f1b3aa9:/tags/release-1.3.13:105
2292 152afb58-edef-0310-8abb-c4023f1b3aa9:/trunk:104
2293 a98e19e4-a712-0410-8832-6551a15ffc53:/local/branches/lighttpd-1.4.x:1557
2294 ebd0e9cf-3e47-4385-9dd4-f0e25e97baa2:/local/lighttpd/branches/lighttpd-1.4.x:2164
2295    + 152afb58-edef-0310-8abb-c4023f1b3aa9:/branches/lighttpd-1.3.x:499
2296 152afb58-edef-0310-8abb-c4023f1b3aa9:/branches/lighttpd-1.4.11-ssl-fixes:1346
2297 152afb58-edef-0310-8abb-c4023f1b3aa9:/branches/lighttpd-merge-1.4.x:1041
2298 152afb58-edef-0310-8abb-c4023f1b3aa9:/tags/lighttpd-1.4.11:1042
2299 152afb58-edef-0310-8abb-c4023f1b3aa9:/tags/release-1.3.13:105
2300 152afb58-edef-0310-8abb-c4023f1b3aa9:/trunk:104
2301 a98e19e4-a712-0410-8832-6551a15ffc53:/local/branches/lighttpd-1.4.x:1557
2302 ebd0e9cf-3e47-4385-9dd4-f0e25e97baa2:/local/lighttpd/branches/lighttpd-1.4.x:2250
2303
This page took 0.539311 seconds and 4 git commands to generate.