]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd-branch.diff
- exclude files that were not present in tarball
[packages/lighttpd.git] / lighttpd-branch.diff
1 Index: configure.in
2 ===================================================================
3 Index: src/spawn-fcgi.c
4 ===================================================================
5 --- src/spawn-fcgi.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
6 +++ src/spawn-fcgi.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
7 @@ -1,481 +0,0 @@
8 -#include <sys/types.h>
9 -#include <sys/time.h>
10 -#include <sys/stat.h>
11 -
12 -#include <stdlib.h>
13 -#include <string.h>
14 -#include <errno.h>
15 -#include <stdio.h>
16 -#include <unistd.h>
17 -#include <fcntl.h>
18 -
19 -#ifdef HAVE_CONFIG_H
20 -#include "config.h"
21 -#endif
22 -
23 -
24 -#ifdef HAVE_PWD_H
25 -#include <grp.h>
26 -#include <pwd.h>
27 -#endif
28 -
29 -#ifdef HAVE_GETOPT_H
30 -#include <getopt.h>
31 -#endif
32 -
33 -#define FCGI_LISTENSOCK_FILENO 0
34 -
35 -#include "sys-socket.h"
36 -
37 -#ifdef HAVE_SYS_WAIT_H
38 -#include <sys/wait.h>
39 -#endif
40 -
41 -/* for solaris 2.5 and netbsd 1.3.x */
42 -#ifndef HAVE_SOCKLEN_T
43 -typedef int socklen_t;
44 -#endif
45 -
46 -#ifdef HAVE_SYS_UN_H
47 -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) {
48 -       int fcgi_fd;
49 -       int socket_type, status, rc = 0;
50 -       struct timeval tv = { 0, 100 * 1000 };
51 -
52 -       struct sockaddr_un fcgi_addr_un;
53 -       struct sockaddr_in fcgi_addr_in;
54 -       struct sockaddr *fcgi_addr;
55 -
56 -       socklen_t servlen;
57 -
58 -       if (child_count < 2) {
59 -               child_count = 5;
60 -       }
61 -
62 -       if (child_count > 256) {
63 -               child_count = 256;
64 -       }
65 -
66 -
67 -       if (unixsocket) {
68 -               memset(&fcgi_addr_un, 0, sizeof(fcgi_addr_un));
69 -
70 -               fcgi_addr_un.sun_family = AF_UNIX;
71 -               strcpy(fcgi_addr_un.sun_path, unixsocket);
72 -
73 -#ifdef SUN_LEN
74 -               servlen = SUN_LEN(&fcgi_addr_un);
75 -#else
76 -               /* stevens says: */
77 -               servlen = strlen(fcgi_addr_un.sun_path) + sizeof(fcgi_addr_un.sun_family);
78 -#endif
79 -               socket_type = AF_UNIX;
80 -               fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
81 -       } else {
82 -               memset(&fcgi_addr_in, 0, sizeof(fcgi_addr_in));
83 -               fcgi_addr_in.sin_family = AF_INET;
84 -               if (addr != NULL) {
85 -                       fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
86 -               } else {
87 -                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
88 -               }
89 -               fcgi_addr_in.sin_port = htons(port);
90 -               servlen = sizeof(fcgi_addr_in);
91 -
92 -               socket_type = AF_INET;
93 -               fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
94 -       }
95 -
96 -       if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
97 -               fprintf(stderr, "%s.%d\n",
98 -                       __FILE__, __LINE__);
99 -               return -1;
100 -       }
101 -
102 -       if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
103 -               /* server is not up, spawn in  */
104 -               pid_t child;
105 -               int val;
106 -
107 -               if (unixsocket) unlink(unixsocket);
108 -
109 -               close(fcgi_fd);
110 -
111 -               /* reopen socket */
112 -               if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
113 -                       fprintf(stderr, "%s.%d\n",
114 -                               __FILE__, __LINE__);
115 -                       return -1;
116 -               }
117 -
118 -               val = 1;
119 -               if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
120 -                       fprintf(stderr, "%s.%d\n",
121 -                               __FILE__, __LINE__);
122 -                       return -1;
123 -               }
124 -
125 -               /* create socket */
126 -               if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
127 -                       fprintf(stderr, "%s.%d: bind failed: %s\n",
128 -                               __FILE__, __LINE__,
129 -                               strerror(errno));
130 -                       return -1;
131 -               }
132 -
133 -               if (-1 == listen(fcgi_fd, 1024)) {
134 -                       fprintf(stderr, "%s.%d: fd = -1\n",
135 -                               __FILE__, __LINE__);
136 -                       return -1;
137 -               }
138 -
139 -               while (fork_count-- > 0) {
140 -
141 -                       if (!nofork) {
142 -                               child = fork();
143 -                       } else {
144 -                               child = 0;
145 -                       }
146 -
147 -                       switch (child) {
148 -                       case 0: {
149 -                               char cgi_childs[64];
150 -                               int max_fd = 0;
151 -
152 -                               int i = 0;
153 -
154 -                               /* loose control terminal */
155 -                               setsid();
156 -
157 -                               /* is safe as we limit to 256 childs */
158 -                               sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
159 -
160 -                               if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
161 -                                       close(FCGI_LISTENSOCK_FILENO);
162 -                                       dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
163 -                                       close(fcgi_fd);
164 -                               }
165 -
166 -                               max_fd = open("/dev/null", O_RDWR);
167 -                               close(STDERR_FILENO);
168 -                               dup2(max_fd, STDERR_FILENO);
169 -                               close(max_fd);
170 -
171 -                               max_fd = open("/dev/null", O_RDWR);
172 -                               close(STDOUT_FILENO);
173 -                               dup2(max_fd, STDOUT_FILENO);
174 -                               close(max_fd);
175 -
176 -                               /* we don't need the client socket */
177 -                               for (i = 3; i < max_fd; i++) {
178 -                                       if (i != FCGI_LISTENSOCK_FILENO) close(i);
179 -                               }
180 -
181 -                               /* create environment */
182 -
183 -                               putenv(cgi_childs);
184 -
185 -                               /* fork and replace shell */
186 -                               if (appArgv) {
187 -                                       execv(appArgv[0], appArgv);
188 -
189 -                               } else {
190 -                                       char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
191 -                                       strcpy(b, "exec ");
192 -                                       strcat(b, appPath);
193 -
194 -                                       /* exec the cgi */
195 -                                       execl("/bin/sh", "sh", "-c", b, (char *)NULL);
196 -                               }
197 -
198 -                               exit(errno);
199 -
200 -                               break;
201 -                       }
202 -                       case -1:
203 -                               /* error */
204 -                               break;
205 -                       default:
206 -                               /* father */
207 -
208 -                               /* wait */
209 -                               select(0, NULL, NULL, NULL, &tv);
210 -
211 -                               switch (waitpid(child, &status, WNOHANG)) {
212 -                               case 0:
213 -                                       fprintf(stdout, "%s.%d: child spawned successfully: PID: %d\n",
214 -                                               __FILE__, __LINE__,
215 -                                               child);
216 -
217 -                                       /* write pid file */
218 -                                       if (pid_fd != -1) {
219 -                                               /* assume a 32bit pid_t */
220 -                                               char pidbuf[12];
221 -
222 -                                               snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
223 -
224 -                                               write(pid_fd, pidbuf, strlen(pidbuf));
225 -                                               /* avoid eol for the last one */
226 -                                               if (fork_count != 0) {
227 -                                                       write(pid_fd, "\n", 1);
228 -                                               }
229 -                                       }
230 -
231 -                                       break;
232 -                               case -1:
233 -                                       break;
234 -                               default:
235 -                                       if (WIFEXITED(status)) {
236 -                                               fprintf(stderr, "%s.%d: child exited with: %d\n",
237 -                                                       __FILE__, __LINE__, WEXITSTATUS(status));
238 -                                               rc = WEXITSTATUS(status);
239 -                                       } else if (WIFSIGNALED(status)) {
240 -                                               fprintf(stderr, "%s.%d: child signaled: %d\n",
241 -                                                       __FILE__, __LINE__,
242 -                                                       WTERMSIG(status));
243 -                                               rc = 1;
244 -                                       } else {
245 -                                               fprintf(stderr, "%s.%d: child died somehow: %d\n",
246 -                                                       __FILE__, __LINE__,
247 -                                                       status);
248 -                                               rc = status;
249 -                                       }
250 -                               }
251 -
252 -                               break;
253 -                       }
254 -               }
255 -               close(pid_fd);
256 -               pid_fd = -1;
257 -       } else {
258 -               fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
259 -                       __FILE__, __LINE__);
260 -               return -1;
261 -       }
262 -
263 -       close(fcgi_fd);
264 -
265 -       return rc;
266 -}
267 -
268 -
269 -void show_version () {
270 -       char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
271 -" - spawns fastcgi processes\n"
272 -;
273 -       write(1, b, strlen(b));
274 -}
275 -
276 -void show_help () {
277 -       char *b = \
278 -"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
279 -"\n" \
280 -"spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \
281 -"\n" \
282 -"Options:\n" \
283 -" -f <fcgiapp> filename of the fcgi-application\n" \
284 -" -a <addr>    bind to ip address\n" \
285 -" -p <port>    bind to tcp-port\n" \
286 -" -s <path>    bind to unix-domain socket\n" \
287 -" -C <childs>  (PHP only) numbers of childs to spawn (default 5)\n" \
288 -" -F <childs>  numbers of childs to fork (default 1)\n" \
289 -" -P <path>    name of PID-file for spawed process\n" \
290 -" -n           no fork (for daemontools)\n" \
291 -" -v           show version\n" \
292 -" -h           show this help\n" \
293 -"(root only)\n" \
294 -" -c <dir>     chroot to directory\n" \
295 -" -u <user>    change to user-id\n" \
296 -" -g <group>   change to group-id\n" \
297 -;
298 -       write(1, b, strlen(b));
299 -}
300 -
301 -
302 -int main(int argc, char **argv) {
303 -       char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
304 -               *groupname = NULL, *unixsocket = NULL, *pid_file = NULL,
305 -                *addr = NULL;
306 -       char **fcgi_app_argv = { NULL };
307 -       unsigned short port = 0;
308 -       int child_count = 5;
309 -       int fork_count = 1;
310 -       int i_am_root, o;
311 -       int pid_fd = -1;
312 -       int nofork = 0;
313 -       struct sockaddr_un un;
314 -
315 -       i_am_root = (getuid() == 0);
316 -
317 -       while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) {
318 -               switch(o) {
319 -               case 'f': fcgi_app = optarg; break;
320 -               case 'a': addr = optarg;/* ip addr */ break;
321 -               case 'p': port = strtol(optarg, NULL, 10);/* port */ break;
322 -               case 'C': child_count = strtol(optarg, NULL, 10);/*  */ break;
323 -               case 'F': fork_count = strtol(optarg, NULL, 10);/*  */ break;
324 -               case 's': unixsocket = optarg; /* unix-domain socket */ break;
325 -               case 'c': if (i_am_root) { changeroot = optarg; }/* chroot() */ break;
326 -               case 'u': if (i_am_root) { username = optarg; } /* set user */ break;
327 -               case 'g': if (i_am_root) { groupname = optarg; } /* set group */ break;
328 -               case 'n': nofork = 1; break;
329 -               case 'P': pid_file = optarg; /* PID file */ break;
330 -               case 'v': show_version(); return 0;
331 -               case 'h': show_help(); return 0;
332 -               default:
333 -                       show_help();
334 -                       return -1;
335 -               }
336 -       }
337 -
338 -       if (optind < argc) {
339 -               fcgi_app_argv = &argv[optind];
340 -       }
341 -
342 -       if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) {
343 -               show_help();
344 -               return -1;
345 -       }
346 -
347 -       if (unixsocket && port) {
348 -               fprintf(stderr, "%s.%d: %s\n",
349 -                       __FILE__, __LINE__,
350 -                       "either a unix domain socket or a tcp-port, but not both\n");
351 -
352 -               return -1;
353 -       }
354 -
355 -       if (unixsocket && strlen(unixsocket) > sizeof(un.sun_path) - 1) {
356 -               fprintf(stderr, "%s.%d: %s\n",
357 -                       __FILE__, __LINE__,
358 -                       "path of the unix socket is too long\n");
359 -
360 -               return -1;
361 -       }
362 -
363 -       /* UID handling */
364 -       if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
365 -               /* we are setuid-root */
366 -
367 -               fprintf(stderr, "%s.%d: %s\n",
368 -                       __FILE__, __LINE__,
369 -                       "Are you nuts ? Don't apply a SUID bit to this binary\n");
370 -
371 -               return -1;
372 -       }
373 -
374 -       if (pid_file &&
375 -           (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)))) {
376 -               struct stat st;
377 -               if (errno != EEXIST) {
378 -                       fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
379 -                               __FILE__, __LINE__,
380 -                               pid_file, strerror(errno));
381 -
382 -                       return -1;
383 -               }
384 -
385 -               /* ok, file exists */
386 -
387 -               if (0 != stat(pid_file, &st)) {
388 -                       fprintf(stderr, "%s.%d: stating pid-file '%s' failed: %s\n",
389 -                               __FILE__, __LINE__,
390 -                               pid_file, strerror(errno));
391 -
392 -                       return -1;
393 -               }
394 -
395 -               /* is it a regular file ? */
396 -
397 -               if (!S_ISREG(st.st_mode)) {
398 -                       fprintf(stderr, "%s.%d: pid-file exists and isn't regular file: '%s'\n",
399 -                               __FILE__, __LINE__,
400 -                               pid_file);
401 -
402 -                       return -1;
403 -               }
404 -
405 -               if (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
406 -                       fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
407 -                               __FILE__, __LINE__,
408 -                               pid_file, strerror(errno));
409 -
410 -                       return -1;
411 -               }
412 -       }
413 -
414 -       if (i_am_root) {
415 -               struct group *grp = NULL;
416 -               struct passwd *pwd = NULL;
417 -
418 -               /* set user and group */
419 -
420 -               if (username) {
421 -                       if (NULL == (pwd = getpwnam(username))) {
422 -                               fprintf(stderr, "%s.%d: %s, %s\n",
423 -                                       __FILE__, __LINE__,
424 -                                       "can't find username", username);
425 -                               return -1;
426 -                       }
427 -
428 -                       if (pwd->pw_uid == 0) {
429 -                               fprintf(stderr, "%s.%d: %s\n",
430 -                                       __FILE__, __LINE__,
431 -                                       "I will not set uid to 0\n");
432 -                               return -1;
433 -                       }
434 -               }
435 -
436 -               if (groupname) {
437 -                       if (NULL == (grp = getgrnam(groupname))) {
438 -                               fprintf(stderr, "%s.%d: %s %s\n",
439 -                                       __FILE__, __LINE__,
440 -                                       "can't find groupname",
441 -                                       groupname);
442 -                               return -1;
443 -                       }
444 -                       if (grp->gr_gid == 0) {
445 -                               fprintf(stderr, "%s.%d: %s\n",
446 -                                       __FILE__, __LINE__,
447 -                                       "I will not set gid to 0\n");
448 -                               return -1;
449 -                       }
450 -
451 -                       /* do the change before we do the chroot() */
452 -                       setgid(grp->gr_gid);
453 -                       setgroups(0, NULL); 
454 -
455 -                       if (username) {
456 -                               initgroups(username, grp->gr_gid);
457 -                       }
458 -
459 -               }
460 -
461 -               if (changeroot) {
462 -                       if (-1 == chroot(changeroot)) {
463 -                               fprintf(stderr, "%s.%d: %s %s\n",
464 -                                       __FILE__, __LINE__,
465 -                                       "chroot failed: ", strerror(errno));
466 -                               return -1;
467 -                       }
468 -                       if (-1 == chdir("/")) {
469 -                               fprintf(stderr, "%s.%d: %s %s\n",
470 -                                       __FILE__, __LINE__,
471 -                                       "chdir failed: ", strerror(errno));
472 -                               return -1;
473 -                       }
474 -               }
475 -
476 -               /* drop root privs */
477 -               if (username) {
478 -                       setuid(pwd->pw_uid);
479 -               }
480 -       }
481 -
482 -       return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork);
483 -}
484 -#else
485 -int main() {
486 -       return -1;
487 -}
488 -#endif
489 Index: src/configfile-glue.c
490 ===================================================================
491 --- src/configfile-glue.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
492 +++ src/configfile-glue.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
493 @@ -49,7 +49,7 @@
494                                                 buffer_copy_string_buffer(ds->value, ((data_string *)(da->value->data[j]))->value);
495                                                 if (!da->is_index_key) {
496                                                         /* the id's were generated automaticly, as we copy now we might have to renumber them
497 -                                                        * this is used to prepend server.modules by mod_indexfiles as it has to be loaded
498 +                                                        * this is used to prepend server.modules by mod_indexfile as it has to be loaded
499                                                          * before mod_fastcgi and friends */
500                                                         buffer_copy_string_buffer(ds->key, ((data_string *)(da->value->data[j]))->key);
501                                                 }
502 @@ -181,7 +181,7 @@
503         return config_insert_values_internal(srv, ca, cv);
504  }
505  
506 -unsigned short sock_addr_get_port(sock_addr *addr) {
507 +static unsigned short sock_addr_get_port(sock_addr *addr) {
508  #ifdef HAVE_IPV6
509         return ntohs(addr->plain.sa_family ? addr->ipv6.sin6_port : addr->ipv4.sin_port);
510  #else
511 Index: src/mod_cgi.c
512 ===================================================================
513 --- src/mod_cgi.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
514 +++ src/mod_cgi.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
515 @@ -24,6 +24,7 @@
516  #include <fcntl.h>
517  
518  #include "server.h"
519 +#include "stat_cache.h"
520  #include "keyvalue.h"
521  #include "log.h"
522  #include "connections.h"
523 @@ -36,6 +37,8 @@
524  # include <sys/filio.h>
525  #endif
526  
527 +#include "version.h"
528 +
529  enum {EOL_UNSET, EOL_N, EOL_RN};
530  
531  typedef struct {
532 @@ -776,25 +779,23 @@
533                 /* not needed */
534                 close(to_cgi_fds[1]);
535  
536 -               /* HACK:
537 -                * this is not nice, but it works
538 -                *
539 -                * we feed the stderr of the CGI to our errorlog, if possible
540 -                */
541 -               if (srv->errorlog_mode == ERRORLOG_FILE) {
542 -                       close(STDERR_FILENO);
543 -                       dup2(srv->errorlog_fd, STDERR_FILENO);
544 -               }
545 -
546                 /* create environment */
547                 env.ptr = NULL;
548                 env.size = 0;
549                 env.used = 0;
550  
551 -               cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
552 +               if (buffer_is_empty(con->conf.server_tag)) {
553 +                       cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
554 +               } else {
555 +                       cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
556 +               }
557  
558                 if (!buffer_is_empty(con->server_name)) {
559 -                       cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
560 +                       size_t len = con->server_name->used - 1;
561 +                       char *colon = strchr(con->server_name->ptr, ':');
562 +                       if (colon) len = colon - con->server_name->ptr;
563 +
564 +                       cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
565                 } else {
566  #ifdef HAVE_IPV6
567                         s = inet_ntop(srv_sock->addr.plain.sa_family,
568 @@ -1203,6 +1204,7 @@
569         size_t k, s_len;
570         plugin_data *p = p_d;
571         buffer *fn = con->physical.path;
572 +       stat_cache_entry *sce = NULL;
573  
574         if (con->mode != DIRECT) return HANDLER_GO_ON;
575  
576 @@ -1210,6 +1212,9 @@
577  
578         mod_cgi_patch_connection(srv, con, p);
579  
580 +       if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
581 +       if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
582 +
583         s_len = fn->used - 1;
584  
585         for (k = 0; k < p->conf.cgi->used; k++) {
586 @@ -1369,6 +1374,7 @@
587  }
588  
589  
590 +int mod_cgi_plugin_init(plugin *p);
591  int mod_cgi_plugin_init(plugin *p) {
592         p->version     = LIGHTTPD_VERSION_ID;
593         p->name        = buffer_init_string("cgi");
594 Index: src/mod_cml.c
595 ===================================================================
596 --- src/mod_cml.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
597 +++ src/mod_cml.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
598 @@ -178,7 +178,7 @@
599  }
600  #undef PATCH
601  
602 -int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
603 +static int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
604         buffer *b;
605         char *c;
606  
607 @@ -305,6 +305,7 @@
608         }
609  }
610  
611 +int mod_cml_plugin_init(plugin *p);
612  int mod_cml_plugin_init(plugin *p) {
613         p->version     = LIGHTTPD_VERSION_ID;
614         p->name        = buffer_init_string("cache");
615 Index: src/mod_secure_download.c
616 ===================================================================
617 --- src/mod_secure_download.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
618 +++ src/mod_secure_download.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
619 @@ -138,7 +138,7 @@
620   * @return if the supplied string is a valid MD5 string 1 is returned otherwise 0
621   */
622  
623 -int is_hex_len(const char *str, size_t len) {
624 +static int is_hex_len(const char *str, size_t len) {
625         size_t i;
626  
627         if (NULL == str) return 0;
628 @@ -293,6 +293,7 @@
629  
630  /* this function is called at dlopen() time and inits the callbacks */
631  
632 +int mod_secdownload_plugin_init(plugin *p);
633  int mod_secdownload_plugin_init(plugin *p) {
634         p->version     = LIGHTTPD_VERSION_ID;
635         p->name        = buffer_init_string("secdownload");
636 Index: src/base.h
637 ===================================================================
638 --- src/base.h  (.../tags/lighttpd-1.4.22)      (revision 2475)
639 +++ src/base.h  (.../branches/lighttpd-1.4.x)   (revision 2475)
640 @@ -183,11 +183,15 @@
641  } response;
642  
643  typedef struct {
644 -       buffer *scheme;
645 +       buffer *scheme; /* scheme without colon or slashes ( "http" or "https" ) */
646 +
647 +       /* authority with optional portnumber ("site.name" or "site.name:8080" ) NOTE: without "username:password@" */
648         buffer *authority;
649 +
650 +       /* path including leading slash ("/" or "/index.html") - urldecoded, and sanitized  ( buffer_path_simplify() && buffer_urldecode_path() ) */
651         buffer *path;
652 -       buffer *path_raw;
653 -       buffer *query;
654 +       buffer *path_raw; /* raw path, as sent from client. no urldecoding or path simplifying */
655 +       buffer *query; /* querystring ( everything after "?", ie: in "/index.php?foo=1", query is "foo=1" ) */
656  } request_uri;
657  
658  typedef struct {
659 @@ -533,7 +537,7 @@
660  
661         /* the errorlog */
662         int errorlog_fd;
663 -       enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG } errorlog_mode;
664 +       enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
665         buffer *errorlog_buf;
666  
667         fdevents *ev, *ev_ins;
668 Index: src/mod_rewrite.c
669 ===================================================================
670 --- src/mod_rewrite.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
671 +++ src/mod_rewrite.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
672 @@ -63,7 +63,7 @@
673         free(hctx);
674  }
675  
676 -rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
677 +static rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
678         rewrite_rule_buffer *kvb;
679  
680         kvb = calloc(1, sizeof(*kvb));
681 @@ -71,7 +71,7 @@
682         return kvb;
683  }
684  
685 -int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
686 +static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
687  #ifdef HAVE_PCRE_H
688         size_t i;
689         const char *errptr;
690 @@ -121,7 +121,7 @@
691  #endif
692  }
693  
694 -void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
695 +static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
696  #ifdef HAVE_PCRE_H
697         size_t i;
698  
699 @@ -444,6 +444,7 @@
700         return HANDLER_GO_ON;
701  }
702  
703 +int mod_rewrite_plugin_init(plugin *p);
704  int mod_rewrite_plugin_init(plugin *p) {
705         p->version     = LIGHTTPD_VERSION_ID;
706         p->name        = buffer_init_string("rewrite");
707 Index: src/connections.c
708 ===================================================================
709 --- src/connections.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
710 +++ src/connections.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
711 @@ -858,7 +858,7 @@
712   *
713   * we get called by the state-engine and by the fdevent-handler
714   */
715 -int connection_handle_read_state(server *srv, connection *con)  {
716 +static int connection_handle_read_state(server *srv, connection *con)  {
717         connection_state_t ostate = con->state;
718         chunk *c, *last_chunk;
719         off_t last_offset;
720 @@ -1156,7 +1156,7 @@
721         return 0;
722  }
723  
724 -handler_t connection_handle_fdevent(void *s, void *context, int revents) {
725 +static handler_t connection_handle_fdevent(void *s, void *context, int revents) {
726         server     *srv = (server *)s;
727         connection *con = context;
728  
729 Index: src/mod_staticfile.c
730 ===================================================================
731 --- src/mod_staticfile.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
732 +++ src/mod_staticfile.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
733 @@ -532,6 +532,7 @@
734  
735  /* this function is called at dlopen() time and inits the callbacks */
736  
737 +int mod_staticfile_plugin_init(plugin *p);
738  int mod_staticfile_plugin_init(plugin *p) {
739         p->version     = LIGHTTPD_VERSION_ID;
740         p->name        = buffer_init_string("staticfile");
741 Index: src/mod_alias.c
742 ===================================================================
743 --- src/mod_alias.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
744 +++ src/mod_alias.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
745 @@ -187,6 +187,7 @@
746  
747  /* this function is called at dlopen() time and inits the callbacks */
748  
749 +int mod_alias_plugin_init(plugin *p);
750  int mod_alias_plugin_init(plugin *p) {
751         p->version     = LIGHTTPD_VERSION_ID;
752         p->name        = buffer_init_string("alias");
753 Index: src/network.c
754 ===================================================================
755 --- src/network.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
756 +++ src/network.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
757 @@ -26,7 +26,7 @@
758  # include <openssl/rand.h>
759  #endif
760  
761 -handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
762 +static handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
763         server     *srv = (server *)s;
764         server_socket *srv_socket = (server_socket *)context;
765         connection *con;
766 @@ -62,7 +62,7 @@
767         return HANDLER_GO_ON;
768  }
769  
770 -int network_server_init(server *srv, buffer *host_token, specific_config *s) {
771 +static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
772         int val;
773         socklen_t addr_len;
774         server_socket *srv_socket;
775 Index: src/mod_trigger_b4_dl.c
776 ===================================================================
777 --- src/mod_trigger_b4_dl.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
778 +++ src/mod_trigger_b4_dl.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
779 @@ -576,6 +576,7 @@
780  
781  /* this function is called at dlopen() time and inits the callbacks */
782  
783 +int mod_trigger_b4_dl_plugin_init(plugin *p);
784  int mod_trigger_b4_dl_plugin_init(plugin *p) {
785         p->version     = LIGHTTPD_VERSION_ID;
786         p->name        = buffer_init_string("trigger_b4_dl");
787 Index: src/mod_evhost.c
788 ===================================================================
789 --- src/mod_evhost.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
790 +++ src/mod_evhost.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
791 @@ -318,6 +318,7 @@
792         return HANDLER_GO_ON;
793  }
794  
795 +int mod_evhost_plugin_init(plugin *p);
796  int mod_evhost_plugin_init(plugin *p) {
797         p->version     = LIGHTTPD_VERSION_ID;
798         p->name                    = buffer_init_string("evhost");
799 Index: src/splaytree.c
800 ===================================================================
801 --- src/splaytree.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
802 +++ src/splaytree.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
803 @@ -187,7 +187,8 @@
804      }
805  }
806  
807 -splay_tree *find_rank(int r, splay_tree *t) {
808 +#if 0
809 +static splay_tree *find_rank(int r, splay_tree *t) {
810  /* Returns a pointer to the node in the tree with the given rank.  */
811  /* Returns NULL if there is no such node.                          */
812  /* Does not change the tree.  To guarantee logarithmic behavior,   */
813 @@ -206,5 +207,4 @@
814         }
815      }
816  }
817 -
818 -
819 +#endif
820 Index: src/chunk.h
821 ===================================================================
822 --- src/chunk.h (.../tags/lighttpd-1.4.22)      (revision 2475)
823 +++ src/chunk.h (.../branches/lighttpd-1.4.x)   (revision 2475)
824 @@ -3,6 +3,7 @@
825  
826  #include "buffer.h"
827  #include "array.h"
828 +#include "sys-mmap.h"
829  
830  typedef struct chunk {
831         enum { UNUSED_CHUNK, MEM_CHUNK, FILE_CHUNK } type;
832 Index: src/etag.c
833 ===================================================================
834 --- src/etag.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
835 +++ src/etag.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
836 @@ -44,7 +44,7 @@
837         size_t i;
838         uint32_t h;
839  
840 -       for (h=0, i=0; i < etag->used; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
841 +       for (h=0, i=0; i < etag->used-1; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
842  
843         buffer_reset(mut);
844         buffer_copy_string_len(mut, CONST_STR_LEN("\""));
845 Index: src/mod_scgi.c
846 ===================================================================
847 --- src/mod_scgi.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
848 +++ src/mod_scgi.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
849 @@ -38,6 +38,8 @@
850  #include <sys/wait.h>
851  #endif
852  
853 +#include "version.h"
854 +
855  enum {EOL_UNSET, EOL_N, EOL_RN};
856  
857  /*
858 @@ -372,7 +374,7 @@
859         free(hctx);
860  }
861  
862 -scgi_proc *scgi_process_init() {
863 +static scgi_proc *scgi_process_init() {
864         scgi_proc *f;
865  
866         f = calloc(1, sizeof(*f));
867 @@ -384,7 +386,7 @@
868         return f;
869  }
870  
871 -void scgi_process_free(scgi_proc *f) {
872 +static void scgi_process_free(scgi_proc *f) {
873         if (!f) return;
874  
875         scgi_process_free(f->next);
876 @@ -394,7 +396,7 @@
877         free(f);
878  }
879  
880 -scgi_extension_host *scgi_host_init() {
881 +static scgi_extension_host *scgi_host_init() {
882         scgi_extension_host *f;
883  
884         f = calloc(1, sizeof(*f));
885 @@ -409,7 +411,7 @@
886         return f;
887  }
888  
889 -void scgi_host_free(scgi_extension_host *h) {
890 +static void scgi_host_free(scgi_extension_host *h) {
891         if (!h) return;
892  
893         buffer_free(h->host);
894 @@ -426,7 +428,7 @@
895  
896  }
897  
898 -scgi_exts *scgi_extensions_init() {
899 +static scgi_exts *scgi_extensions_init() {
900         scgi_exts *f;
901  
902         f = calloc(1, sizeof(*f));
903 @@ -434,7 +436,7 @@
904         return f;
905  }
906  
907 -void scgi_extensions_free(scgi_exts *f) {
908 +static void scgi_extensions_free(scgi_exts *f) {
909         size_t i;
910  
911         if (!f) return;
912 @@ -464,7 +466,7 @@
913         free(f);
914  }
915  
916 -int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
917 +static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
918         scgi_extension *fe;
919         size_t i;
920  
921 @@ -1178,7 +1180,7 @@
922  }
923  
924  
925 -void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
926 +static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
927         plugin_data *p;
928         connection  *con;
929  
930 @@ -1461,10 +1463,18 @@
931         scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));
932  
933  
934 -       scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
935 +       if (buffer_is_empty(con->conf.server_tag)) {
936 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
937 +       } else {
938 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
939 +       }
940  
941         if (con->server_name->used) {
942 -               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
943 +               size_t len = con->server_name->used - 1;
944 +               char *colon = strchr(con->server_name->ptr, ':');
945 +               if (colon) len = colon - con->server_name->ptr;
946 +
947 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
948         } else {
949  #ifdef HAVE_IPV6
950                 s = inet_ntop(srv_sock->addr.plain.sa_family,
951 @@ -1915,7 +1925,7 @@
952  }
953  
954  
955 -int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
956 +static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
957         scgi_proc *p;
958  
959         UNUSED(srv);
960 @@ -3105,6 +3115,7 @@
961  }
962  
963  
964 +int mod_scgi_plugin_init(plugin *p);
965  int mod_scgi_plugin_init(plugin *p) {
966         p->version     = LIGHTTPD_VERSION_ID;
967         p->name         = buffer_init_string("scgi");
968 Index: src/mod_mysql_vhost.c
969 ===================================================================
970 --- src/mod_mysql_vhost.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
971 +++ src/mod_mysql_vhost.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
972 @@ -422,6 +422,7 @@
973  }
974  
975  /* this function is called at dlopen() time and inits the callbacks */
976 +int mod_mysql_vhost_plugin_init(plugin *p);
977  int mod_mysql_vhost_plugin_init(plugin *p) {
978         p->version     = LIGHTTPD_VERSION_ID;
979         p->name                         = buffer_init_string("mysql_vhost");
980 @@ -437,6 +438,7 @@
981  }
982  #else
983  /* we don't have mysql support, this plugin does nothing */
984 +int mod_mysql_vhost_plugin_init(plugin *p);
985  int mod_mysql_vhost_plugin_init(plugin *p) {
986         p->version     = LIGHTTPD_VERSION_ID;
987         p->name                         = buffer_init_string("mysql_vhost");
988 Index: src/request.c
989 ===================================================================
990 --- src/request.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
991 +++ src/request.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
992 @@ -86,10 +86,18 @@
993         if (host_len == 0) return -1;
994  
995         /* if the hostname ends in a "." strip it */
996 -       if (host->ptr[host_len-1] == '.') host_len -= 1;
997 +       if (host->ptr[host_len-1] == '.') {
998 +               /* shift port info one left */
999 +               if (NULL != colon) memmove(colon-1, colon, host->used - host_len);
1000 +               else host->ptr[host_len-1] = '\0';
1001 +               host_len -= 1;
1002 +               host->used -= 1;
1003 +       }
1004  
1005 +       if (host_len == 0) return -1;
1006 +
1007         /* scan from the right and skip the \0 */
1008 -       for (i = host_len - 1; i + 1 > 0; i--) {
1009 +       for (i = host_len; i-- > 0; ) {
1010                 const char c = host->ptr[i];
1011  
1012                 switch (stage) {
1013 @@ -200,7 +208,7 @@
1014  #define DUMP_HEADER
1015  #endif
1016  
1017 -int http_request_split_value(array *vals, buffer *b) {
1018 +static int http_request_split_value(array *vals, buffer *b) {
1019         char *s;
1020         size_t i;
1021         int state = 0;
1022 @@ -262,7 +270,7 @@
1023         return 0;
1024  }
1025  
1026 -int request_uri_is_valid_char(unsigned char c) {
1027 +static int request_uri_is_valid_char(unsigned char c) {
1028         if (c <= 32) return 0;
1029         if (c == 127) return 0;
1030         if (c == 255) return 0;
1031 Index: src/mod_magnet_cache.c
1032 ===================================================================
1033 --- src/mod_magnet_cache.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
1034 +++ src/mod_magnet_cache.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
1035 @@ -9,7 +9,7 @@
1036  #include <lualib.h>
1037  #include <lauxlib.h>
1038  
1039 -script *script_init() {
1040 +static script *script_init() {
1041         script *sc;
1042  
1043         sc = calloc(1, sizeof(*sc));
1044 @@ -19,7 +19,7 @@
1045         return sc;
1046  }
1047  
1048 -void script_free(script *sc) {
1049 +static void script_free(script *sc) {
1050         if (!sc) return;
1051  
1052         lua_pop(sc->L, 1); /* the function copy */
1053 Index: src/mod_flv_streaming.c
1054 ===================================================================
1055 --- src/mod_flv_streaming.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
1056 +++ src/mod_flv_streaming.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
1057 @@ -265,6 +265,7 @@
1058  
1059  /* this function is called at dlopen() time and inits the callbacks */
1060  
1061 +int mod_flv_streaming_plugin_init(plugin *p);
1062  int mod_flv_streaming_plugin_init(plugin *p) {
1063         p->version     = LIGHTTPD_VERSION_ID;
1064         p->name        = buffer_init_string("flv_streaming");
1065 Index: src/mod_rrdtool.c
1066 ===================================================================
1067 --- src/mod_rrdtool.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
1068 +++ src/mod_rrdtool.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
1069 @@ -91,7 +91,7 @@
1070         return HANDLER_GO_ON;
1071  }
1072  
1073 -int mod_rrd_create_pipe(server *srv, plugin_data *p) {
1074 +static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
1075  #ifdef HAVE_FORK
1076         pid_t pid;
1077  
1078 @@ -230,6 +230,7 @@
1079  
1080  static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s) {
1081         struct stat st;
1082 +       int r;
1083  
1084         /* check if DB already exists */
1085         if (0 == stat(s->path_rrd->ptr, &st)) {
1086 @@ -239,54 +240,57 @@
1087                                         "not a regular file:", s->path_rrd);
1088                         return HANDLER_ERROR;
1089                 }
1090 -       } else {
1091 -               int r ;
1092 -               /* create a new one */
1093 +       }
1094  
1095 -               buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
1096 -               buffer_append_string_buffer(p->cmd, s->path_rrd);
1097 -               buffer_append_string_len(p->cmd, CONST_STR_LEN(
1098 -                       " --step 60 "
1099 -                       "DS:InOctets:ABSOLUTE:600:U:U "
1100 -                       "DS:OutOctets:ABSOLUTE:600:U:U "
1101 -                       "DS:Requests:ABSOLUTE:600:U:U "
1102 -                       "RRA:AVERAGE:0.5:1:600 "
1103 -                       "RRA:AVERAGE:0.5:6:700 "
1104 -                       "RRA:AVERAGE:0.5:24:775 "
1105 -                       "RRA:AVERAGE:0.5:288:797 "
1106 -                       "RRA:MAX:0.5:1:600 "
1107 -                       "RRA:MAX:0.5:6:700 "
1108 -                       "RRA:MAX:0.5:24:775 "
1109 -                       "RRA:MAX:0.5:288:797 "
1110 -                       "RRA:MIN:0.5:1:600 "
1111 -                       "RRA:MIN:0.5:6:700 "
1112 -                       "RRA:MIN:0.5:24:775 "
1113 -                       "RRA:MIN:0.5:288:797\n"));
1114 +       /* still create DB if it's empty file */
1115 +       if (st.st_size > 0) {
1116 +               return HANDLER_GO_ON;
1117 +       }
1118  
1119 -               if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
1120 -                       log_error_write(srv, __FILE__, __LINE__, "ss",
1121 -                               "rrdtool-write: failed", strerror(errno));
1122 +       /* create a new one */
1123 +       buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
1124 +       buffer_append_string_buffer(p->cmd, s->path_rrd);
1125 +       buffer_append_string_len(p->cmd, CONST_STR_LEN(
1126 +               " --step 60 "
1127 +               "DS:InOctets:ABSOLUTE:600:U:U "
1128 +               "DS:OutOctets:ABSOLUTE:600:U:U "
1129 +               "DS:Requests:ABSOLUTE:600:U:U "
1130 +               "RRA:AVERAGE:0.5:1:600 "
1131 +               "RRA:AVERAGE:0.5:6:700 "
1132 +               "RRA:AVERAGE:0.5:24:775 "
1133 +               "RRA:AVERAGE:0.5:288:797 "
1134 +               "RRA:MAX:0.5:1:600 "
1135 +               "RRA:MAX:0.5:6:700 "
1136 +               "RRA:MAX:0.5:24:775 "
1137 +               "RRA:MAX:0.5:288:797 "
1138 +               "RRA:MIN:0.5:1:600 "
1139 +               "RRA:MIN:0.5:6:700 "
1140 +               "RRA:MIN:0.5:24:775 "
1141 +               "RRA:MIN:0.5:288:797\n"));
1142  
1143 -                       return HANDLER_ERROR;
1144 -               }
1145 +       if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
1146 +               log_error_write(srv, __FILE__, __LINE__, "ss",
1147 +                       "rrdtool-write: failed", strerror(errno));
1148  
1149 -               buffer_prepare_copy(p->resp, 4096);
1150 -               if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
1151 -                       log_error_write(srv, __FILE__, __LINE__, "ss",
1152 -                               "rrdtool-read: failed", strerror(errno));
1153 +               return HANDLER_ERROR;
1154 +       }
1155  
1156 -                       return HANDLER_ERROR;
1157 -               }
1158 +       buffer_prepare_copy(p->resp, 4096);
1159 +       if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
1160 +               log_error_write(srv, __FILE__, __LINE__, "ss",
1161 +                       "rrdtool-read: failed", strerror(errno));
1162  
1163 -               p->resp->used = r;
1164 +               return HANDLER_ERROR;
1165 +       }
1166  
1167 -               if (p->resp->ptr[0] != 'O' ||
1168 -                   p->resp->ptr[1] != 'K') {
1169 -                       log_error_write(srv, __FILE__, __LINE__, "sbb",
1170 -                               "rrdtool-response:", p->cmd, p->resp);
1171 +       p->resp->used = r;
1172  
1173 -                       return HANDLER_ERROR;
1174 -               }
1175 +       if (p->resp->ptr[0] != 'O' ||
1176 +               p->resp->ptr[1] != 'K') {
1177 +               log_error_write(srv, __FILE__, __LINE__, "sbb",
1178 +                       "rrdtool-response:", p->cmd, p->resp);
1179 +
1180 +               return HANDLER_ERROR;
1181         }
1182  
1183         return HANDLER_GO_ON;
1184 @@ -477,6 +481,7 @@
1185         return HANDLER_GO_ON;
1186  }
1187  
1188 +int mod_rrdtool_plugin_init(plugin *p);
1189  int mod_rrdtool_plugin_init(plugin *p) {
1190         p->version     = LIGHTTPD_VERSION_ID;
1191         p->name        = buffer_init_string("rrd");
1192 Index: src/stat_cache.c
1193 ===================================================================
1194 --- src/stat_cache.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
1195 +++ src/stat_cache.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
1196 @@ -595,29 +595,31 @@
1197         if (S_ISREG(st.st_mode)) {
1198                 /* determine mimetype */
1199                 buffer_reset(sce->content_type);
1200 +#ifdef HAVE_XATTR
1201 +               if (con->conf.use_xattr) {
1202 +                       stat_cache_attr_get(sce->content_type, name->ptr);
1203 +               }
1204 +#endif
1205 +               /* xattr did not set a content-type. ask the config */
1206 +               if (buffer_is_empty(sce->content_type)) {
1207 +                       for (k = 0; k < con->conf.mimetypes->used; k++) {
1208 +                               data_string *ds = (data_string *)con->conf.mimetypes->data[k];
1209 +                               buffer *type = ds->key;
1210  
1211 -               for (k = 0; k < con->conf.mimetypes->used; k++) {
1212 -                       data_string *ds = (data_string *)con->conf.mimetypes->data[k];
1213 -                       buffer *type = ds->key;
1214 +                               if (type->used == 0) continue;
1215  
1216 -                       if (type->used == 0) continue;
1217 +                               /* check if the right side is the same */
1218 +                               if (type->used > name->used) continue;
1219  
1220 -                       /* check if the right side is the same */
1221 -                       if (type->used > name->used) continue;
1222 -
1223 -                       if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
1224 -                               buffer_copy_string_buffer(sce->content_type, ds->value);
1225 -                               break;
1226 +                               if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
1227 +                                       buffer_copy_string_buffer(sce->content_type, ds->value);
1228 +                                       break;
1229 +                               }
1230                         }
1231                 }
1232 -               etag_create(sce->etag, &(sce->st), con->etag_flags);
1233 -#ifdef HAVE_XATTR
1234 -               if (con->conf.use_xattr && buffer_is_empty(sce->content_type)) {
1235 -                       stat_cache_attr_get(sce->content_type, name->ptr);
1236 -               }
1237 -#endif
1238 +               etag_create(sce->etag, &(sce->st), con->etag_flags);
1239         } else if (S_ISDIR(st.st_mode)) {
1240 -               etag_create(sce->etag, &(sce->st), con->etag_flags);
1241 +               etag_create(sce->etag, &(sce->st), con->etag_flags);
1242         }
1243  
1244  #ifdef HAVE_FAM_H
1245 Index: src/response.c
1246 ===================================================================
1247 --- src/response.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
1248 +++ src/response.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
1249 @@ -25,6 +25,7 @@
1250  #include "plugin.h"
1251  
1252  #include "sys-socket.h"
1253 +#include "version.h"
1254  
1255  int http_response_write_header(server *srv, connection *con) {
1256         buffer *b;
1257 @@ -104,7 +105,7 @@
1258  
1259         if (!have_server) {
1260                 if (buffer_is_empty(con->conf.server_tag)) {
1261 -                       buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION));
1262 +                       buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC));
1263                 } else if (con->conf.server_tag->used > 1) {
1264                         buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: "));
1265                         buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);
1266 Index: src/SConscript
1267 ===================================================================
1268 --- src/SConscript      (.../tags/lighttpd-1.4.22)      (revision 2475)
1269 +++ src/SConscript      (.../branches/lighttpd-1.4.x)   (revision 2475)
1270 @@ -70,7 +70,7 @@
1271         'mod_cml' : {
1272                 'src' : [ 'mod_cml_lua.c', 'mod_cml.c', 'mod_cml_funcs.c' ],
1273                 'lib' : [ env['LIBPCRE'], env['LIBMEMCACHE'], env['LIBLUA'], env['LIBLUALIB'] ] },
1274 -       'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
1275 +#      'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
1276         'mod_evasive' : { 'src' : [ 'mod_evasive.c' ] },
1277         'mod_ssi' : { 'src' : [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], 'lib' : [ env['LIBPCRE'] ] },
1278         'mod_flv_streaming' : { 'src' : [ 'mod_flv_streaming.c' ] },
1279 @@ -153,8 +153,6 @@
1280  instbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib, env['LIBDL'] ])
1281  env.Depends(instbin, configparser)
1282  
1283 -spawn_fcgi = env.Program("spawn-fcgi", "spawn-fcgi.c")
1284 -
1285  if env['COMMON_LIB'] == 'bin':
1286         common_lib = instbin[1]
1287  
1288 @@ -168,9 +166,6 @@
1289  
1290  inst = []
1291  
1292 -Default(spawn_fcgi)
1293 -inst += env.Install('${bindir}', spawn_fcgi)
1294 -
1295  if env['build_dynamic']:
1296         Default(instbin[0], instlib)
1297         inst += env.Install('${sbindir}', instbin[0])
1298 Index: src/mod_cml_funcs.c
1299 ===================================================================
1300 --- src/mod_cml_funcs.c (.../tags/lighttpd-1.4.22)      (revision 2475)
1301 +++ src/mod_cml_funcs.c (.../branches/lighttpd-1.4.x)   (revision 2475)
1302 @@ -93,7 +93,7 @@
1303         return 1;
1304  }
1305  
1306 -int f_dir_files_iter(lua_State *L) {
1307 +static int f_dir_files_iter(lua_State *L) {
1308         DIR *d;
1309         struct dirent *de;
1310  
1311 @@ -211,7 +211,7 @@
1312         }
1313  
1314         if (NULL == (r = mc_aget(mc,
1315 -                                lua_tostring(L, 1), lua_strlen(L, 1)))) {
1316 +                                (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1317  
1318                 lua_pushboolean(L, 0);
1319                 return 1;
1320 @@ -248,7 +248,7 @@
1321         }
1322  
1323         if (NULL == (r = mc_aget(mc,
1324 -                                lua_tostring(L, 1), lua_strlen(L, 1)))) {
1325 +                                (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1326                 lua_pushnil(L);
1327                 return 1;
1328         }
1329 @@ -285,7 +285,7 @@
1330         }
1331  
1332         if (NULL == (r = mc_aget(mc,
1333 -                                lua_tostring(L, 1), lua_strlen(L, 1)))) {
1334 +                                (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1335                 lua_pushnil(L);
1336                 return 1;
1337         }
1338 Index: src/mod_simple_vhost.c
1339 ===================================================================
1340 --- src/mod_simple_vhost.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
1341 +++ src/mod_simple_vhost.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
1342 @@ -270,6 +270,7 @@
1343  }
1344  
1345  
1346 +int mod_simple_vhost_plugin_init(plugin *p);
1347  int mod_simple_vhost_plugin_init(plugin *p) {
1348         p->version     = LIGHTTPD_VERSION_ID;
1349         p->name        = buffer_init_string("simple_vhost");
1350 Index: src/mod_userdir.c
1351 ===================================================================
1352 --- src/mod_userdir.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
1353 +++ src/mod_userdir.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
1354 @@ -314,6 +314,7 @@
1355  
1356  /* this function is called at dlopen() time and inits the callbacks */
1357  
1358 +int mod_userdir_plugin_init(plugin *p);
1359  int mod_userdir_plugin_init(plugin *p) {
1360         p->version     = LIGHTTPD_VERSION_ID;
1361         p->name        = buffer_init_string("userdir");
1362 Index: src/mod_proxy.c
1363 ===================================================================
1364 --- src/mod_proxy.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
1365 +++ src/mod_proxy.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
1366 @@ -332,7 +332,7 @@
1367         return HANDLER_GO_ON;
1368  }
1369  
1370 -void proxy_connection_close(server *srv, handler_ctx *hctx) {
1371 +static void proxy_connection_close(server *srv, handler_ctx *hctx) {
1372         plugin_data *p;
1373         connection *con;
1374  
1375 @@ -395,7 +395,7 @@
1376         return 0;
1377  }
1378  
1379 -void proxy_set_header(connection *con, const char *key, const char *value) {
1380 +static void proxy_set_header(connection *con, const char *key, const char *value) {
1381      data_string *ds_dst;
1382  
1383      if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
1384 @@ -407,7 +407,7 @@
1385      array_insert_unique(con->request.headers, (data_unset *)ds_dst);
1386  }
1387  
1388 -void proxy_append_header(connection *con, const char *key, const char *value) {
1389 +static void proxy_append_header(connection *con, const char *key, const char *value) {
1390      data_string *ds_dst;
1391  
1392      if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
1393 @@ -1209,7 +1209,7 @@
1394  
1395                 if (ndx >= (int) extension->value->used) {
1396                         /* didn't found a higher id, wrap to the start */
1397 -                       for (ndx = 0; ndx < (int) k; ndx++) {
1398 +                       for (ndx = 0; ndx <= (int) k; ndx++) {
1399                                 host = (data_proxy *)extension->value->data[ndx];
1400                                 if (!host->is_disabled) break;
1401                         }
1402 @@ -1321,6 +1321,7 @@
1403  }
1404  
1405  
1406 +int mod_proxy_plugin_init(plugin *p);
1407  int mod_proxy_plugin_init(plugin *p) {
1408         p->version      = LIGHTTPD_VERSION_ID;
1409         p->name         = buffer_init_string("proxy");
1410 Index: src/mod_extforward.c
1411 ===================================================================
1412 --- src/mod_extforward.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
1413 +++ src/mod_extforward.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
1414 @@ -294,7 +294,7 @@
1415         return NULL;
1416  }
1417  
1418 -struct addrinfo *ipstr_to_sockaddr(const char *host)
1419 +static struct addrinfo *ipstr_to_sockaddr(const char *host)
1420  {
1421     struct addrinfo hints, *res0;
1422     int result;
1423 @@ -479,6 +479,7 @@
1424  
1425  /* this function is called at dlopen() time and inits the callbacks */
1426  
1427 +int mod_extforward_plugin_init(plugin *p);
1428  int mod_extforward_plugin_init(plugin *p) {
1429         p->version     = LIGHTTPD_VERSION_ID;
1430         p->name        = buffer_init_string("extforward");
1431 Index: src/Makefile.am
1432 ===================================================================
1433 --- src/Makefile.am     (.../tags/lighttpd-1.4.22)      (revision 2475)
1434 +++ src/Makefile.am     (.../branches/lighttpd-1.4.x)   (revision 2475)
1435 @@ -2,21 +2,37 @@
1436  
1437  noinst_PROGRAMS=proc_open lemon # simple-fcgi #graphic evalo bench ajp ssl error_test adserver gen-license
1438  sbin_PROGRAMS=lighttpd lighttpd-angel
1439 -bin_PROGRAMS=spawn-fcgi
1440  LEMON=$(top_builddir)/src/lemon$(EXEEXT)
1441  
1442  lemon_SOURCES=lemon.c
1443  
1444  lighttpd_angel_SOURCES=lighttpd-angel.c
1445  
1446 -#simple_fcgi_SOURCES=simple-fcgi.c
1447 -#simple_fcgi_LDADD=-lfcgi
1448 +.PHONY: versionstamp parsers
1449  
1450 +all: versionstamp
1451 +
1452 +versionstamp:
1453 +       @test -f versionstamp.h || touch versionstamp.h; \
1454 +       REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
1455 +       if test $$REVISION = "exported"; then \
1456 +               REVISION="$$(LANG=C cd "$(top_srcdir)"; git describe --always 2>/dev/null)"; \
1457 +       fi; \
1458 +       if test -n "$$REVISION"; then \
1459 +               echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
1460 +       else \
1461 +               echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
1462 +       fi; \
1463 +       if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
1464 +               mv versionstamp.h.tmp versionstamp.h; \
1465 +       else \
1466 +               rm versionstamp.h.tmp; \
1467 +       fi
1468 +
1469  if CROSS_COMPILING
1470  configparser.c configparser.h:
1471  mod_ssi_exprparser.c mod_ssi_exprparser.h:
1472  
1473 -.PHONY: parsers
1474  parsers:
1475  else
1476  configparser.h: configparser.c
1477 @@ -29,12 +45,12 @@
1478         rm -f mod_ssi_exprparser.h
1479         $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
1480  
1481 -.PHONY: parsers
1482  parsers: configparser.c mod_ssi_exprparser.c
1483  endif
1484  
1485  BUILT_SOURCES = parsers
1486  MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
1487 +CLEANFILES = versionstamp.h versionstamp.h.tmp
1488  
1489  common_src=buffer.c log.c \
1490        keyvalue.c chunk.c  \
1491 @@ -58,8 +74,6 @@
1492  src = server.c response.c connections.c network.c \
1493        configfile.c configparser.c request.c proc_open.c
1494  
1495 -spawn_fcgi_SOURCES=spawn-fcgi.c
1496 -
1497  lib_LTLIBRARIES =
1498  
1499  if NO_RDYNAMIC
1500 @@ -259,9 +273,10 @@
1501        configparser.h mod_ssi_exprparser.h \
1502        sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
1503        splaytree.h proc_open.h status_counter.h \
1504 -      mod_magnet_cache.h
1505 +      mod_magnet_cache.h \
1506 +      version.h
1507  
1508 -DEFS= @DEFS@ -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
1509 +DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
1510  
1511  lighttpd_SOURCES = $(src)
1512  lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
1513 @@ -287,3 +302,4 @@
1514  
1515  noinst_HEADERS   = $(hdr)
1516  EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
1517 +
1518 Index: src/config.h.cmake
1519 ===================================================================
1520 Index: src/mod_expire.c
1521 ===================================================================
1522 --- src/mod_expire.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
1523 +++ src/mod_expire.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
1524 @@ -354,6 +354,7 @@
1525  
1526  /* this function is called at dlopen() time and inits the callbacks */
1527  
1528 +int mod_expire_plugin_init(plugin *p);
1529  int mod_expire_plugin_init(plugin *p) {
1530         p->version     = LIGHTTPD_VERSION_ID;
1531         p->name        = buffer_init_string("expire");
1532 Index: src/mod_redirect.c
1533 ===================================================================
1534 --- src/mod_redirect.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
1535 +++ src/mod_redirect.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
1536 @@ -271,6 +271,7 @@
1537  }
1538  
1539  
1540 +int mod_redirect_plugin_init(plugin *p);
1541  int mod_redirect_plugin_init(plugin *p) {
1542         p->version     = LIGHTTPD_VERSION_ID;
1543         p->name        = buffer_init_string("redirect");
1544 Index: src/mod_usertrack.c
1545 ===================================================================
1546 --- src/mod_usertrack.c (.../tags/lighttpd-1.4.22)      (revision 2475)
1547 +++ src/mod_usertrack.c (.../branches/lighttpd-1.4.x)   (revision 2475)
1548 @@ -255,6 +255,7 @@
1549  
1550  /* this function is called at dlopen() time and inits the callbacks */
1551  
1552 +int mod_usertrack_plugin_init(plugin *p);
1553  int mod_usertrack_plugin_init(plugin *p) {
1554         p->version     = LIGHTTPD_VERSION_ID;
1555         p->name        = buffer_init_string("usertrack");
1556 Index: src/mod_webdav.c
1557 ===================================================================
1558 --- src/mod_webdav.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
1559 +++ src/mod_webdav.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
1560 @@ -1096,7 +1096,7 @@
1561  }
1562  #endif
1563  
1564 -int webdav_lockdiscovery(server *srv, connection *con,
1565 +static int webdav_lockdiscovery(server *srv, connection *con,
1566                 buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
1567  
1568         buffer *b;
1569 @@ -1156,7 +1156,7 @@
1570   *
1571   *
1572   */
1573 -int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
1574 +static int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
1575         int has_lock = 1;
1576  
1577  #ifdef USE_LOCKS
1578 @@ -2474,6 +2474,7 @@
1579  
1580  /* this function is called at dlopen() time and inits the callbacks */
1581  
1582 +int mod_webdav_plugin_init(plugin *p);
1583  int mod_webdav_plugin_init(plugin *p) {
1584         p->version     = LIGHTTPD_VERSION_ID;
1585         p->name        = buffer_init_string("webdav");
1586 Index: src/mod_status.c
1587 ===================================================================
1588 --- src/mod_status.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
1589 +++ src/mod_status.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
1590 @@ -18,6 +18,7 @@
1591  #include "plugin.h"
1592  
1593  #include "inet_ntop_cache.h"
1594 +#include "version.h"
1595  
1596  typedef struct {
1597         buffer *config_url;
1598 @@ -701,7 +702,7 @@
1599                            "  <title>Status</title>\n"
1600                            " </head>\n"
1601                            " <body>\n"
1602 -                          "  <h1>" PACKAGE_NAME " " PACKAGE_VERSION "</h1>\n"
1603 +                          "  <h1>" PACKAGE_DESC "</h1>\n"
1604                            "  <table summary=\"status\" border=\"1\">\n"));
1605  
1606         mod_status_header_append(b, "Server-Features");
1607 @@ -853,6 +854,7 @@
1608         return HANDLER_GO_ON;
1609  }
1610  
1611 +int mod_status_plugin_init(plugin *p);
1612  int mod_status_plugin_init(plugin *p) {
1613         p->version     = LIGHTTPD_VERSION_ID;
1614         p->name        = buffer_init_string("status");
1615 Index: src/mod_compress.c
1616 ===================================================================
1617 --- src/mod_compress.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
1618 +++ src/mod_compress.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
1619 @@ -104,7 +104,7 @@
1620  }
1621  
1622  /* 0 on success, -1 for error */
1623 -int mkdir_recursive(char *dir) {
1624 +static int mkdir_recursive(char *dir) {
1625         char *p = dir;
1626  
1627         if (!dir || !dir[0])
1628 @@ -126,7 +126,7 @@
1629  }
1630  
1631  /* 0 on success, -1 for error */
1632 -int mkdir_for_file(char *filename) {
1633 +static int mkdir_for_file(char *filename) {
1634         char *p = filename;
1635  
1636         if (!filename || !filename[0])
1637 @@ -815,6 +815,7 @@
1638         return HANDLER_GO_ON;
1639  }
1640  
1641 +int mod_compress_plugin_init(plugin *p);
1642  int mod_compress_plugin_init(plugin *p) {
1643         p->version     = LIGHTTPD_VERSION_ID;
1644         p->name        = buffer_init_string("compress");
1645 Index: src/mod_ssi.c
1646 ===================================================================
1647 --- src/mod_ssi.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
1648 +++ src/mod_ssi.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
1649 @@ -37,6 +37,7 @@
1650  #endif
1651  
1652  #include "etag.h"
1653 +#include "version.h"
1654  
1655  /* The newest modified time of included files for include statement */
1656  static volatile time_t include_file_last_mtime = 0;
1657 @@ -139,7 +140,7 @@
1658         return HANDLER_GO_ON;
1659  }
1660  
1661 -int ssi_env_add(array *env, const char *key, const char *val) {
1662 +static int ssi_env_add(array *env, const char *key, const char *val) {
1663         data_string *ds;
1664  
1665         if (NULL == (ds = (data_string *)array_get_unused_element(env, TYPE_STRING))) {
1666 @@ -216,7 +217,7 @@
1667  
1668         array_reset(p->ssi_cgi_env);
1669  
1670 -       ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
1671 +       ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_DESC);
1672         ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_NAME"),
1673  #ifdef HAVE_IPV6
1674                      inet_ntop(srv_sock->addr.plain.sa_family,
1675 @@ -1125,6 +1126,7 @@
1676  
1677  /* this function is called at dlopen() time and inits the callbacks */
1678  
1679 +int mod_ssi_plugin_init(plugin *p);
1680  int mod_ssi_plugin_init(plugin *p) {
1681         p->version     = LIGHTTPD_VERSION_ID;
1682         p->name        = buffer_init_string("ssi");
1683 Index: src/mod_auth.c
1684 ===================================================================
1685 --- src/mod_auth.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
1686 +++ src/mod_auth.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
1687 @@ -313,20 +313,20 @@
1688  
1689         config_values_t cv[] = {
1690                 { "auth.backend",                   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
1691 -               { "auth.backend.plain.groupfile",   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1692 -               { "auth.backend.plain.userfile",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1693 -               { "auth.require",                   NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },
1694 -               { "auth.backend.ldap.hostname",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1695 -               { "auth.backend.ldap.base-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1696 -               { "auth.backend.ldap.filter",       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1697 -               { "auth.backend.ldap.ca-file",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1698 -               { "auth.backend.ldap.starttls",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
1699 -               { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1700 +               { "auth.backend.plain.groupfile",   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
1701 +               { "auth.backend.plain.userfile",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
1702 +               { "auth.require",                   NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },  /* 3 */
1703 +               { "auth.backend.ldap.hostname",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
1704 +               { "auth.backend.ldap.base-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
1705 +               { "auth.backend.ldap.filter",       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
1706 +               { "auth.backend.ldap.ca-file",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
1707 +               { "auth.backend.ldap.starttls",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
1708 +               { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
1709                 { "auth.backend.ldap.bind-pw",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
1710 -               { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
1711 -               { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1712 -               { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1713 -               { "auth.debug",                     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 13 */
1714 +               { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
1715 +               { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
1716 +               { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
1717 +               { "auth.debug",                     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 14 */
1718                 { NULL,                             NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
1719         };
1720  
1721 @@ -614,6 +614,7 @@
1722  #endif
1723  }
1724  
1725 +int mod_auth_plugin_init(plugin *p);
1726  int mod_auth_plugin_init(plugin *p) {
1727         p->version     = LIGHTTPD_VERSION_ID;
1728         p->name        = buffer_init_string("auth");
1729 Index: src/mod_cml_lua.c
1730 ===================================================================
1731 --- src/mod_cml_lua.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
1732 +++ src/mod_cml_lua.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
1733 @@ -105,7 +105,7 @@
1734  }
1735  
1736  
1737 -int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
1738 +static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
1739         size_t is_key = 1;
1740         size_t i;
1741         char *key = NULL, *val = NULL;
1742 Index: src/version.h
1743 ===================================================================
1744 --- src/version.h       (.../tags/lighttpd-1.4.22)      (revision 0)
1745 +++ src/version.h       (.../branches/lighttpd-1.4.x)   (revision 2475)
1746 @@ -0,0 +1,12 @@
1747 +#ifndef _VERSION_H_
1748 +#define _VERSION_H_
1749 +
1750 +#ifdef HAVE_VERSION_H
1751 +#include "versionstamp.h"
1752 +#else
1753 +#define REPO_VERSION ""
1754 +#endif
1755 +
1756 +#define PACKAGE_DESC PACKAGE_NAME "/" PACKAGE_VERSION REPO_VERSION
1757 +
1758 +#endif
1759 Index: src/mod_evasive.c
1760 ===================================================================
1761 --- src/mod_evasive.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
1762 +++ src/mod_evasive.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
1763 @@ -186,6 +186,7 @@
1764  }
1765  
1766  
1767 +int mod_evasive_plugin_init(plugin *p);
1768  int mod_evasive_plugin_init(plugin *p) {
1769         p->version     = LIGHTTPD_VERSION_ID;
1770         p->name        = buffer_init_string("evasive");
1771 Index: src/mod_setenv.c
1772 ===================================================================
1773 --- src/mod_setenv.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
1774 +++ src/mod_setenv.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
1775 @@ -230,6 +230,7 @@
1776  
1777  /* this function is called at dlopen() time and inits the callbacks */
1778  
1779 +int mod_setenv_plugin_init(plugin *p);
1780  int mod_setenv_plugin_init(plugin *p) {
1781         p->version     = LIGHTTPD_VERSION_ID;
1782         p->name        = buffer_init_string("setenv");
1783 Index: src/mod_indexfile.c
1784 ===================================================================
1785 --- src/mod_indexfile.c (.../tags/lighttpd-1.4.22)      (revision 2475)
1786 +++ src/mod_indexfile.c (.../branches/lighttpd-1.4.x)   (revision 2475)
1787 @@ -206,6 +206,7 @@
1788  
1789  /* this function is called at dlopen() time and inits the callbacks */
1790  
1791 +int mod_indexfile_plugin_init(plugin *p);
1792  int mod_indexfile_plugin_init(plugin *p) {
1793         p->version     = LIGHTTPD_VERSION_ID;
1794         p->name        = buffer_init_string("indexfile");
1795 Index: src/mod_uploadprogress.c
1796 ===================================================================
1797 Index: src/mod_fastcgi.c
1798 ===================================================================
1799 --- src/mod_fastcgi.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
1800 +++ src/mod_fastcgi.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
1801 @@ -49,6 +49,8 @@
1802  #include <sys/wait.h>
1803  #endif
1804  
1805 +#include "version.h"
1806 +
1807  #define FCGI_ENV_ADD_CHECK(ret, con) \
1808         if (ret == -1) { \
1809                 con->http_status = 400; \
1810 @@ -389,7 +391,7 @@
1811  /* ok, we need a prototype */
1812  static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
1813  
1814 -int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1815 +static int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1816         buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
1817         buffer_append_string_buffer(b, host->id);
1818         if (proc) {
1819 @@ -400,7 +402,7 @@
1820         return 0;
1821  }
1822  
1823 -int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1824 +static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1825  #define CLEAN(x) \
1826         fastcgi_status_copy_procname(b, host, proc); \
1827         buffer_append_string_len(b, CONST_STR_LEN(x)); \
1828 @@ -465,7 +467,7 @@
1829         free(hctx);
1830  }
1831  
1832 -fcgi_proc *fastcgi_process_init() {
1833 +static fcgi_proc *fastcgi_process_init() {
1834         fcgi_proc *f;
1835  
1836         f = calloc(1, sizeof(*f));
1837 @@ -478,7 +480,7 @@
1838         return f;
1839  }
1840  
1841 -void fastcgi_process_free(fcgi_proc *f) {
1842 +static void fastcgi_process_free(fcgi_proc *f) {
1843         if (!f) return;
1844  
1845         fastcgi_process_free(f->next);
1846 @@ -489,7 +491,7 @@
1847         free(f);
1848  }
1849  
1850 -fcgi_extension_host *fastcgi_host_init() {
1851 +static fcgi_extension_host *fastcgi_host_init() {
1852         fcgi_extension_host *f;
1853  
1854         f = calloc(1, sizeof(*f));
1855 @@ -506,7 +508,7 @@
1856         return f;
1857  }
1858  
1859 -void fastcgi_host_free(fcgi_extension_host *h) {
1860 +static void fastcgi_host_free(fcgi_extension_host *h) {
1861         if (!h) return;
1862  
1863         buffer_free(h->id);
1864 @@ -525,7 +527,7 @@
1865  
1866  }
1867  
1868 -fcgi_exts *fastcgi_extensions_init() {
1869 +static fcgi_exts *fastcgi_extensions_init() {
1870         fcgi_exts *f;
1871  
1872         f = calloc(1, sizeof(*f));
1873 @@ -533,7 +535,7 @@
1874         return f;
1875  }
1876  
1877 -void fastcgi_extensions_free(fcgi_exts *f) {
1878 +static void fastcgi_extensions_free(fcgi_exts *f) {
1879         size_t i;
1880  
1881         if (!f) return;
1882 @@ -563,7 +565,7 @@
1883         free(f);
1884  }
1885  
1886 -int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
1887 +static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
1888         fcgi_extension *fe;
1889         size_t i;
1890  
1891 @@ -1056,10 +1058,7 @@
1892                                                         "child exited with status",
1893                                                         WEXITSTATUS(status), host->bin_path);
1894                                         log_error_write(srv, __FILE__, __LINE__, "s",
1895 -                                                       "If you're trying to run PHP as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
1896 -                                                       "You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' "
1897 -                                                       "in the output, NOT '(cgi)' NOR '(cli)'.\n"
1898 -                                                       "For more information, check http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI#preparing-php-as-a-fastcgi-program"
1899 +                                                       "If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
1900                                                         "If this is PHP on Gentoo, add 'fastcgi' to the USE flags.");
1901                                 } else if (WIFSIGNALED(status)) {
1902                                         log_error_write(srv, __FILE__, __LINE__, "sd",
1903 @@ -1479,7 +1478,7 @@
1904  
1905         return 0;
1906  }
1907 -void fcgi_connection_close(server *srv, handler_ctx *hctx) {
1908 +static void fcgi_connection_close(server *srv, handler_ctx *hctx) {
1909         plugin_data *p;
1910         connection  *con;
1911  
1912 @@ -1885,10 +1884,18 @@
1913         buffer_prepare_copy(p->fcgi_env, 1024);
1914  
1915  
1916 -       FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION)),con)
1917 +       if (buffer_is_empty(con->conf.server_tag)) {
1918 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC)),con)
1919 +       } else {
1920 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag)),con)
1921 +       }
1922  
1923         if (con->server_name->used) {
1924 -               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name)),con)
1925 +               size_t len = con->server_name->used - 1;
1926 +               char *colon = strchr(con->server_name->ptr, ':');
1927 +               if (colon) len = colon - con->server_name->ptr;
1928 +
1929 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con)
1930         } else {
1931  #ifdef HAVE_IPV6
1932                 s = inet_ntop(srv_sock->addr.plain.sa_family,
1933 @@ -2060,7 +2067,7 @@
1934  
1935                         fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"),
1936                                         con->request.orig_uri->ptr + (host->strip_request_uri->used - 2),
1937 -                                       con->request.orig_uri->used - (host->strip_request_uri->used - 2));
1938 +                                       con->request.orig_uri->used - (host->strip_request_uri->used - 2) - 1);
1939                 } else {
1940                         FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)),con)
1941                 }
1942 @@ -3639,7 +3646,11 @@
1943                                 */
1944  
1945                                 /* the rewrite is only done for /prefix/? matches */
1946 -                               if (extension->key->ptr[0] == '/' &&
1947 +                               if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1948 +                                       buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1949 +                                       con->uri.path->used = 1;
1950 +                                       con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1951 +                               } else if (extension->key->ptr[0] == '/' &&
1952                                         con->uri.path->used > extension->key->used &&
1953                                         NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1954                                         /* rewrite uri.path and pathinfo */
1955 @@ -3648,10 +3659,6 @@
1956  
1957                                         con->uri.path->used -= con->request.pathinfo->used - 1;
1958                                         con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1959 -                               } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1960 -                                       buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1961 -                                       con->uri.path->used = 1;
1962 -                                       con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1963                                 }
1964                         }
1965                 }
1966 @@ -3916,6 +3923,7 @@
1967  }
1968  
1969  
1970 +int mod_fastcgi_plugin_init(plugin *p);
1971  int mod_fastcgi_plugin_init(plugin *p) {
1972         p->version      = LIGHTTPD_VERSION_ID;
1973         p->name         = buffer_init_string("fastcgi");
1974 Index: src/CMakeLists.txt
1975 ===================================================================
1976 Index: src/mod_access.c
1977 ===================================================================
1978 --- src/mod_access.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
1979 +++ src/mod_access.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
1980 @@ -175,6 +175,7 @@
1981  }
1982  
1983  
1984 +int mod_access_plugin_init(plugin *p);
1985  int mod_access_plugin_init(plugin *p) {
1986         p->version     = LIGHTTPD_VERSION_ID;
1987         p->name        = buffer_init_string("access");
1988 Index: src/mod_accesslog.c
1989 ===================================================================
1990 --- src/mod_accesslog.c (.../tags/lighttpd-1.4.22)      (revision 2475)
1991 +++ src/mod_accesslog.c (.../branches/lighttpd-1.4.x)   (revision 2475)
1992 @@ -156,7 +156,7 @@
1993         return p;
1994  }
1995  
1996 -int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
1997 +static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
1998         size_t i, j, k = 0, start = 0;
1999  
2000         if (format->used == 0) return -1;
2001 @@ -475,74 +475,9 @@
2002  
2003                 if (s->access_logfile->used < 2) continue;
2004  
2005 -               if (s->access_logfile->ptr[0] == '|') {
2006 -#ifdef HAVE_FORK
2007 -                       /* create write pipe and spawn process */
2008 -
2009 -                       int to_log_fds[2];
2010 -                       pid_t pid;
2011 -
2012 -                       if (pipe(to_log_fds)) {
2013 -                               log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
2014 -                               return HANDLER_ERROR;
2015 -                       }
2016 -
2017 -                       /* fork, execve */
2018 -                       switch (pid = fork()) {
2019 -                       case 0:
2020 -                               /* child */
2021 -
2022 -                               close(STDIN_FILENO);
2023 -                               dup2(to_log_fds[0], STDIN_FILENO);
2024 -                               close(to_log_fds[0]);
2025 -                               /* not needed */
2026 -                               close(to_log_fds[1]);
2027 -
2028 -                               openDevNull(STDERR_FILENO);
2029 -
2030 -                               /* we don't need the client socket */
2031 -                               for (i = 3; i < 256; i++) {
2032 -                                       close(i);
2033 -                               }
2034 -
2035 -                               /* exec the log-process (skip the | )
2036 -                                *
2037 -                                */
2038 -
2039 -                               execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, (char *)NULL);
2040 -
2041 -                               log_error_write(srv, __FILE__, __LINE__, "sss",
2042 -                                               "spawning log-process failed: ", strerror(errno),
2043 -                                               s->access_logfile->ptr + 1);
2044 -
2045 -                               exit(-1);
2046 -                               break;
2047 -                       case -1:
2048 -                               /* error */
2049 -                               log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
2050 -                               break;
2051 -                       default:
2052 -                               close(to_log_fds[0]);
2053 -
2054 -                               s->log_access_fd = to_log_fds[1];
2055 -
2056 -                               break;
2057 -                       }
2058 -#else
2059 -                       return -1;
2060 -#endif
2061 -               } else if (-1 == (s->log_access_fd =
2062 -                                 open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2063 -
2064 -                       log_error_write(srv, __FILE__, __LINE__, "ssb",
2065 -                                       "opening access-log failed:",
2066 -                                       strerror(errno), s->access_logfile);
2067 -
2068 +               if (-1 == (s->log_access_fd = open_logfile_or_pipe(srv, s->access_logfile->ptr)))
2069                         return HANDLER_ERROR;
2070 -               }
2071 -#ifdef FD_CLOEXEC
2072 -               fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
2073 -#endif
2074 +
2075         }
2076  
2077         return HANDLER_GO_ON;
2078 @@ -876,6 +811,7 @@
2079  }
2080  
2081  
2082 +int mod_accesslog_plugin_init(plugin *p);
2083  int mod_accesslog_plugin_init(plugin *p) {
2084         p->version     = LIGHTTPD_VERSION_ID;
2085         p->name        = buffer_init_string("accesslog");
2086 Index: src/server.c
2087 ===================================================================
2088 --- src/server.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
2089 +++ src/server.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
2090 @@ -29,6 +29,7 @@
2091  #include "plugin.h"
2092  #include "joblist.h"
2093  #include "network_backends.h"
2094 +#include "version.h"
2095  
2096  #ifdef HAVE_GETOPT_H
2097  #include <getopt.h>
2098 @@ -64,6 +65,17 @@
2099  /* #define USE_ALARM */
2100  #endif
2101  
2102 +#ifdef HAVE_GETUID
2103 +# ifndef HAVE_ISSETUGID
2104 +
2105 +static int l_issetugid() {
2106 +       return (geteuid() != getuid() || getegid() != getgid());
2107 +}
2108 +
2109 +#  define issetugid l_issetugid
2110 +# endif
2111 +#endif
2112 +
2113  static volatile sig_atomic_t srv_shutdown = 0;
2114  static volatile sig_atomic_t graceful_shutdown = 0;
2115  static volatile sig_atomic_t handle_sig_alarm = 1;
2116 @@ -325,7 +337,7 @@
2117  #else
2118  # define TEXT_SSL
2119  #endif
2120 -       char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL \
2121 +       char *b = PACKAGE_DESC TEXT_SSL \
2122  " - a light and fast webserver\n" \
2123  "Build-Date: " __DATE__ " " __TIME__ "\n";
2124  ;
2125 @@ -462,7 +474,7 @@
2126  #else
2127  # define TEXT_SSL
2128  #endif
2129 -       char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
2130 +       char *b = PACKAGE_DESC TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
2131  " - a light and fast webserver\n" \
2132  "usage:\n" \
2133  " -f <name>  filename of the config-file\n" \
2134 @@ -589,7 +601,7 @@
2135  
2136         /* UID handling */
2137  #ifdef HAVE_GETUID
2138 -       if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
2139 +       if (!i_am_root && issetugid()) {
2140                 /* we are setuid-root */
2141  
2142                 log_error_write(srv, __FILE__, __LINE__, "s",
2143 Index: src/mod_dirlisting.c
2144 ===================================================================
2145 --- src/mod_dirlisting.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
2146 +++ src/mod_dirlisting.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
2147 @@ -31,6 +31,8 @@
2148  #include <attr/attributes.h>
2149  #endif
2150  
2151 +#include "version.h"
2152 +
2153  /* plugin config for all request/connections */
2154  
2155  typedef struct {
2156 @@ -73,7 +75,7 @@
2157         plugin_config conf;
2158  } plugin_data;
2159  
2160 -excludes_buffer *excludes_buffer_init(void) {
2161 +static excludes_buffer *excludes_buffer_init(void) {
2162         excludes_buffer *exb;
2163  
2164         exb = calloc(1, sizeof(*exb));
2165 @@ -81,7 +83,7 @@
2166         return exb;
2167  }
2168  
2169 -int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
2170 +static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
2171  #ifdef HAVE_PCRE_H
2172         size_t i;
2173         const char *errptr;
2174 @@ -128,7 +130,7 @@
2175  #endif
2176  }
2177  
2178 -void excludes_buffer_free(excludes_buffer *exb) {
2179 +static void excludes_buffer_free(excludes_buffer *exb) {
2180  #ifdef HAVE_PCRE_H
2181         size_t i;
2182  
2183 @@ -578,7 +580,7 @@
2184         if (p->conf.set_footer->used > 1) {
2185                 buffer_append_string_buffer(out, p->conf.set_footer);
2186         } else if (buffer_is_empty(con->conf.server_tag)) {
2187 -               buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_NAME "/" PACKAGE_VERSION));
2188 +               buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_DESC));
2189         } else {
2190                 buffer_append_string_buffer(out, con->conf.server_tag);
2191         }
2192 @@ -904,6 +906,7 @@
2193  
2194  /* this function is called at dlopen() time and inits the callbacks */
2195  
2196 +int mod_dirlisting_plugin_init(plugin *p);
2197  int mod_dirlisting_plugin_init(plugin *p) {
2198         p->version     = LIGHTTPD_VERSION_ID;
2199         p->name        = buffer_init_string("dirlisting");
2200 Index: src/mod_magnet.c
2201 ===================================================================
2202 --- src/mod_magnet.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
2203 +++ src/mod_magnet.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
2204 @@ -365,6 +365,8 @@
2205                 MAGNET_ENV_REQUEST_METHOD,
2206                 MAGNET_ENV_REQUEST_URI,
2207                 MAGNET_ENV_REQUEST_ORIG_URI,
2208 +               MAGNET_ENV_REQUEST_PATH_INFO,
2209 +               MAGNET_ENV_REQUEST_REMOTE_IP,
2210                 MAGNET_ENV_REQUEST_PROTOCOL
2211                 } type;
2212  } magnet_env_t;
2213 @@ -387,6 +389,8 @@
2214                 { "request.method", MAGNET_ENV_REQUEST_METHOD },
2215                 { "request.uri", MAGNET_ENV_REQUEST_URI },
2216                 { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
2217 +               { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
2218 +               { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
2219                 { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
2220  
2221                 { NULL, MAGNET_ENV_UNSET }
2222 @@ -420,6 +424,8 @@
2223                 break;
2224         case MAGNET_ENV_REQUEST_URI:      dest = con->request.uri; break;
2225         case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
2226 +       case MAGNET_ENV_REQUEST_PATH_INFO: dest = con->request.pathinfo; break;
2227 +       case MAGNET_ENV_REQUEST_REMOTE_IP: dest = con->dst_addr_buf; break;
2228         case MAGNET_ENV_REQUEST_PROTOCOL:
2229                 buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
2230                 dest = srv->tmp_buf;
2231 @@ -840,6 +846,7 @@
2232  
2233  /* this function is called at dlopen() time and inits the callbacks */
2234  
2235 +int mod_magnet_plugin_init(plugin *p);
2236  int mod_magnet_plugin_init(plugin *p) {
2237         p->version     = LIGHTTPD_VERSION_ID;
2238         p->name        = buffer_init_string("magnet");
2239 @@ -856,6 +863,7 @@
2240  }
2241  
2242  #else
2243 +int mod_magnet_plugin_init(plugin *p);
2244  int mod_magnet_plugin_init(plugin *p) {
2245         UNUSED(p);
2246         return -1;
2247 Index: src/log.c
2248 ===================================================================
2249 --- src/log.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
2250 +++ src/log.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
2251 @@ -54,13 +54,94 @@
2252         return (tmpfd != -1) ? 0 : -1;
2253  }
2254  
2255 +int open_logfile_or_pipe(server *srv, const char* logfile) {
2256 +       int fd;
2257 +
2258 +       if (logfile[0] == '|') {
2259 +#ifdef HAVE_FORK
2260 +               /* create write pipe and spawn process */
2261 +
2262 +               int to_log_fds[2];
2263 +               pid_t pid;
2264 +               int i;
2265 +
2266 +               if (pipe(to_log_fds)) {
2267 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
2268 +                       return -1;
2269 +               }
2270 +
2271 +               /* fork, execve */
2272 +               switch (pid = fork()) {
2273 +               case 0:
2274 +                       /* child */
2275 +                       close(STDIN_FILENO);
2276 +
2277 +                       /* dup the filehandle to STDIN */
2278 +                       if (to_log_fds[0] != STDIN_FILENO) {
2279 +                               if (STDIN_FILENO != dup2(to_log_fds[0], STDIN_FILENO)) {
2280 +                                       log_error_write(srv, __FILE__, __LINE__, "ss",
2281 +                                               "dup2 failed: ", strerror(errno));
2282 +                                       exit(-1);
2283 +                               }
2284 +                               close(to_log_fds[0]);
2285 +                       }
2286 +                       close(to_log_fds[1]);
2287 +
2288 +#ifndef FD_CLOEXEC
2289 +                       /* we don't need the client socket */
2290 +                       for (i = 3; i < 256; i++) {
2291 +                               close(i);
2292 +                       }
2293 +#endif
2294 +
2295 +                       /* close old stderr */
2296 +                       openDevNull(STDERR_FILENO);
2297 +
2298 +                       /* exec the log-process (skip the | ) */
2299 +                       execl("/bin/sh", "sh", "-c", logfile + 1, NULL);
2300 +                       log_error_write(srv, __FILE__, __LINE__, "sss",
2301 +                                       "spawning log process failed: ", strerror(errno),
2302 +                                       logfile + 1);
2303 +
2304 +                       exit(-1);
2305 +                       break;
2306 +               case -1:
2307 +                       /* error */
2308 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
2309 +                       return -1;
2310 +               default:
2311 +                       close(to_log_fds[0]);
2312 +                       fd = to_log_fds[1];
2313 +                       break;
2314 +               }
2315 +
2316 +#else
2317 +               return -1;
2318 +#endif
2319 +       } else if (-1 == (fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2320 +               log_error_write(srv, __FILE__, __LINE__, "SSSS",
2321 +                               "opening errorlog '", logfile,
2322 +                               "' failed: ", strerror(errno));
2323 +
2324 +               return -1;
2325 +       }
2326 +
2327 +#ifdef FD_CLOEXEC
2328 +       fcntl(fd, F_SETFD, FD_CLOEXEC);
2329 +#endif
2330 +
2331 +       return fd;
2332 +}
2333 +
2334 +
2335  /**
2336   * open the errorlog
2337   *
2338 - * we have 3 possibilities:
2339 + * we have 4 possibilities:
2340   * - stderr (default)
2341   * - syslog
2342   * - logfile
2343 + * - pipe
2344   *
2345   * if the open failed, report to the user and die
2346   *
2347 @@ -80,18 +161,10 @@
2348         } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
2349                 const char *logfile = srv->srvconf.errorlog_file->ptr;
2350  
2351 -               if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2352 -                       log_error_write(srv, __FILE__, __LINE__, "SSSS",
2353 -                                       "opening errorlog '", logfile,
2354 -                                       "' failed: ", strerror(errno));
2355 -
2356 +               if (-1 == (srv->errorlog_fd = open_logfile_or_pipe(srv, logfile))) {
2357                         return -1;
2358                 }
2359 -#ifdef FD_CLOEXEC
2360 -               /* close fd on exec (cgi) */
2361 -               fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
2362 -#endif
2363 -               srv->errorlog_mode = ERRORLOG_FILE;
2364 +               srv->errorlog_mode = (logfile[0] == '|') ? ERRORLOG_PIPE : ERRORLOG_FILE;
2365         }
2366  
2367         log_error_write(srv, __FILE__, __LINE__, "s", "server started");
2368 @@ -122,7 +195,7 @@
2369   */
2370  
2371  int log_error_cycle(server *srv) {
2372 -       /* only cycle if we are not in syslog-mode */
2373 +       /* only cycle if the error log is a file */
2374  
2375         if (srv->errorlog_mode == ERRORLOG_FILE) {
2376                 const char *logfile = srv->srvconf.errorlog_file->ptr;
2377 @@ -130,7 +203,7 @@
2378  
2379                 int new_fd;
2380  
2381 -               if (-1 == (new_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2382 +               if (-1 == (new_fd = open_logfile_or_pipe(srv, logfile))) {
2383                         /* write to old log */
2384                         log_error_write(srv, __FILE__, __LINE__, "SSSSS",
2385                                         "cycling errorlog '", logfile,
2386 @@ -158,6 +231,7 @@
2387  
2388  int log_error_close(server *srv) {
2389         switch(srv->errorlog_mode) {
2390 +       case ERRORLOG_PIPE:
2391         case ERRORLOG_FILE:
2392                 close(srv->errorlog_fd);
2393                 break;
2394 @@ -177,6 +251,7 @@
2395         va_list ap;
2396  
2397         switch(srv->errorlog_mode) {
2398 +       case ERRORLOG_PIPE:
2399         case ERRORLOG_FILE:
2400         case ERRORLOG_STDERR:
2401                 /* cache the generated timestamp */
2402 @@ -270,6 +345,7 @@
2403         va_end(ap);
2404  
2405         switch(srv->errorlog_mode) {
2406 +       case ERRORLOG_PIPE:
2407         case ERRORLOG_FILE:
2408                 buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
2409                 write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
2410 Index: src/log.h
2411 ===================================================================
2412 --- src/log.h   (.../tags/lighttpd-1.4.22)      (revision 2475)
2413 +++ src/log.h   (.../branches/lighttpd-1.4.x)   (revision 2475)
2414 @@ -10,6 +10,8 @@
2415  
2416  #define WP() log_error_write(srv, __FILE__, __LINE__, "");
2417  
2418 +int open_logfile_or_pipe(server *srv, const char* logfile);
2419 +
2420  int log_error_open(server *srv);
2421  int log_error_close(server *srv);
2422  int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...);
2423 Index: src/fdevent.c
2424 ===================================================================
2425 --- src/fdevent.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
2426 +++ src/fdevent.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
2427 @@ -92,7 +92,7 @@
2428         return 0;
2429  }
2430  
2431 -fdnode *fdnode_init() {
2432 +static fdnode *fdnode_init() {
2433         fdnode *fdn;
2434  
2435         fdn = calloc(1, sizeof(*fdn));
2436 @@ -100,7 +100,7 @@
2437         return fdn;
2438  }
2439  
2440 -void fdnode_free(fdnode *fdn) {
2441 +static void fdnode_free(fdnode *fdn) {
2442         free(fdn);
2443  }
2444  
2445 Index: tests/fcgi-responder.c
2446 ===================================================================
2447 --- tests/fcgi-responder.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
2448 +++ tests/fcgi-responder.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
2449 @@ -40,7 +40,13 @@
2450                         printf("Status: 500 Internal Foo\r\n\r\n");
2451                 }
2452  
2453 -               printf("test123");
2454 +               if (0 == strcmp(p, "path_info")) {
2455 +                       printf("%s", getenv("PATH_INFO"));
2456 +               } else if (0 == strcmp(p, "script_name")) {
2457 +                       printf("%s", getenv("SCRIPT_NAME"));
2458 +               } else {
2459 +                       printf("test123");
2460 +               }
2461         }
2462  
2463         return 0;
2464 Index: tests/mod-fastcgi.t
2465 ===================================================================
2466 --- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.22)      (revision 2475)
2467 +++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x)   (revision 2475)
2468 @@ -7,7 +7,7 @@
2469  }
2470  
2471  use strict;
2472 -use Test::More tests => 50;
2473 +use Test::More tests => 52;
2474  use LightyTest;
2475  
2476  my $tf = LightyTest->new();
2477 @@ -166,7 +166,7 @@
2478         $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ];
2479         ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
2480  
2481 -       
2482 +
2483         ok($tf->stop_proc == 0, "Stopping lighttpd");
2484  
2485  
2486 @@ -282,7 +282,7 @@
2487  
2488  
2489  SKIP: {
2490 -       skip "no fcgi-responder found", 9 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe"; 
2491 +       skip "no fcgi-responder found", 11 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
2492         
2493         $tf->{CONFIGFILE} = 'fastcgi-responder.conf';
2494         ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
2495 @@ -319,6 +319,23 @@
2496         ok($tf->handle_http($t) == 0, 'line-ending \r\n + \r\n');
2497  
2498         $t->{REQUEST}  = ( <<EOF
2499 +GET /abc/def/ghi?path_info HTTP/1.0
2500 +Host: wsgi.example.org
2501 +EOF
2502 + );
2503 +       $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/abc/def/ghi' } ];
2504 +       ok($tf->handle_http($t) == 0, 'PATH_INFO (wsgi)');
2505 +
2506 +       $t->{REQUEST}  = ( <<EOF
2507 +GET /abc/def/ghi?script_name HTTP/1.0
2508 +Host: wsgi.example.org
2509 +EOF
2510 + );
2511 +       $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
2512 +       ok($tf->handle_http($t) == 0, 'SCRIPT_NAME (wsgi)');
2513 +
2514 +
2515 +       $t->{REQUEST}  = ( <<EOF
2516  GET /index.fcgi?die-at-end HTTP/1.0
2517  Host: www.example.org
2518  EOF
2519 Index: tests/fastcgi-responder.conf
2520 ===================================================================
2521 --- tests/fastcgi-responder.conf        (.../tags/lighttpd-1.4.22)      (revision 2475)
2522 +++ tests/fastcgi-responder.conf        (.../branches/lighttpd-1.4.x)   (revision 2475)
2523 @@ -159,3 +159,15 @@
2524    server.name = "zzz.example.org"
2525  }
2526  
2527 +$HTTP["host"] == "wsgi.example.org" {
2528 +       fastcgi.server = (
2529 +               "/"  =>
2530 +                       ( (
2531 +                               "host" => "127.0.0.1", "port" => 10000,
2532 +                               "fix-root-scriptname" => "enable",
2533 +                               "check-local" => "disable",
2534 +                               "bin-path" => env.SRCDIR + "/fcgi-responder",
2535 +                               "max-procs" => 1,
2536 +                       ) ),
2537 +       )
2538 +}
2539 Index: tests/LightyTest.pm
2540 ===================================================================
2541 --- tests/LightyTest.pm (.../tags/lighttpd-1.4.22)      (revision 2475)
2542 +++ tests/LightyTest.pm (.../branches/lighttpd-1.4.x)   (revision 2475)
2543 @@ -6,7 +6,8 @@
2544  use Test::More;
2545  use Socket;
2546  use Cwd 'abs_path';
2547 -use POSIX ":sys_wait_h";
2548 +use POSIX qw(:sys_wait_h dup2);
2549 +use Errno qw(EADDRINUSE);
2550  
2551  sub mtime {
2552         my $file = shift;
2553 @@ -344,8 +345,14 @@
2554                 return -1;
2555         }
2556         if ($child == 0) {
2557 -               my $cmd = $self->{BINDIR}.'/spawn-fcgi -n -p '.$port.' -f "'.$binary.'"';
2558 -               exec $cmd or die($?);
2559 +               my $iaddr   = inet_aton('localhost') || die "no host: localhost";
2560 +               my $proto   = getprotobyname('tcp');
2561 +               socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
2562 +               setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";
2563 +               bind(SOCK, sockaddr_in($port, $iaddr)) || die "bind: $!";
2564 +               listen(SOCK, 1024) || die "listen: $!";
2565 +               dup2(fileno(SOCK), 0) || die "dup2: $!";
2566 +               exec $binary or die($?);
2567         } else {
2568                 if (0 != $self->wait_for_port_with_proc($port, $child)) {
2569                         diag(sprintf('The process %i is not up (port %i, %s)', $child, $port, $binary));
2570 Index: configure.ac
2571 ===================================================================
2572 --- configure.ac        (.../tags/lighttpd-1.4.22)      (revision 0)
2573 +++ configure.ac        (.../branches/lighttpd-1.4.x)   (revision 2475)
2574 @@ -0,0 +1,714 @@
2575 +#                                               -*- Autoconf -*-
2576 +# Process this file with autoconf to produce a configure script.
2577 +AC_PREREQ(2.57)
2578 +AC_INIT([lighttpd], [1.4.23], [jan@kneschke.de])
2579 +AC_CONFIG_SRCDIR([src/server.c])
2580 +AC_CONFIG_HEADER([config.h])
2581 +
2582 +AC_CANONICAL_TARGET
2583 +
2584 +AM_INIT_AUTOMAKE
2585 +
2586 +# Checks for programs.
2587 +AC_PROG_CC
2588 +AM_PROG_CC_C_O
2589 +AC_PROG_LD
2590 +AC_PROG_INSTALL
2591 +AC_PROG_AWK
2592 +AC_PROG_CPP
2593 +dnl AC_PROG_CXX
2594 +AC_PROG_LN_S
2595 +AC_PROG_MAKE_SET
2596 +
2597 +dnl check environment
2598 +AC_AIX
2599 +AC_ISC_POSIX
2600 +AC_MINIX
2601 +
2602 +dnl AC_CANONICAL_HOST
2603 +case $host_os in
2604 +       *darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
2605 +        * ) NO_RDYNAMIC=no;;
2606 +esac
2607 +AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
2608 +
2609 +AC_EXEEXT
2610 +
2611 +dnl more automake stuff
2612 +AM_C_PROTOTYPES
2613 +
2614 +dnl libtool
2615 +AC_DISABLE_STATIC
2616 +AC_ENABLE_SHARED
2617 +
2618 +AC_LIBTOOL_DLOPEN
2619 +AC_PROG_LIBTOOL
2620 +
2621 +dnl for solaris
2622 +CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
2623 +
2624 +# Checks for header files.
2625 +AC_HEADER_STDC
2626 +AC_HEADER_SYS_WAIT
2627 +AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
2628 +sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
2629 +getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
2630 +sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
2631 +sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
2632 +
2633 +# Checks for typedefs, structures, and compiler characteristics.
2634 +AC_C_CONST
2635 +AC_C_INLINE
2636 +AC_C_CHAR_UNSIGNED
2637 +AC_TYPE_OFF_T
2638 +AC_TYPE_PID_T
2639 +AC_TYPE_SIZE_T
2640 +
2641 +AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
2642 +AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
2643 +AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
2644 +#include <sys/socket.h>])
2645 +
2646 +# Checks for library functions.
2647 +AC_FUNC_FORK
2648 +dnl AC_FUNC_MALLOC
2649 +#AC_FUNC_MMAP
2650 +dnl AC_FUNC_REALLOC
2651 +AC_TYPE_SIGNAL
2652 +AC_FUNC_STAT
2653 +AC_FUNC_STRFTIME
2654 +AC_CHECK_FUNCS([issetugid])
2655 +
2656 +dnl Checks for database.
2657 +MYSQL_INCLUDE=""
2658 +MYSQL_LIBS=""
2659 +
2660 +AC_MSG_CHECKING(for MySQL support)
2661 +AC_ARG_WITH(mysql,
2662 +    AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']),
2663 +    [WITH_MYSQL=$withval],[WITH_MYSQL=no])
2664 +
2665 +if test "$WITH_MYSQL" != "no"; then
2666 +  AC_MSG_RESULT(yes)
2667 +  if test "$WITH_MYSQL" = "yes"; then
2668 +    AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
2669 +  else
2670 +    MYSQL_CONFIG=$WITH_MYSQL
2671 +  fi
2672 +
2673 +  if test "$MYSQL_CONFIG" = ""; then
2674 +    AC_MSG_ERROR(mysql_config is not found)
2675 +  fi
2676 +  if test \! -x $MYSQL_CONFIG; then
2677 +    AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config)
2678 +  fi
2679 +
2680 +  if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
2681 +    MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`"
2682 +  else
2683 +    MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`"
2684 +  fi
2685 +  MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
2686 +
2687 +  AC_MSG_CHECKING(for MySQL includes at)
2688 +  AC_MSG_RESULT($MYSQL_INCLUDE)
2689 +
2690 +  AC_MSG_CHECKING(for MySQL libraries at)
2691 +  AC_MSG_RESULT($MYSQL_LIBS)
2692 +dnl check for errmsg.h, which isn't installed by some versions of 3.21
2693 +  old_CPPFLAGS="$CPPFLAGS"
2694 +  CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
2695 +  AC_CHECK_HEADERS(errmsg.h mysql.h)
2696 +  CPPFLAGS="$old_CPPFLAGS"
2697 +
2698 +  AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
2699 +else
2700 +  AC_MSG_RESULT(no)
2701 +fi
2702 +
2703 +AC_SUBST(MYSQL_LIBS)
2704 +AC_SUBST(MYSQL_INCLUDE)
2705 +
2706 +dnl Check for LDAP
2707 +AC_MSG_CHECKING(for LDAP support)
2708 +AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]),
2709 +[WITH_LDAP=$withval], [WITH_LDAP=no])
2710 +AC_MSG_RESULT([$withval])
2711 +if test "$WITH_LDAP" != "no"; then
2712 + AC_CHECK_LIB(ldap, ldap_bind, [
2713 +  AC_CHECK_HEADERS([ldap.h],[
2714 +    LDAP_LIB=-lldap
2715 +    AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
2716 +    AC_DEFINE([HAVE_LDAP_H], [1])
2717 +    AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
2718 +  ])
2719 + ])
2720 + AC_SUBST(LDAP_LIB)
2721 + AC_CHECK_LIB(lber, ber_printf, [
2722 +  AC_CHECK_HEADERS([lber.h],[
2723 +    LBER_LIB=-llber
2724 +    AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
2725 +    AC_DEFINE([HAVE_LBER_H], [1])
2726 +  ])
2727 + ])
2728 + AC_SUBST(LBER_LIB)
2729 +fi
2730 +
2731 +dnl Check for xattr
2732 +AC_MSG_CHECKING(for extended attributes support)
2733 +AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]),
2734 +[WITH_ATTR=$withval],[WITH_ATTR=no])
2735 +AC_MSG_RESULT($withval)
2736 +if test "$WITH_ATTR" != "no"; then
2737 + AC_CHECK_LIB(attr, attr_get, [
2738 +       AC_CHECK_HEADERS([attr/attributes.h],[
2739 +               ATTR_LIB=-lattr
2740 +               AC_DEFINE([HAVE_XATTR], [1], [libattr])
2741 +               AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
2742 +       ])
2743 + ])
2744 + AC_SUBST(ATTR_LIB)
2745 +fi
2746 +
2747 +## openssl on solaris needs -lsocket -lnsl
2748 +AC_SEARCH_LIBS(socket,socket)
2749 +AC_SEARCH_LIBS(gethostbyname,nsl socket)
2750 +AC_SEARCH_LIBS(hstrerror,resolv)
2751 +
2752 +save_LIBS=$LIBS
2753 +AC_SEARCH_LIBS(dlopen,dl,[
2754 +  AC_CHECK_HEADERS([dlfcn.h],[
2755 +    if test "$ac_cv_search_dlopen" != no; then
2756 +      test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"
2757 +    fi
2758 +
2759 +    AC_DEFINE([HAVE_LIBDL], [1], [libdl])
2760 +    AC_DEFINE([HAVE_DLFCN_H], [1])
2761 +  ])
2762 +])
2763 +LIBS=$save_LIBS
2764 +AC_SUBST(DL_LIB)
2765 +
2766 +dnl Check for valgrind
2767 +AC_MSG_CHECKING(for valgrind)
2768 +AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]),
2769 +[WITH_VALGRIND=$withval],[WITH_VALGRIND=no])
2770 +AC_MSG_RESULT([$WITH_VALGRIND])
2771 +if test "$WITH_VALGRIND" != "no"; then
2772 + AC_CHECK_HEADERS([valgrind/valgrind.h])
2773 +fi
2774 +
2775 +dnl Check for openssl
2776 +AC_MSG_CHECKING(for OpenSSL)
2777 +AC_ARG_WITH(openssl,
2778 +    AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]),
2779 +    [WITH_OPENSSL=$withval],[WITH_OPENSSL=no])
2780 +
2781 +if test "$WITH_OPENSSL" != "no"; then
2782 +    use_openssl=yes
2783 +    if test "$WITH_OPENSSL" != "yes"; then
2784 +       CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
2785 +       LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
2786 +    fi
2787 +else
2788 +    use_openssl=no
2789 +fi
2790 +AC_MSG_RESULT([$use_openssl])
2791 +
2792 +AC_ARG_WITH(openssl-includes,
2793 +    AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
2794 +    [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
2795 +)
2796 +
2797 +AC_ARG_WITH(openssl-libs,
2798 +    AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
2799 +    [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
2800 +)
2801 +
2802 +AC_ARG_WITH(kerberos5,
2803 +    AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]),
2804 +    [ use_kerberos=yes ], [use_kerberos=no]
2805 +)
2806 +
2807 +if test "x$use_openssl" = "xyes"; then
2808 +    if test "x$use_kerberos" != "xyes"; then
2809 +        CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
2810 +    fi
2811 +
2812 +    AC_CHECK_HEADERS([openssl/ssl.h])
2813 +    OLDLIBS="$LIBS"
2814 +    AC_CHECK_LIB(crypto, BIO_f_base64, [
2815 +      AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
2816 +                                AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
2817 +    ], [], [])
2818 +    LIBS="$OLDLIBS"
2819 +    AC_SUBST(SSL_LIB)
2820 +fi
2821 +
2822 +AC_MSG_CHECKING(for perl regular expressions support)
2823 +AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
2824 +    [WITH_PCRE=$withval],[WITH_PCRE=yes])
2825 +AC_MSG_RESULT([$WITH_PCRE])
2826 +
2827 +if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
2828 +  AC_PATH_PROG(PCRECONFIG, pcre-config)
2829 +
2830 +  if test x"$PCRECONFIG" != x; then
2831 +    PCRE_LIB=`$PCRECONFIG --libs`
2832 +    CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
2833 +    AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
2834 +    AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
2835 +  else
2836 +     AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
2837 +  fi
2838 +fi
2839 +
2840 +AC_SUBST(PCRE_LIB)
2841 +
2842 +AC_MSG_CHECKING(for zlib support)
2843 +AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
2844 +    [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
2845 +AC_MSG_RESULT([$WITH_ZLIB])
2846 +
2847 +if test "$WITH_ZLIB" != "no"; then
2848 +  AC_CHECK_LIB(z, deflate, [
2849 +    AC_CHECK_HEADERS([zlib.h],[
2850 +      Z_LIB=-lz
2851 +      AC_DEFINE([HAVE_LIBZ], [1], [libz])
2852 +      AC_DEFINE([HAVE_ZLIB_H], [1])
2853 +    ])
2854 +  ])
2855 +  if test x$Z_LIB = x; then
2856 +     AC_MSG_ERROR([zlib-headers and/or libs where not found, install them or build with --without-zlib])
2857 +  fi
2858 +fi
2859 +AC_SUBST(Z_LIB)
2860 +
2861 +AC_MSG_CHECKING(for bzip2 support)
2862 +AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]),
2863 +    [WITH_BZIP2=$withval],[WITH_BZIP2=yes])
2864 +AC_MSG_RESULT([$WITH_BZIP2])
2865 +
2866 +if test "$WITH_BZIP2" != "no"; then
2867 +  AC_CHECK_LIB(bz2, BZ2_bzCompress, [
2868 +    AC_CHECK_HEADERS([bzlib.h],[
2869 +      BZ_LIB=-lbz2
2870 +      AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
2871 +      AC_DEFINE([HAVE_BZLIB_H], [1])
2872 +    ])
2873 +  ])
2874 +  if test x$BZ_LIB = x; then
2875 +     AC_MSG_ERROR([bzip2-headers and/or libs where not found, install them or build with --without-bzip2])
2876 +  fi
2877 +fi
2878 +AC_SUBST(BZ_LIB)
2879 +
2880 +if test -z "$PKG_CONFIG"; then
2881 +  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2882 +fi
2883 +
2884 +dnl Check for gamin
2885 +AC_MSG_CHECKING(for FAM)
2886 +AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
2887 +[WITH_FAM=$withval],[WITH_FAM=no])
2888 +AC_MSG_RESULT([$WITH_FAM])
2889 +
2890 +if test "$WITH_FAM" != "no"; then
2891 +  AC_CHECK_LIB(fam, FAMOpen2, [
2892 +    AC_CHECK_HEADERS([fam.h],[
2893 +      FAM_LIBS=-lfam
2894 +      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
2895 +      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
2896 +    ])
2897 +  ])
2898 +  if test "x$FAM_LIBS" = x; then
2899 +    PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
2900 +      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
2901 +      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
2902 +    ])
2903 +  fi
2904 +  OLD_LIBS=$LIBS
2905 +  LIBS=$FAM_LIBS
2906 +  AC_CHECK_FUNCS([FAMNoExists])
2907 +  LIBS=$OLD_LIBS
2908 +  
2909 +  if test x$FAM_LIBS = x; then
2910 +     AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
2911 +  fi
2912 +fi
2913 +
2914 +AC_MSG_CHECKING(for properties in mod_webdav)
2915 +AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
2916 +[WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no])
2917 +AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
2918 +
2919 +if test "$WITH_WEBDAV_PROPS" != "no"; then
2920 + PKG_CHECK_MODULES(XML, libxml-2.0, [
2921 +    AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
2922 +    AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
2923 + ])
2924 + PKG_CHECK_MODULES(SQLITE, sqlite3, [
2925 +    AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
2926 +    AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
2927 + ])
2928 +
2929 + AC_MSG_CHECKING(for locks in mod_webdav)
2930 + AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
2931 + [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
2932 + AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
2933 +
2934 + if test "$WITH_WEBDAV_LOCKS" != "no"; then
2935 +   AC_CHECK_LIB(uuid, uuid_unparse, [
2936 +         AC_CHECK_HEADERS([uuid/uuid.h],[
2937 +                 UUID_LIBS=-luuid
2938 +                 AC_DEFINE([HAVE_UUID], [1], [libuuid])
2939 +                AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
2940 +         ])
2941 + ])
2942 +
2943 + fi
2944 +fi
2945 +AC_SUBST(UUID_LIBS)
2946 +
2947 +dnl Check for gdbm
2948 +AC_MSG_CHECKING(for gdbm)
2949 +AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
2950 +[WITH_GDBM=$withval],[WITH_GDBM=no])
2951 +AC_MSG_RESULT([$WITH_GDBM])
2952 +
2953 +if test "$WITH_GDBM" != "no"; then
2954 + AC_CHECK_LIB(gdbm, gdbm_open, [
2955 +         AC_CHECK_HEADERS([gdbm.h],[
2956 +                 GDBM_LIB=-lgdbm
2957 +                 AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
2958 +                AC_DEFINE([HAVE_GDBM_H], [1])
2959 +         ])
2960 + ])
2961 + AC_SUBST(GDBM_LIB)
2962 +fi
2963 +
2964 +dnl Check for memcache
2965 +AC_MSG_CHECKING(for memcache)
2966 +AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mod_trigger_b4_dl]),
2967 +[WITH_MEMCACHE=$withval],[WITH_MEMCACHE=no])
2968 +AC_MSG_RESULT([$WITH_MEMCACHE])
2969 +if test "$WITH_MEMCACHE" != "no"; then
2970 + AC_CHECK_LIB(memcache, mc_new, [
2971 +         AC_CHECK_HEADERS([memcache.h],[
2972 +                 MEMCACHE_LIB=-lmemcache
2973 +                 AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache])
2974 +                AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h])
2975 +         ])
2976 + ])
2977 + AC_SUBST(MEMCACHE_LIB)
2978 +fi
2979 +
2980 +dnl Check for lua
2981 +AC_MSG_CHECKING(if lua-support is requested)
2982 +AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
2983 +[WITH_LUA=$withval],[WITH_LUA=no])
2984 +
2985 +AC_MSG_RESULT($WITH_LUA)
2986 +if test "$WITH_LUA" != "no"; then
2987 + if test "$WITH_LUA" = "yes"; then
2988 +  WITH_LUA=lua
2989 + fi
2990 + PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
2991 +   AC_DEFINE([HAVE_LUA], [1], [liblua])
2992 +   AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2993 + ],[
2994 +   # for debian based systems
2995 +   PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
2996 +     AC_DEFINE([HAVE_LUA], [1], [liblua])
2997 +     AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2998 +   ])
2999 + ])
3000 +
3001 + AC_SUBST(LUA_CFLAGS)
3002 + AC_SUBST(LUA_LIBS)
3003 +fi
3004 +
3005 +save_LIBS=$LIBS
3006 +AC_SEARCH_LIBS(crypt,crypt,[
3007 +  AC_CHECK_HEADERS([crypt.h],[
3008 +    AC_DEFINE([HAVE_CRYPT_H], [1])
3009 +  ])
3010 +
3011 +  AC_DEFINE([HAVE_LIBCRYPT], [1], [libcrypt])
3012 +  if test "$ac_cv_search_crypt" != no; then
3013 +    test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt"
3014 +  fi
3015 +])
3016 +LIBS=$save_LIBS
3017 +AC_SUBST(CRYPT_LIB)
3018 +
3019 +save_LIBS=$LIBS
3020 +AC_SEARCH_LIBS(sendfilev,sendfile,[
3021 +  if test "$ac_cv_search_sendfilev" != no; then
3022 +    test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
3023 +    AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
3024 +  fi
3025 +])
3026 +LIBS=$save_LIBS
3027 +AC_SUBST(SENDFILE_LIB)
3028 +
3029 +case $host_os in
3030 +       *mingw* ) LIBS="$LIBS -lwsock32";;
3031 +        * ) ;;
3032 +esac
3033 +
3034 +AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
3035 +                 strdup strerror strstr strtol sendfile  getopt socket lstat \
3036 +                 gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
3037 +                 getuid select signal pathconf madvise posix_fadvise posix_madvise \
3038 +                 writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r])
3039 +
3040 +AC_MSG_CHECKING(for Large File System support)
3041 +AC_ARG_ENABLE(lfs,
3042 + AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
3043 + [case "${enableval}" in
3044 +   yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
3045 +    no) ;;
3046 +     *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
3047 +  esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
3048 +        enable_lfs=yes])
3049 +AC_MSG_RESULT($enableval)
3050 +
3051 +AC_CHECK_SIZEOF(long)
3052 +AC_CHECK_SIZEOF(off_t)
3053 +
3054 +if test "x$ac_cv_func_sendfile" = xyes; then
3055 +       # check if sendfile works
3056 +        AC_MSG_CHECKING(if sendfile works)
3057 +       if test "x$cross_compiling" = xno; then
3058 +       AC_TRY_RUN([
3059 +                   #ifdef HAVE_SYS_SENDFILE_H
3060 +                   #include <sys/sendfile.h>
3061 +                   #endif /* HAVE_SYS_SENDFILE_H */
3062 +                   #include <errno.h>
3063 +                   int main() {
3064 +                     int o = 0;
3065 +                     if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
3066 +                     return 0;
3067 +                   } ],
3068 +                   AC_MSG_RESULT(yes),
3069 +                   [ AC_MSG_RESULT(no)
3070 +                   AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
3071 +       else
3072 +             AC_MSG_RESULT(no, cross-compiling)
3073 +             AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
3074 +       fi
3075 +fi
3076 +
3077 +dnl Check for IPv6 support
3078 +
3079 +AC_ARG_ENABLE(ipv6,
3080 + AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
3081 + [case "${enableval}" in
3082 +   yes) ipv6=true ;;
3083 +    no) ipv6=false ;;
3084 +     *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
3085 +  esac],[ipv6=true])
3086 +
3087 +if test x$ipv6 = xtrue; then
3088 +  AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
3089 +  [AC_TRY_LINK([ #include <sys/types.h>
3090 +#include <sys/socket.h>
3091 +#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
3092 +  [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
3093 +
3094 +  if test "$ac_cv_ipv6_support" = yes; then
3095 +    AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
3096 +  fi
3097 +fi
3098 +
3099 +
3100 +AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
3101 +
3102 +dnl check for fastcgi lib, for the tests only
3103 +fastcgi_found=no
3104 +AC_CHECK_LIB(fcgi, FCGI_Accept, [
3105 + AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
3106 +   fastcgi_found=yes
3107 + ])
3108 +])
3109 +
3110 +AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
3111 +
3112 +
3113 +# check for extra compiler options (warning options)
3114 +if test "${GCC}" = "yes"; then
3115 +    CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
3116 +fi
3117 +
3118 +AC_ARG_ENABLE(extra-warnings,
3119 + AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
3120 + [case "${enableval}" in
3121 +   yes) extrawarnings=true ;;
3122 +    no) extrawarnings=false ;;
3123 +     *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
3124 +  esac],[extrawarnings=false])
3125 +
3126 +if test x$extrawarnings = xtrue; then
3127 +    CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
3128 +fi
3129 +
3130 +dnl build version-id
3131 +LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
3132 +AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
3133 +
3134 +AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \
3135 +                tests/docroot/Makefile \
3136 +                tests/docroot/123/Makefile \
3137 +                tests/docroot/www/Makefile \
3138 +                tests/docroot/www/go/Makefile \
3139 +                tests/docroot/www/indexfile/Makefile \
3140 +                tests/docroot/www/expire/Makefile \
3141 +                distribute.sh])
3142 +AC_OUTPUT
3143 +
3144 +
3145 +do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog"
3146 +do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
3147 +
3148 +plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
3149 +features="regex-conditionals"
3150 +if test ! "x$PCRE_LIB" = x; then
3151 +       do_build="$do_build $plugins"
3152 +       enable_feature="$features"
3153 +else
3154 +       no_build="$no_build $plugins"
3155 +       disable_feature="$features"
3156 +fi
3157 +
3158 +plugins="mod_mysql_vhost"
3159 +if test ! "x$MYSQL_LIBS" = x; then
3160 +       do_build="$do_build $plugins"
3161 +else
3162 +       no_build="$no_build $plugins"
3163 +fi
3164 +
3165 +plugins="mod_cml mod_magnet"
3166 +if test ! "x$LUA_LIBS" = x; then
3167 +       do_build="$do_build $plugins"
3168 +else
3169 +       no_build="$no_build $plugins"
3170 +fi
3171 +
3172 +features="storage-gdbm"
3173 +if test ! "x$GDBM_LIB" = x; then
3174 +       enable_feature="$enable_feature $features"
3175 +else
3176 +       disable_feature="$disable_feature $features"
3177 +fi
3178 +
3179 +features="storage-memcache"
3180 +if test ! "x$MEMCACHE_LIB" = x; then
3181 +       enable_feature="$enable_feature $features"
3182 +else
3183 +       disable_feature="$disable_feature $features"
3184 +fi
3185 +
3186 +features="compress-gzip compress-deflate"
3187 +if test ! "x$Z_LIB" = x; then
3188 +       enable_feature="$enable_feature $features"
3189 +else
3190 +       disable_feature="$disable_feature $features"
3191 +fi
3192 +
3193 +features="compress-bzip2"
3194 +if test ! "x$BZ_LIB" = x; then
3195 +       enable_feature="$enable_feature $features"
3196 +else
3197 +       disable_feature="$disable_feature $features"
3198 +fi
3199 +
3200 +features="auth-ldap"
3201 +if test ! "x$LDAP_LIB" = x; then
3202 +       enable_feature="$enable_feature $features"
3203 +else
3204 +       disable_feature="$disable_feature $features"
3205 +fi
3206 +
3207 +features="network-openssl"
3208 +if test ! "x$SSL_LIB" = x; then
3209 +       enable_feature="$enable_feature $features"
3210 +else
3211 +       disable_feature="$disable_feature $features"
3212 +fi
3213 +
3214 +# no crypt call
3215 +features="auth-crypt"
3216 +if test "$ac_cv_search_crypt" = no; then
3217 +       disable_feature="$disable_feature $features"
3218 +else
3219 +       enable_feature="$enable_feature $features"
3220 +fi
3221 +
3222 +features="network-ipv6"
3223 +if test "$ac_cv_ipv6_support" = yes; then
3224 +       enable_feature="$enable_feature $features"
3225 +else
3226 +       disable_feature="$disable_feature $features"
3227 +fi
3228 +
3229 +features="large-files"
3230 +if test "$enable_lfs" = yes; then
3231 +       enable_feature="$enable_feature $features"
3232 +else
3233 +       disable_feature="$disable_feature $features"
3234 +fi
3235 +
3236 +features="stat-cache-fam"
3237 +if test ! "x$FAM_LIBS" = x; then
3238 +       enable_feature="$enable_feature $features"
3239 +else
3240 +       disable_feature="$disable_feature $features"
3241 +fi
3242 +
3243 +features="webdav-properties"
3244 +if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
3245 +       enable_feature="$enable_feature $features"
3246 +else
3247 +       disable_feature="$disable_feature $features"
3248 +fi
3249 +
3250 +features="webdav-locks"
3251 +if test "x$UUID_LIBS" \!= x; then
3252 +       enable_feature="$enable_feature $features"
3253 +else
3254 +       disable_feature="$disable_feature $features"
3255 +fi
3256 +
3257 +
3258 +## output
3259 +
3260 +$ECHO
3261 +$ECHO "Plugins:"
3262 +$ECHO
3263 +
3264 +$ECHO "enabled: "
3265 +for p in $do_build; do
3266 +       $ECHO "  $p"
3267 +done | sort
3268 +
3269 +$ECHO "disabled: "
3270 +for p in $no_build; do
3271 +       $ECHO "  $p"
3272 +done | sort
3273 +
3274 +$ECHO
3275 +$ECHO "Features:"
3276 +$ECHO
3277 +
3278 +$ECHO "enabled: "
3279 +for p in $enable_feature; do
3280 +       $ECHO "  $p"
3281 +done | sort
3282 +
3283 +$ECHO "disabled: "
3284 +for p in $disable_feature; do
3285 +       $ECHO "  $p"
3286 +done | sort
3287 +
3288 +$ECHO
3289 Index: doc/lighttpd.1
3290 ===================================================================
3291 --- doc/lighttpd.1      (.../tags/lighttpd-1.4.22)      (revision 2475)
3292 +++ doc/lighttpd.1      (.../branches/lighttpd-1.4.x)   (revision 2475)
3293 @@ -1,18 +0,0 @@
3294 -.TH LIGHTTPD 1 2003-12-21
3295 -.SH NAME
3296 -lighttpd - a fast, secure and flexible webserver
3297 -.SH SYNOPSIS
3298 -lighttpd -D -f <configfile>
3299 -.SH DESCRIPTION
3300 -.SH FILES
3301 -/etc/lighttpd/lighttpd.conf
3302 -.SH CONFORMING TO
3303 -HTTP/1.0
3304 -HTTP/1.0
3305 -HTTP-Authentification - Basic, Digest
3306 -FastCGI
3307 -CGI/1.1
3308 -.SH SEE ALSO
3309 -spawn-fcgi(1)
3310 -.SH AUTHOR
3311 -jan@kneschke.de
3312 Index: doc/spawn-fcgi.1
3313 ===================================================================
3314 --- doc/spawn-fcgi.1    (.../tags/lighttpd-1.4.22)      (revision 2475)
3315 +++ doc/spawn-fcgi.1    (.../branches/lighttpd-1.4.x)   (revision 2475)
3316 @@ -1,13 +0,0 @@
3317 -.TH SPAWNFCGI 1 2003-12-21
3318 -.SH NAME
3319 -spawn-fcgi \- spawning FastCGI processes
3320 -.SH SYNOPSIS
3321 -spawn-fcgi -f <fastcgi-binary> [-p <port> | -s <socket>] [-C <num-of-php-procs>] [-c <chroot-dir>] [-u <username>] [-g <groupname>]
3322 -spawn-fcgi -v
3323 -spawn-fcgi -h
3324 -.SH DESCRIPTION
3325 -spawn-fcgi is used to spawn remote FastCGI processes.
3326 -.SH SEE ALSO
3327 -lighttpd(1)
3328 -.SH AUTHOR
3329 -jan@kneschke.de
3330 Index: doc/lighttpd.8
3331 ===================================================================
3332 --- doc/lighttpd.8      (.../tags/lighttpd-1.4.22)      (revision 0)
3333 +++ doc/lighttpd.8      (.../branches/lighttpd-1.4.x)   (revision 2475)
3334 @@ -0,0 +1,70 @@
3335 +.TH LIGHTTPD "8" "2009-03-07" "" ""
3336 +.
3337 +.SH NAME
3338 +lighttpd \- a fast, secure and flexible web server
3339 +.
3340 +.SH SYNOPSIS
3341 +\fBlighttpd\fP [\fB\-ptDvVh\fP] \fB\-f\fP \fIconfigfile\fP [\fB\-m\fP \fImoduledir\fP]
3342 +.
3343 +.SH DESCRIPTION
3344 +\fBlighttpd\fP (pronounced 'lighty') is an advanced HTTP daemon that aims
3345 +to be secure, fast, compliant and very flexible.  It has been optimized for
3346 +high performance.  Its feature set includes, but is not limited to, FastCGI,
3347 +CGI, basic and digest HTTP authentication, output compression, URL rewriting.
3348 +.PP
3349 +This manual page only lists the command line arguments.  For details
3350 +on how to configure \fBlighttpd\fP and its modules see the files in the
3351 +doc-directory.
3352 +.
3353 +.SH OPTIONS
3354 +The following options are supported:
3355 +.TP 8
3356 +\fB\-f\ \fP \fIconfigfile\fP
3357 +Load configuration file \fIconfigfile\fP.
3358 +.TP 8
3359 +\fB\-m\ \fP \fImoduledir\fP
3360 +Use
3361 +\fImoduledir\fP
3362 +as the directory that contains modules, instead of the default.
3363 +.TP 8
3364 +\fB\-p\fP
3365 +Print the parsed configuration file in its internal form and exit.
3366 +.TP 8
3367 +\fB\-t\fP
3368 +Test the configuration file for syntax errors and exit.
3369 +.TP 8
3370 +\fB\-D\fP
3371 +Do not daemonize (go into background). The default is to daemonize.
3372 +.TP 8
3373 +\fB\-v\fP
3374 +Show version and exit.
3375 +.TP 8
3376 +\fB\-V\fP
3377 +Show compile-time features and exit.
3378 +.TP 8
3379 +\fB\-h\fP
3380 +Show a brief help message and exit.
3381 +.
3382 +.SH FILES
3383 +.TP 8
3384 +/etc/lighttpd/lighttpd.conf
3385 +The standard location for the configuration file.
3386 +.TP 8
3387 +/var/run/lighttpd.pid
3388 +The standard location for the PID of the running \fBlighttpd\fP process.
3389 +.
3390 +.SH SEE ALSO
3391 +Online Documentation: http://wiki.lighttpd.net/
3392 +.PP
3393 +spawn-fcgi(1)
3394 +.PP
3395 +\fIHypertext Transfer Protocol -- HTTP/1.1\fP, RFC 2616.
3396 +.PP
3397 +\fIHTTP Authentication: Basic and Digest Access Authentication\fP, RFC 2617.
3398 +.PP
3399 +\fIThe Common Gateway Interface Version 1.1\fP, RFC 3875.
3400 +.PP
3401 +\fIThe FastCGI specification\fP.
3402 +.
3403 +.SH AUTHOR
3404 +Jan Kneschke <jan@kneschke.de>
3405 Index: doc/lighttpd.conf
3406 ===================================================================
3407 --- doc/lighttpd.conf   (.../tags/lighttpd-1.4.22)      (revision 2475)
3408 +++ doc/lighttpd.conf   (.../branches/lighttpd-1.4.x)   (revision 2475)
3409 @@ -16,7 +16,6 @@
3410  #                               "mod_redirect",
3411  #                               "mod_alias",
3412                                  "mod_access",
3413 -#                               "mod_cml",
3414  #                               "mod_trigger_b4_dl",
3415  #                               "mod_auth",
3416  #                               "mod_status",
3417 @@ -35,8 +34,8 @@
3418  #                               "mod_rrdtool",
3419                                  "mod_accesslog" )
3420  
3421 -## a static document-root, for virtual-hosting take look at the
3422 -## server.virtual-* options
3423 +## A static document-root. For virtual hosting take a look at the
3424 +## mod_simple_vhost module.
3425  server.document-root        = "/srv/www/htdocs/"
3426  
3427  ## where to send error-messages to
3428 @@ -299,11 +298,6 @@
3429  # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
3430  # trigger-before-download.trigger-timeout = 10
3431  
3432 -## for mod_cml
3433 -## don't forget to add index.cml to server.indexfiles
3434 -# cml.extension               = ".cml"
3435 -# cml.memcache-hosts          = ( "127.0.0.1:11211" )
3436 -
3437  #### variable usage:
3438  ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
3439  #bar = 1
3440 Index: doc/Makefile.am
3441 ===================================================================
3442 --- doc/Makefile.am     (.../tags/lighttpd-1.4.22)      (revision 2475)
3443 +++ doc/Makefile.am     (.../branches/lighttpd-1.4.x)   (revision 2475)
3444 @@ -1,6 +1,5 @@
3445 -dist_man1_MANS=lighttpd.1 spawn-fcgi.1
3446 +dist_man8_MANS=lighttpd.8
3447  
3448 -
3449  DOCS=accesslog.txt \
3450  authentication.txt \
3451  cgi.txt \
3452 Index: SConstruct
3453 ===================================================================
3454 Index: NEWS
3455 ===================================================================
3456 --- NEWS        (.../tags/lighttpd-1.4.22)      (revision 2475)
3457 +++ NEWS        (.../branches/lighttpd-1.4.x)   (revision 2475)
3458 @@ -3,7 +3,30 @@
3459  NEWS
3460  ====
3461  
3462 -- 1.4.22 -
3463 +- 1.4.23 -
3464 +  * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
3465 +  * New lighttpd man page (moved it to section 8) (fixes #1875)
3466 +  * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
3467 +  * Fix workaround for incorrect path info/scriptname if fastcgi prefix is "/" (fixes #729)
3468 +  * Finally removed spawn-fcgi
3469 +  * Allow xattr to overwrite mime type (fixes #1929)
3470 +  * Remove link from errormsg about fastcgi apps (fixes #1942)
3471 +  * Strip trailing dot from "Host:" header
3472 +  * Remove the optional port info from SERVER_NAME (thx Mr_Bond)
3473 +  * Fix mod_proxy RoundRobin (off by one problem if only one backend is up)
3474 +  * Rename configure.in to configure.ac, with small cleanups (fixes #1932)
3475 +  * Add proper SUID bit detection (fixes #416)
3476 +  * Check for regular file in mod_cgi, so we don't try to start directories
3477 +  * Include mmap.h from chunk.h to fix some problems with #define mmap mmap64 (fixes #1923)
3478 +  * Add support for pipe logging for server.errorlog (fixes #296)
3479 +  * Add revision number to package version for svn/git checkouts
3480 +  * Use server.tag for SERVER_SOFTWARE if configured (fixes #357)
3481 +  * Fix trailing zero char in REQUEST_URI after "strip-request-uri" in mod_fastcgi
3482 +  * mod_magnet: Add env["request.remote-ip"] (fixes #1740)
3483 +  * mod_magnet: Add env["request.path-info"]
3484 +  * Change name/version separator back to "/" (affects every place where the version is printed)
3485 +
3486 +- 1.4.22 - 2009-03-07
3487    * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
3488    * Fix default vhost in mod_simple_vhost (fixes #1905)
3489    * Handle EINTR in mod_rrdtool (fixes #604)
3490 Index: CMakeLists.txt
3491 ===================================================================
3492
3493 Property changes on: .
3494 ___________________________________________________________________
3495 Modified: bzr:revision-info
3496    - timestamp: 2009-03-07 14:58:05.338000059 +0100
3497 committer: Stefan Bühler <stbuehler@web.de>
3498 properties: 
3499         branch-nick: lighttpd-1.4.x
3500
3501    + timestamp: 2009-03-07 22:04:32.213999987 +0100
3502 committer: Stefan Bühler <stbuehler@web.de>
3503 properties: 
3504         branch-nick: lighttpd-1.4.x
3505
3506 Modified: bzr:file-ids
3507    - 
3508    + doc/lighttpd.8     lighttpd.8-20090307205615-mc312p5ocjwthwte-1
3509
3510 Modified: bzr:revision-id:v3-trunk0
3511    - 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
3512 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
3513 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
3514 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
3515 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
3516 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
3517 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
3518 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
3519 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
3520 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
3521 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
3522 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
3523 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
3524 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
3525 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
3526 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
3527 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
3528 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
3529 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
3530 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
3531 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
3532 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
3533 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
3534 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
3535 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
3536 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
3537 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
3538 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
3539 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
3540 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
3541 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
3542 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
3543 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
3544 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
3545 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
3546 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
3547 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
3548 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
3549 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
3550 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
3551 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
3552 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
3553 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
3554 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
3555 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
3556 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
3557 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
3558 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
3559 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
3560 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
3561 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
3562 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
3563 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
3564 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
3565 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
3566 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
3567 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
3568 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
3569 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
3570 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
3571 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
3572 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
3573 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
3574 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
3575 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
3576 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
3577 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
3578 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
3579 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
3580 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
3581 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
3582 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
3583 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
3584 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
3585 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
3586 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
3587 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
3588 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
3589 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
3590 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
3591 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
3592 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
3593 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
3594 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
3595 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
3596 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
3597 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
3598 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
3599 1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
3600 1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
3601 1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
3602 1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
3603 1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
3604 1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
3605 1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
3606 1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
3607 1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
3608 1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
3609 1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
3610 1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
3611 1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
3612 1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
3613 1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
3614 1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
3615 1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
3616 1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
3617
3618    + 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
3619 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
3620 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
3621 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
3622 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
3623 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
3624 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
3625 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
3626 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
3627 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
3628 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
3629 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
3630 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
3631 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
3632 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
3633 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
3634 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
3635 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
3636 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
3637 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
3638 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
3639 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
3640 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
3641 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
3642 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
3643 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
3644 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
3645 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
3646 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
3647 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
3648 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
3649 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
3650 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
3651 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
3652 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
3653 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
3654 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
3655 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
3656 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
3657 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
3658 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
3659 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
3660 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
3661 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
3662 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
3663 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
3664 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
3665 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
3666 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
3667 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
3668 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
3669 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
3670 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
3671 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
3672 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
3673 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
3674 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
3675 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
3676 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
3677 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
3678 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
3679 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
3680 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
3681 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
3682 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
3683 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
3684 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
3685 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
3686 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
3687 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
3688 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
3689 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
3690 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
3691 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
3692 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
3693 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
3694 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
3695 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
3696 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
3697 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
3698 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
3699 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
3700 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
3701 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
3702 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
3703 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
3704 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
3705 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
3706 1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
3707 1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
3708 1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
3709 1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
3710 1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
3711 1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
3712 1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
3713 1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
3714 1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
3715 1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
3716 1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
3717 1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
3718 1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
3719 1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
3720 1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
3721 1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
3722 1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
3723 1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
3724 1237 stbuehler@web.de-20090307154555-xybvl7sxrha6vhds
3725 1238 stbuehler@web.de-20090307204326-10m0681831yvhi3k
3726 1239 stbuehler@web.de-20090307204846-seq3cmzn6dy9927i
3727 1240 stbuehler@web.de-20090307205519-ha3s58fcum106yl0
3728 1241 stbuehler@web.de-20090307210432-jdlv5pp9m519vyv2
3729
3730
This page took 0.304336 seconds and 4 git commands to generate.