Commit Graph

3696 Commits

Author SHA1 Message Date
Glenn Strauss 048af4c506 [core] fix crash at shutdown w/ certain config
If server.systemd-socket-activation = "enable" and one or more of the
sockets is not listed in lighttpd.conf, then when the server is shutting
down, a buffer from the config file is free()d twice.
2021-01-01 13:03:55 -05:00
Glenn Strauss 8f3395976d [autoconf] update ax_prog_cc_for_build.m4
update scripts/m4/ax_prog_cc_for_build.m4 from serial 8 to serial 18;a=blob_plain;f=m4/ax_prog_cc_for_build.m4
2021-01-01 01:08:40 -05:00
Glenn Strauss acca2a3f73 [autotools] autoupdate; subst deprecated/obsolete
autoupdate; subst deprecated/obsolete macros
- others
2020-12-31 23:33:56 -05:00
Glenn Strauss dfe471b77c [mod_dirlisting] place vars closer to where used
allocate memory for PATH_MAX to avoid pathconf() for _PC_NAME_MAX
2020-12-30 06:41:16 -05:00
Glenn Strauss 2f303d8205 [mod_gnutls] use local strncmp_const()
On some older gcc, strncmp is a macro and expects three arguments,
but does not see expansion of lighttpd CONST_STR_LEN() macro before
warning/error about incorrect number of arguments
2020-12-28 09:14:48 -05:00
Glenn Strauss 3088c76c8c [mod_mbedtls] use local strncmp_const()
On some older gcc, strncmp is a macro and expects three arguments,
but does not see expansion of lighttpd CONST_STR_LEN() macro before
warning/error about incorrect number of arguments
2020-12-28 09:13:21 -05:00
Glenn Strauss 171a064036 [mod_mbedtls] include mbedtls/platform_util.h
include mbedtls/platform_util.h for mbedtls_platform_zeroize()
(instead of relying on an indirect include)

(fixes build with (very old) mbedtls-2.14.0)
2020-12-28 08:54:50 -05:00
Glenn Strauss 693a29fe91 - next is 1.4.59 2020-12-27 23:36:23 -05:00
Glenn Strauss 0cb6466541 [mod_webdav] hide unused funcs depending on build
hide unused funcs depending on build flags
2020-12-27 22:51:40 -05:00
Glenn Strauss 992ba517ab [doc] NEWS 2020-12-27 22:42:56 -05:00
Glenn Strauss 37ae942346 [core] fix bug in read retry found by coverity
read retry loop needs separate var for result and data size to read

rename 'toSend' variable to 'len' (of chunk)
2020-12-27 22:35:48 -05:00
Glenn Strauss 5ec5e124c1 [tests] consolidate some tests/ content 2020-12-27 21:39:04 -05:00
Glenn Strauss db0cd76618 [build] add GNUMAKEFLAGS=--no-print-directory
quiet some automake noise during build
(can use 'make -s' to quiet more)

In doc/ and tests/docroot/, add GNUMAKEFLAGS=--no-print-directory -s
2020-12-27 21:37:28 -05:00
Glenn Strauss 2639e5ae43 [multiple] chunkqueue_write_chunk()
create API in chunk.[ch] for writing a chunk to an fd

(pull similar code from mod_cgi and mod_webdav)

This new API is intended for use on request body input, which is
written to size-limited temporary files controlled by lighttpd and
written to files or pipes.

(network_backend_write() is for writing chunkqueues to sockets)
2020-12-27 09:17:33 -05:00
Glenn Strauss 15bfe5ef0e [mod_webdav] typedef off_t loff_t for FreeBSD
FreeBSD provides an API similar to Linux copy_file_range()
but uses off_t instead of loff_t in the syscall.

off_t is equivalent to off64_t when lighttpd is built with LFS
(and lighttpd is built with LFS enabled by default)
2020-12-27 04:19:11 -05:00
Glenn Strauss 72b9bb5ba3 [core] http_response_match_if_range()
separate func to check "If-Range"
2020-12-26 20:00:42 -05:00
Glenn Strauss 0c6a6d06c6 [tests] OpenBSD crypt() support limited to bcrypt
OpenBSD crypt() does not support (insecure) crypt-des or crypt-md5

