Commit Graph

3387 Commits (1c7c19a9d50c4a36c3e9c86d7721c7175662fe06)
 

Author SHA1 Message Date
Glenn Strauss c3073b4da6 [core] stricter parsing of POST chunked block hdr 3 years ago
Glenn Strauss 9ca668c870 [mod_fastcgi] decode Transfer-Encoding: chunked
decode Transfer-Encoding: chunked from mod_fastcgi backend
3 years ago
Glenn Strauss 7420526ddb [core] decode Transfer-Encoding: chunked from gw
decode Transfer-Encoding: chunked from gw (gateway backends)

Transfer-Encoding: chunked is a hop-by-hop header.

Handling chunked encoding remove a hurdle for mod_proxy to send HTTP/1.1
requests to backends and be able to handle HTTP/1.1 responses.

Other backends ought not to send Transfer-Encoding: chunked, but in
practice, some implementations do.
3 years ago
Glenn Strauss dbd438cca0 [mod_openssl] read secret data w/ BIO_new_mem_buf
Using BIO_new_mem_buf() allows lighttpd to control file reads and
securely wiping memory, avoiding the use of BIO_s_file(), which
employs stdio and BIO internal copying without securely wiping memory.

BIO_new_mem_buf() is also much more performant than BIO_s_file()
or BIO_new_fd() without a buffering BIO, which might make many
syscalls reading a single character at a time.

BIO_new_mem_buf() appears to be supported by older OpenSSL versions
as well as by numerous OpenSSL-compatible APIs, e.g. in BoringSSL,
LibreSSL, WolfSSL
3 years ago
Glenn Strauss 4b755d2b03 [mod_deflate] quicker check for Content-Encoding
The response is not a candidate for mod_deflate if
Content-Encoding was already set by something else.
3 years ago
Glenn Strauss 496dc6d9c5 [core] detect and reject TLS connect to cleartext
detect and reject TLS connection to cleartext listening port
(alternative to failing to receive HTTP header and waiting to time out)
3 years ago
Glenn Strauss 87428818a1 [mod_nss] func renames for consistency
mod_nss was written using mod_mbedtls and mod_gnutls as templates,
but some code was accidentally committed with those other modules'
naming.
3 years ago
Glenn Strauss 33c8cf41db [multiple] rename connection_reset hook to request
rename connection_reset to handle_request_reset
3 years ago
Glenn Strauss bb6a5d7821 [core] separate funcs to reset (request_st *)
request_init(), request_free(), request_reset() separate from (and
called by) connection_init(), connection_free(), connection_reset()
3 years ago
Glenn Strauss 164f7600b7 [multiple] con hooks store ctx in con->plugin_ctx
modules with connection level hooks now store ctx in con->plugin_ctx
3 years ago
Glenn Strauss fea5bdc873 [core] con layer plugin_ctx separate from request 3 years ago
Glenn Strauss 5f7bf472c7 [core] server.feature-flags extensible config
server.feature-flags = ("server.xxxx" => "enable")
3 years ago
Glenn Strauss 5d7071293a [build] add --with-brotli to CI build
(thx stbuehler)
3 years ago
Glenn Strauss bc5d4b3492 [mod_compress] remove mod_compress 3 years ago
Glenn Strauss de9e2f9881 [tests] mod_compress -> mod_deflate 3 years ago
Glenn Strauss 672891a7d6 [doc] mod_compress -> mod_deflate 3 years ago
Glenn Strauss 8dd33a72dd [mod_deflate] mod_deflate subsumes mod_compress
translate config server.modules "mod_compress" to "mod_deflate"
accept compress.* directives, but issue DEPRECATED warning trace

mod_deflate differences from mod_compress:
- mod_compress compress.filetype was exact match; deflate.mimetypes is
  prefix match (behavior change might compress longer mimetype matches,
  which are likely of similar type and compressability)
- mod_compress always sent entire (compressed) file for Range request
  mod_deflate will stream compress range result (not stored in cache)
- mod_compress would short-circuit request with 403 Forbidden error
  if request file did not exist (stat() failed) (This behavior was
  unfriendly to other handlers)
- mod_compress compress.cache-dir layout differs from deflate.cache-dir
  layout; file cache should be cleared (or renamed) when migrating from
  mod_compress to mod_deflate
- mod_deflate does not issue Vary: Accept-Encoding if request does not
  contain Accept-Encoding.  The identity response can be cache by
  proxies and served to clients.  Historically, some proxies disabled
  caching if any Vary: response was seen.  If the Vary header is
  desirable, mod_deflate code which checks for Accept-Encoding and
  compression type can be moved down a few lines to be below the
  setting of the Vary response header.
3 years ago
Glenn Strauss be6da785c5 [mod_deflate] deflate.cache-dir compressed cache
(achieves feature parity with mod_compress)
3 years ago
Glenn Strauss 5b15c1f449 [mod_deflate] propagate errs from internal funcs
also, pass one less arg to internal funcs
3 years ago
Glenn Strauss b2fe37f0a9 [mod_deflate] fix typo in config option
(typo on master branch; never released)
3 years ago
Glenn Strauss f47ffb438c [build] bzip2 default to not-enabled in build
./configure --with-bzip2 to enable

(autoconf build previously had bzip2 enabled by default, but bzip2
 already disabled by default in CMake, SCONS, and meson build configs)
3 years ago
Glenn Strauss 8d5e237c60 [mod_deflate] Brotli support
configuration option: ./configure --with-brotli
3 years ago
Glenn Strauss be8047d82f [build] build fixes for AIX
x-ref:
  "Compile on AIX conflicting types for 'etag_create'"
  https://redmine.lighttpd.net/boards/2/topics/9242
