Commit Graph

4336 Commits

Author SHA1 Message Date
Glenn Strauss bff5976524 [build] create sha512sum file with release
create sha512sum file with release, in addition to sha256sum file
2021-12-10 08:12:14 -05:00
Glenn Strauss 6c8578681d [doc] SELinux: setsebool -P httpd_setrlimit on
document setrlimit() under SELinux may need one-time setup
  setsebool -P httpd_setrlimit on
2021-12-10 01:46:55 -05:00
Glenn Strauss 18850c5c88 [build] check getxattr before attr_get and -lattr
check getxattr before attr_get and -lattr;
do not link with -lattr if getxattr is available from glibc

(modern glibc systems do not require libattr-devel build dependency)
2021-12-10 01:35:59 -05:00
Glenn Strauss 8a535e7e06 [mod_webdav] If-None-Match on non-existent entity
fix logic inversion on If-None-Match test on non-existent entity

return 412 if If-None-Match: "*" for non-existent entity

x-ref:
  "trying to use Joplin Android App with lighttpd"
  https://redmine.lighttpd.net/boards/3/topics/10193
2021-12-09 17:02:19 -05:00
Glenn Strauss b1578f9548 [core] add remote IP to some error msgs (fixes #3122)
add remote IP to some select error msgs

x-ref:
  "Error messages should include client IP"
  https://redmine.lighttpd.net/issues/3122
2021-12-09 05:56:13 -05:00
Glenn Strauss 5a257fab51 [core] make setrlimit() warn, not fatal
(thx limb)

make setrlimit() issue warning on error, not fatal,
and add suggesting to configure SELinux permissions
2021-12-08 18:42:31 -05:00
Glenn Strauss b68b805c54 [core] adjust time jump detection (fixes #3123)
adjust time jump detection to handle when server.max-workers is non-zero

x-ref:
  "child exit causes time jump false positive when server.max-workers is non-zero"
  https://redmine.lighttpd.net/issues/3123
2021-12-08 16:47:10 -05:00
Glenn Strauss fae1c05191 [meson] need -lrt with glibc < 2.17 (fixes #3120)
(thx gzpapp at gmail dot com)

x-ref:
  "Building on glibc 2.16 where clock_gettime() is in librt.so"
  https://redmine.lighttpd.net/issues/3120
2021-12-07 19:54:21 -05:00
Glenn Strauss 492773a20f [core] fix trace issued for loading mod_auth (fixes #3121)
fix trace issued for loading mod_auth after dynamic modules

x-ref:
  "Curious message on startup with version 1.4.63"
  https://redmine.lighttpd.net/boards/2/topics/10182
  "mod_auth warning on startup"
  https://redmine.lighttpd.net/issues/3121
2021-12-07 19:43:27 -05:00
Glenn Strauss 18370ed85e - next is 1.4.64 2021-12-04 09:41:43 -05:00
Glenn Strauss 0340dc943c [doc] NEWS 2021-12-04 08:55:39 -05:00
Glenn Strauss ef9608f307 [core] fix reqpool mem corruption in 1.4.62 (fixes #3118)
x-ref:
  "Segfault after updating to version 1.4.62"
  https://redmine.lighttpd.net/issues/3118
  "Segfault on closing connections"
  https://redmine.lighttpd.net/issues/3119
2021-12-04 07:40:37 -05:00
Glenn Strauss d6debd43ff [core] isolate use of sys/filio.h
isolate use of sys/filio.h to fdevent_ioctl_fionread()
(illumos (OpenIndiana) defines FIONREAD in sys/filio.h)
2021-12-02 05:48:57 -05:00
Glenn Strauss 23b07fa3ef [core] import xxHash v0.8.1
import xxhash.[ch] as algo_xxhash.[ch]

https://github.com/Cyan4973/xxHash
tag: v0.8.1 35b0373c697b5f160d3db26b1cbb45a0d5ba788c
2021-12-02 02:12:55 -05:00
Glenn Strauss f4143d957e - next is 1.4.63 2021-12-02 00:23:13 -05:00
Glenn Strauss a8c939273b [doc] NEWS 2021-12-01 05:53:46 -05:00
Glenn Strauss 5ca9eca8c4 [core] fix crash when using lighttpd -1 with pipes (fixes #3117)
(thx povcfe-bug)

In some scenarios with lighttpd -1 on pipes, the event handler
associated with the connection (con) will have been cleaned up,
and a pending event on the one-off oneshot_fdn will not yet have
been handled, leading to a crash.  lighttpd typically is used to
handle requests on sockets, not pipes.  With nc (netcat), the
requests might be sent over pipes.  The bug occurred with the
accommodations made in lighttpd to handle the request over pipes.

x-ref:
  "Trigger crash when using lighttpd -1 with pipes"
  https://redmine.lighttpd.net/issues/3117
2021-12-01 05:52:53 -05:00
Glenn Strauss 0573ce1945 [doc] refresh/update dependency lists in doc 2021-11-30 05:07:40 -05:00
Glenn Strauss 60c9612a76 [mod_auth] quiet coverity warning 2021-11-29 11:36:52 -05:00
Glenn Strauss 863551cd8d [tests] t/test_mod_ssi adjust to follow symlinks
t/test_mod_ssi adjust to follow symlinks

/tmp may be a symlink on MacOS
2021-11-28 21:24:19 -05:00
Glenn Strauss cba6a1ab54 [mod_dirlisting] fix bug not showing HEADER.txt
(thx gsker)

fix bug not showing HEADER.txt or README.txt
(regression in lighttpd 1.4.60 and 1.4.61)
2021-11-28 15:15:33 -05:00
Glenn Strauss 71175df1c9 [mod_auth] RFC7616 HTTP Digest username* userhash
RFC7616 HTTP Digest username* and userhash support (if configured)

userhash support must be configured to enable:
  auth.require = ( "/" => ( "userhash" => "enable", ... ) )
and one of
  auth.backend = "htdigest"  # mod_authn_file
    or
  auth.backend = "dbi"       # mod_authn_dbi
and appropriate modification to add userhash into htdigest or db table
along with adding "sql-userhash" => "..." SQL query for mod_authn_dbi

Note: open issue with curl preventing userhash from working with curl:
  https://github.com/curl/curl/pull/8066
2021-11-28 03:12:00 -05:00
Glenn Strauss 3bd733c27e [build] fix CMake pcre2 detection 2021-11-24 20:48:27 -05:00
Glenn Strauss 9345116604 [core] fix compiler warning in 32-bit build 2021-11-24 20:12:26 -05:00
Glenn Strauss be5ab2765c [build] CI builds now use pcre2 (upgrade pcre)
pcre2 is current.  pcre is no longer maintained.
2021-11-23 03:14:03 -05:00
Glenn Strauss 16823cd942 [build] configure.ac with AC_PROG_CC_C99 (fixes #3116)
(thx arnout)

x-ref:
  "Build failure with autotools and gcc 4.8 since version 1.4.60"
  https://redmine.lighttpd.net/issues/3116
2021-11-22 22:33:05 -05:00
Glenn Strauss c378e3ad8c [core] allocate pcre output vector on demand
allocate pcre output vector on demand for saved config captures
(similar to what is done in lighttpd for pcre2 support)
2021-11-22 22:33:05 -05:00
Glenn Strauss 670b3a395f [core] allocate one fewer cond_match_t, if needed
allocate one fewer cond_match_t in r->cond_match_data, if any are needed
2021-11-22 16:34:17 -05:00
Glenn Strauss 7512d82ca4 [core] pcre2 support (--with-pcre2)
x-ref:
  "lighttpd: depends on obsolete pcre3 library"
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000063
2021-11-22 02:50:26 -05:00
Glenn Strauss 7db817c59a [core] extend pcre_keyvalue_ctx to pass more state
extend pcre_keyvalue_ctx to pass internal state
2021-11-21 21:27:52 -05:00
Glenn Strauss 6d47d4c699 [core] use stack w/ pcre_exec unless save captures
use stack w/ pcre_exec unless saving captures from config conditions

reduce memory allocations per request where lighttpd.conf does not
contain url.redirect or url.rewrite rules where replacements reference
a match of the enclosing lighttpd.conf condition (e.g. %0, %1, %2 ...)

move cond_cache_t 'patterncount' to cond_match_t 'captures'
While cond_match_t is no longer sized power-2, it is generally expected
to be used much less frequently than before (which was all the time),
since it is now used only with url.redirect or url.rewrite with
references %0, %1, %2, ...
2021-11-20 03:33:16 -05:00
Glenn Strauss 3b3574c5e6 [core] save pcre result state in config_pcre_match
rename data_config_pcre_exec() to config_pcre_match()
  and move logic saving pcre result state from
  config_check_cond_nocache()

split config_check_cond_nocache() into two funcs
  config_check_cond_nocache() participates in recursion
  config_check_cond_nocache_eval() evaluates the condition
2021-11-20 02:53:24 -05:00
Glenn Strauss 7ea2d40734 [core] save config regex captures only if used
save config regex captures separately only if used by url.redirect
or url.rewrite replacement directives within the condition
(or for conditions containing directives from any other module
 which calls config_capture() for its directives during init)

keep pointer to match data (cond_match_t *) in r->cond_match[]
rather than cond_match_t to reduce data copying in h2_init_stream().
h2_init_stream() copies the results for already-evaluated conditions
to avoid re-evaluating connection-level conditions for each and every
stream.  When conditions are reset, then the pointer in r->cond_match[]
is updated when the condition is re-evaluated.  (This all assumes that
HTTP/2 connection-level conditions are not unset or re-evaluated once
HTTP/2 streams begin.)
2021-11-19 20:48:05 -05:00
Glenn Strauss 04d387e37f [tests] t/test_mod needs -ldl on Debian 2021-11-18 02:31:30 -05:00
Glenn Strauss c52ea837b5 [mod_dirlisting] (experimental) json (disabled)
checkpoint (experimental) json output (disabled) from mod_dirlisting

Soliciting feedback from anyone who might write client javascript
employing json output from mod_dirlisting.  What should be changed?
2021-11-17 21:51:57 -05:00
Glenn Strauss e1ff1cc871 [core] buffer_append_string_encoded_json() 2021-11-17 21:51:57 -05:00
Glenn Strauss d85ed2a672 [mod_dirlisting] check for disabled cache at start
check for explicitly disabled cache during startup config
  (dir-listing.cache = ("max-age" => 0))
(e.g. to disable after having been enabled)
2021-11-17 21:51:57 -05:00
Glenn Strauss f350681ff0 [core] get_http_method_key() tweak 2021-11-17 21:51:57 -05:00
Glenn Strauss bab0e5d084 [tests] combine tests into test_common.c
combine common components tests into test_common.c

combine into a single executable to reduce compilation/link redundancy
2021-11-17 21:51:55 -05:00
Glenn Strauss 44a67cabcc [mod_evasive] update comment to add references
update comment to add references to other modules and mechanisms
available in lighttpd to enforce security policy
2021-11-15 11:59:18 -05:00
Glenn Strauss 8e4cf2231e [tests] t/test_mod_evasive.c 2021-11-15 11:59:18 -05:00
Glenn Strauss 4288375a23 [mod_evasive] smaller funcs for testing 2021-11-15 11:59:18 -05:00
Glenn Strauss 3034147e51 [tests] remove unused mod from tests/lighttpd.conf
remove unused module mod_userdir from tests/lighttpd.conf
(module is tested in src/t/test_mod_userdir.c)
2021-11-15 11:59:18 -05:00
Glenn Strauss 251f97bf4f [tests] t/test_mod_alias.c 2021-11-15 11:59:18 -05:00
Glenn Strauss 9b3fa6eb2b [tests] t/test_mod now runs all t/test_mod_*.c
combine into a single executable to reduce compilation/link redundancy
2021-11-15 11:59:16 -05:00
Glenn Strauss 05dc3d123a [core] better asm for binary num to ascii string
compiler optimizers generally convert div to an equivalent mul,
though not always optimally for modulus (%).  In places where
lighttpd is using both quotient and remainder, calculate the
remainder from the quotient.

x-ref: inspiration:
  https://lemire.me/blog/2019/02/08/faster-remainders-when-the-divisor-is-a-constant-beating-compilers-and-libdivide/
  https://lemire.me/blog/2019/02/20/more-fun-with-fast-remainders-when-the-divisor-is-a-constant/
2021-11-12 17:56:38 -05:00
Glenn Strauss 57c0859fd7 [core] uint_fast32_t tweaks
use uint_fast32_t in a few more places, where it yields better asm
2021-11-12 17:56:38 -05:00
Glenn Strauss 741513ecd1 [mod_ssi] merge mod_ssi_expr.c into mod_ssi.c
isolate this ancient relic
2021-11-12 17:56:38 -05:00
Glenn Strauss 457362cbe3 [mod_ssi] remove mod_ssi parser generator file 2021-11-12 17:56:38 -05:00
Glenn Strauss 43c5093a20 [mod_ssi] fix ancient bugs; replace cond parser 2021-11-12 17:56:38 -05:00