(The password used in the tests and lighttpd.htpasswd is crypt-des.
 Something else could be used so that the tests can execute,
 though that something might be different on different platforms.)
2020-12-26 03:47:41 -05:00
Glenn Strauss e16b4503e2 [core] fix bug in FastCGI uploads (#3033)
(thx zoon01 and ms49434)

  "Memory Growth with PUT and full buffered streams"
2020-12-26 02:56:39 -05:00
Glenn Strauss 5309ec8c95 [core] fix crash after specific err in config file 2020-12-25 17:47:16 -05:00
Glenn Strauss b700a8ca09 [multiple] etag.[ch] -> http_etag.[ch]; better imp
more efficient implementation of HTTP ETag generation and comparison

modify dekhash() to take hash value to allow for incremental hashing
2020-12-25 14:41:16 -05:00
Glenn Strauss 91e94f4875 [tests] load required modules in alt .conf tests
load only required modules in alt .conf tests
2020-12-24 23:39:52 -05:00
Glenn Strauss d228b06655 [tests] slight speed up checking for server ready
make connection attempt every 10ms instead of every 20ms
2020-12-24 23:09:23 -05:00
Glenn Strauss 655453a195 [core] inet_ntop_cache -> sock_addr_cache
* rename inet_ntop_cache.[ch] to sock_addr_cache.[ch]
* reimplement as separate caches for IPv4 and IPv6
2020-12-24 20:05:01 -05:00
Glenn Strauss 1212f60991 buffer_append_path_len() to join paths
use buffer_append_path_len() to join path segments
2020-12-24 16:13:20 -05:00
Glenn Strauss a0b615acd9 [core] http_date_timegm() (portable timegm())
move from mod_openssl.c
2020-12-24 16:13:20 -05:00
Glenn Strauss 122094e3e3 [multiple] employ http_date.h, sys-time.h
- replace use of strptime() w/ implementation specialized for HTTP dates
- use thread-safe gmtime_r(), localtime_r() (replace localtime, gmtime)
2020-12-24 16:13:20 -05:00
Glenn Strauss 48a8e893a7 [core] specialized strptime() for HTTP date fmts 2020-12-24 16:13:20 -05:00
Glenn Strauss f8cc9fb915 [core] http_date.[ch] encapsulate HTTP-date parse
http_date.[ch] encapsulate HTTP-date parse/compare

(import from one of my development branches from 2015)
2020-12-24 16:13:20 -05:00
Glenn Strauss f928f6d827 [core] sys-time.h - localtime_r,gmtime_r macros
sys-time.h - localtime_r,gmtime_r macros if needed

provide rudimentary localtime_r() and gmtime_r() if not present
(wraps localtime() and gmtime() funtions, but are not thread-safe since
 they do not take a lock around access to localtime() and gmtime())

(import from one of my development branches from 2015)
2020-12-24 16:13:20 -05:00
Glenn Strauss 29f50bdeb0 [multiple] fdevent_waitpid() wrapper 2020-12-24 16:13:17 -05:00
Glenn Strauss 2ecbe5948d [mod_proxy] fix sending of initial reqbody chunked
fix sending of initial reqbody chunked to backend
2020-12-24 01:15:55 -05:00
Glenn Strauss ceab1e700d [core] add comment for FastCGI mem use in hctx->rb (#3033)
  "Memory Growth with PUT and full buffered streams"
2020-12-24 01:02:36 -05:00
Glenn Strauss 7ba521ffb4 [core] reuse large mem chunks (fix mem usage) (fixes #3033)
(thx flynn)

fix large memory usage for large file downloads from dynamic backends

reuse or release large memory chunks

  "Memory Growth with PUT and full buffered streams"
2020-12-24 00:20:27 -05:00
Glenn Strauss b598bb53f9 [tests] remove FastCGI test dependency on PHP 2020-12-23 03:50:13 -05:00
Glenn Strauss 89a3987ce7 [core] prefer IPv6+IPv4 func vs IPv4-specific func 2020-12-23 03:50:13 -05:00
Glenn Strauss fc01b820ec [tests] remove FastCGI test dependency on libfcgi
- rewrite fcgi-responder as standalone app
  fcgi-responder is now a minimal, standalone FastCGI server for tests
- remove dependency on fcgi-devel package
- merge fcgi-auth into fcgi-responder
2020-12-23 03:49:43 -05:00
Glenn Strauss c68a7b4552 [tests] collect code for "die-at-end" tests 2020-12-18 20:36:30 -05:00
Glenn Strauss 0bff6d58bc [mod_wolfssl] compile with earlier wolfSSL vers
compatibility to compile with earlier wolfSSL versions

compile-tested back to wolfSSL tag v3.14.0-stable
configured with (possibly extra flags)
  ./configure --enable-opensslextra --enable-opensslall --enable-sni \
    --enable-lighty --enable-stunnel --enable-nginx --enable-haproxy

Functionality has not been tested!
Please consider using the latest stable release of wolfSSL.
2020-12-18 20:36:25 -05:00
Glenn Strauss 6cf92dffe3 [mod_wolfssl] use wolfSSL TLS version defines
now that mod_wolfssl is a standalone module, use wolfSSL TLS ver defines

(Increase compatibility of mod_wolfssl with wolfSSL versions prior to
 wolfSSL v4.2.0)
2020-12-17 21:09:59 -05:00
Glenn Strauss ae77d8ae6e - next is 1.4.58 2020-12-17 04:31:59 -05:00
Glenn Strauss 91250ee0bd [doc] NEWS 2020-12-17 04:03:25 -05:00
Glenn Strauss 881d05076a [core] attempt to quiet some coverity warnings 2020-12-17 04:01:34 -05:00
Glenn Strauss cabced1f9f [core] fix decoding chunked from backend (fixes #3049)
(thx flynn)

fix decoding chunked from backend

truncate response and error out if backend sends excess data
after chunked encoding

  "Too much content with HTTP/2.0"
2020-12-17 03:59:41 -05:00
Glenn Strauss eda12aee22 [core] fix crash printing trace if backend is down 2020-12-16 20:07:21 -05:00
Glenn Strauss 76faed9145 [multiple] replace fall through comment with attr
replace /* fall through */ comment with __attribute_fallthrough__ macro

Note: not adding attribute to code with external origins:
  xxhash.h (algo_xxhash.h)
so to avoid warnings, may need to compile with -Wno-implicit-fallthrough
2020-12-16 05:16:25 -05:00
Glenn Strauss fefdf7f097 [core] fix array_copy_array() sorted[]
fix array_copy_array() sorted[]
(current use appears to be only on value lists; not user-visible issue)

Some time back, sorted[] was a set of indexes into data[],
and therefore sorted[] could be copied when copying array.
Now that sorted[] is a list of pointers, the sorted[] list
must be rebuilt.  If copied, it continued to point to
(data_unset *) from the original src array, not the dst array.
2020-12-16 02:00:17 -05:00
Glenn Strauss 20b54fa918 [mod_authn_ldap, mod_vhostdb_ldap] default cafile
set default cafile at startup if cafile configured in global scope
2020-12-16 02:00:17 -05:00
Glenn Strauss 2565ad1b86 [mod_authn_ldap] fix crash (fixes #3048)
(thx mgottinger)

fix crash due to uninitialized memory during config parsing

  "Broken LDAP authentication on lighttpd 1.4.56"
2020-12-16 02:00:17 -05:00
Glenn Strauss fe5740d5e5 [mod_proxy] proxy.header = ("force-http10" => ...)
compatibility option to force HTTP/1.0 requests to mod_proxy backend
proxy.header += ("force-http10" => "disable")  (default)

If proxy.header is set (for any options), it overrides the global
server.feature-flags += ("proxy.force-http10" => "disable")
2020-12-16 02:00:17 -05:00
Glenn Strauss bbd958382e [core] reorder srv->config_context to match ndx (fixes #3047)
(thx altblue)

reorder dc->context_ndx to match srv->config_context->data[] index.
srv->config_context->data[] may have been re-ordered in configparser.y.
Since the dc->context_ndx (id) is reused by config_insert*() and by
plugins to index into srv->config_context->data[], reorder into the
order encountered during config file parsing for least surprise to
end-users writing config files.

  "mismatched nested config conditions in lighttpd 1.4.56"
2020-12-16 02:00:17 -05:00