3 years ago
Stefan Bühler 5722574df5 move ci-build.sh to scripts 3 years ago
Stefan Bühler 852de34113 add ci-build.sh 3 years ago
Glenn Strauss 1a516b4c4c [mod_vhostdb_dbi] allow strings and ints in config
e.g. allow "port" value to be a string or integer instead of requiring
     port be a string
3 years ago
Glenn Strauss 3dca923591 [mod_authn_mysql,file] use crypt() to save stack
use crypt() instead of crypt_r() to save stack space,
as struct crypt_data might be very large.

While crypt() is not thread-safe, lighttpd is single-threaded
3 years ago
Glenn Strauss fed2ecae19 [mod_authn_dbi] authn backend employing DBI 3 years ago
Glenn Strauss dba4a328c2 [core] Nettle assert()s if buffer len > digest sz 3 years ago
Glenn Strauss c3dd167dd9 [mod_openssl] fix build warnings on MacOS X
need undef OPENSSL_NO_STDIO for a few funcs which access filesystem
3 years ago
Glenn Strauss 33ae830291 [mod_auth] accept "nonce-secret" & "nonce_secret" 3 years ago
Glenn Strauss 563fe5f013 [mod_authn_ldap,mod_vhostdb_ldap] add timeout opt (#2805)
auth.backend.ldap.timeout = "2000000"    # quoted-string; microseconds
vhostdb.ldap += ("timeout" => "2000000") # quoted-string; microseconds

Default is 2000000 microseconds (2 secs)

These values are converted to struct timeval and passed to
  ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, );
  ldap_set_option(ld, LDAP_OPT_TIMEOUT, ...);
if those LDAP_OPT_* values are available (both are OpenLDAP-specific).

x-ref:
  "mod_auth caching"
  https://redmine.lighttpd.net/issues/2805
3 years ago
Glenn Strauss e11514b086 [mod_auth,mod_vhostdb] add caching option (fixes #2805)
auth.cache    = ("max-age" => "600")
vhostdb.cache = ("max-age" => "600")

If specified with an empty array, default max-age is 600 secs (10 mins)
auth.cache    = ()
vhostdb.cache = ()

(Note: cache expiration occurs every 8 seconds, so maximum cache time
 might be up to max-age + 8 seconds)

x-ref:
  "mod_auth caching"
  https://redmine.lighttpd.net/issues/2805
3 years ago
Rosen Penev fd2a12d636 [meson] add missing libmaxminddb section
Fixes the following error when building with -Dwith_maxminddb=true:

meson.build:916:1: ERROR: Unknown variable "libmaxminddb".

A full log can be found at meson-logs/meson-log.txt

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 04a7d98cb9 [meson] fix libmariadb dependency
libmariadb is what should be used as only the library portion is used.

Fixes compilation under OpenWrt.

Note that mariadb.pc is a superset that links to libmariadb.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Glenn Strauss 3057b63ea2 [multiple] address coverity warnings 3 years ago
Glenn Strauss 3119d938cb [mod_webdav] build fix: ifdef live_properties 3 years ago
Glenn Strauss 50ddc8108b [mod_webdav] update rc for PROPFIND allprop
(rc currently ignored in case of PROPFIND allprop)
3 years ago
Glenn Strauss 10b7aedcdb [mod_webdav] fix theoretical NULL dereference
fix theoretical NULL dereference identified by Coverity Scan

possible for PROPFIND with specific atypical choices in lighttpd.conf:
- possible for getcontenttype if no content type matches resource
  and no default type configured in lighttpd.conf
- possible for getetag if etag disabled in lighttpd.conf
3 years ago
Glenn Strauss 2781a3be6d [multiple] address coverity warnings 3 years ago
Glenn Strauss ea58cc6f3f [core] store fd in srv->stdin_fd during setup
(pedantic; no impact)

upon error, server will exit, so the impact of momentarily leaking fd
has no impact.  This commit holds the fd in srv->stdin_fd to address
Coverity warning about leaking fd when using server.bind = "/dev/stdin"
3 years ago
Glenn Strauss 6886e78bca [core] remove unused mbedtls_enabled flag
(initially used during development of mod_mbedtls, but no longer used)
3 years ago
Glenn Strauss 2f5fc68b59 [build] fix typo in src/Makefile.am EXTRA_DIST 3 years ago
Glenn Strauss c75fd15d7a [build] remove tests/mod-userdir.t from builds
(replaced with src/t/test_mod_userdir.c)
3 years ago
Glenn Strauss be0d11414e [cmake] update deps for src/t/test_* 3 years ago
Glenn Strauss 52fb78459f [cmake] update deps for src/t/test_* 3 years ago
Glenn Strauss f85d1f9070 [core] splaytree_djbhash() in splaytree.h (reuse)
rename and move hashme() from stat_cache.c to splaytree_djbhash() in
splaytree.h for code reuse
3 years ago
Glenn Strauss 0d4c8edd8f [mod_mysql_vhost] deprecated; use mod_vhostdb_mysql
add warning at server startup when mod_mysql_vhost is loaded

mod_vhostdb_mysql subsumes mod_mysql_vhost.  Individual mod_mysql_vhost
directives map one-to-one to keywords in vhostdb.mysql = (...) directive
3 years ago
Glenn Strauss d334eaf1ee [core] uint32_t is plenty large for path names 3 years ago
Glenn Strauss 28f1867c11 quiet clang analyzer scan-build warnings
(expansion of buffer_string_lenth() inline function and CONST_BUF_LEN()
 macro, which always check for NULL, appears to cause the analyzer to
 believe that a pointer might be NULL in cases where it otherwise can
 not be NULL)

x-ref:
  http://clang-analyzer.llvm.org/faq.html
3 years ago