diff --git a/NEWS b/NEWS index 92b55091..93b92d81 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,13 @@ NEWS ==== -- 1.4.8 - 2005-..-.. +- 1.4.9 - 2005-..-.. + + * added server.core-files option (sandy ) + * fixed 100% cpu loops in mod_cgi ("sandy" ) + * fixed handling for secure-download.timeout (jamis@37signals.com) + +- 1.4.8 - 2005-11-23 * added auto-reconnect to ldap-server in mod_auth (joerg@netbsd.org) @@ -15,6 +21,7 @@ NEWS * added 'debug' to simple-vhost to suppress the (mod_simple_vhost.c.157) No such file or directory /servers/ww.lighttpd.net/pages/ messages by default + * added support to let the server listen on UNIX-socket * changed default stat-cache-engine to 'simple' * removed debian/ dir from source package on request by packager * fixed max-age timestamps in mod_expire @@ -27,14 +34,17 @@ NEWS * fixed fdvent-handler init if server.max-worker was used (Siddharth Vijayakrishnan ) * fixed missing cleanup in mysql_vhost - * fixed assert() in connections.c:962: connection_handle_read_state: Assertion 'c->mem->used' failed. + * fixed assert() in "connections.c:962: + connection_handle_read_state: Assertion 'c->mem->used' failed." * fixed 64bit issue in md5 * fixed crash in mod_status * fixed duplicate headers in mod_proxy * fixed Content-Length in HEAD request in mod_proxy * fixed unsigned/signed comparisions * fixed streaming in mod_cgi - * TODO: listen on UNIX-socket + * fixed possible overflow in password-salt handling + (reported on slashdot by james-web@and.org) + * fixed server-traffic-limit if connection limit is not set - 1.4.7 - 2005-11-02 diff --git a/SConstruct b/SConstruct index e2ac0023..318cc6b0 100644 --- a/SConstruct +++ b/SConstruct @@ -5,7 +5,7 @@ import string from stat import * package = 'lighttpd' -version = '1.4.7' +version = '1.4.9' def checkCHeaders(autoconf, hdrs): p = re.compile('[^A-Z0-9]') @@ -141,12 +141,13 @@ if 1: syslog.h stdint.h inttypes.h + sys/prctl.h sys/wait.h""", "\n")) checkFuncs(autoconf, Split('fork stat lstat strftime dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \ strdup strerror strstr strtol sendfile getopt socket \ gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \ - getuid select signal pathconf madvise\ + getuid select signal pathconf madvise prctl\ writev sigaction sendfile64 send_file kqueue port_create localtime_r')) checkTypes(autoconf, Split('pid_t size_t off_t')) @@ -158,6 +159,8 @@ if 1: if env['with_fam']: if autoconf.CheckLibWithHeader('fam', 'fam.h', 'C'): autoconf.env.Append(CPPFLAGS = [ '-DHAVE_FAM_H', '-DHAVE_LIBFAM' ], LIBS = 'fam') + checkFuncs(autoconf, ['FAMNoExists']); + if autoconf.CheckLibWithHeader('crypt', 'crypt.h', 'C'): autoconf.env.Append(CPPFLAGS = [ '-DHAVE_CRYPT_H', '-DHAVE_LIBCRYPT' ], LIBCRYPT = 'crypt') diff --git a/configure.in b/configure.in index 0f94f5c7..93cbb0fe 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(lighttpd, 1.4.8, jan@kneschke.de) +AC_INIT(lighttpd, 1.4.9, jan@kneschke.de) AC_CONFIG_SRCDIR([src/server.c]) AC_CANONICAL_TARGET @@ -56,7 +56,7 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \ sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \ getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \ sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \ -sys/resource.h sys/un.h syslog.h]) +sys/resource.h sys/un.h syslog.h sys/prctl.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/src/base.h b/src/base.h index 506fdad9..42f8de98 100644 --- a/src/base.h +++ b/src/base.h @@ -459,6 +459,7 @@ typedef struct { STAT_CACHE_ENGINE_SIMPLE, STAT_CACHE_ENGINE_FAM } stat_cache_engine; + unsigned short enable_cores; } server_config; typedef struct { diff --git a/src/configfile.c b/src/configfile.c index e9080c30..e63de188 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -79,6 +79,7 @@ static int config_insert(server *srv) { { "server.max-connections", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 42 */ { "server.network-backend", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 43 */ { "server.upload-dirs", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 44 */ + { "server.core-files", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 45 */ { "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, { "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, @@ -116,6 +117,7 @@ static int config_insert(server *srv) { cv[41].destination = stat_cache_string; cv[43].destination = srv->srvconf.network_backend; cv[44].destination = srv->srvconf.upload_tempdirs; + cv[45].destination = &(srv->srvconf.enable_cores); cv[42].destination = &(srv->srvconf.max_conns); cv[12].destination = &(srv->srvconf.max_request_size); diff --git a/src/server.c b/src/server.c index 5c515e3c..33648be8 100644 --- a/src/server.c +++ b/src/server.c @@ -50,6 +50,10 @@ #include #endif +#ifdef HAVE_SYS_PRCTL_H +#include +#endif + #ifndef __sgi /* IRIX doesn't like the alarm based time() optimization */ /* #define USE_ALARM */ @@ -323,7 +327,7 @@ int main (int argc, char **argv) { setlocale(LC_TIME, "C"); if (NULL == (srv = server_init())) { - fprintf(stderr, "did this really happend ?\n"); + fprintf(stderr, "did this really happen?\n"); return -1; } @@ -521,6 +525,12 @@ int main (int argc, char **argv) { } else { srv->max_fds = rlim.rlim_cur; } + + /* set core file rlimit, if enable_cores is set */ + if (use_rlimit && srv->srvconf.enable_cores && getrlimit(RLIMIT_CORE, &rlim) == 0) { + rlim.rlim_cur = rlim.rlim_max; + setrlimit(RLIMIT_CORE, &rlim); + } #endif if (srv->event_handler == FDEVENT_HANDLER_SELECT) { /* don't raise the limit above FD_SET_SIZE */ @@ -592,6 +602,11 @@ int main (int argc, char **argv) { if (srv->srvconf.username->used && srv->srvconf.groupname->used) initgroups(srv->srvconf.username->ptr, grp->gr_gid); if (srv->srvconf.username->used) setuid(pwd->pw_uid); +#endif +#ifdef HAVE_PRCTL + if (srv->srvconf.enable_cores) { + prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); + } #endif } else { @@ -608,6 +623,13 @@ int main (int argc, char **argv) { } else { srv->max_fds = rlim.rlim_cur; } + + /* set core file rlimit, if enable_cores is set */ + if (srv->srvconf.enable_cores && getrlimit(RLIMIT_CORE, &rlim) == 0) { + rlim.rlim_cur = rlim.rlim_max; + setrlimit(RLIMIT_CORE, &rlim); + } + #endif if (srv->event_handler == FDEVENT_HANDLER_SELECT) { /* don't raise the limit above FD_SET_SIZE */