Commit Graph

2194 Commits (8960633dc71afefb2f7d7ea1c9a8e435c8df0e36)
 

Author SHA1 Message Date
Glenn Strauss 8960633dc7 [mod_openssl] move openssl config into mod_openssl
move openssl data structures and config parsing into mod_openssl
6 years ago
Glenn Strauss bdbea2aea8 [mod_openssl] move openssl code into mod_openssl
large code move, but minimal changes made to code (besides whitespace),
so that code builds

next: need to isolate openssl data structures and config parsing
6 years ago
Glenn Strauss 4364a4e029 [core] move network_open_file_chunk() to chunk.c
move network_open_file_chunk() to chunk.c:chunkqueue_open_file_chunk()
for reuse from modules
6 years ago
Glenn Strauss cb9ebe9fa6 [mod_openssl] new module (preliminary layout) 6 years ago
Glenn Strauss cb7ed13621 [core] new plugin hooks to help isolate SSL
handle_request_env        (called on demand by handlers to populate env)
handle_connection_accept
handle_connection_shut_wr (was handle_connection_close)
handle_connection_close   (now occurs at socket close())
6 years ago
Glenn Strauss 2bc94dee82 [core] con interface for read/write; isolate SSL 6 years ago
Glenn Strauss 93fc82c4ac [mod_mysql_vhost] remove dev debug code 6 years ago
Glenn Strauss 1adf1df285 remove redundant calls to end-of-request hooks
The (misnamed) connection_reset hook is always called after a request,
whether request completes or is aborted, and whether keep-alive or not,
so no needed to repeat the same function in the handle_connection_close
hook.
6 years ago
Glenn Strauss a801ef55a0 [TLS] mark code that uses -lcrypto but not -lssl
mark code that uses openssl -lcrypto with USE_OPENSSL_CRYPTO
to note that it does not depend on openssl -lssl (USE_OPENSSL)
6 years ago
Glenn Strauss b0d63e31e8 - next is 1.4.46 6 years ago
Glenn Strauss f9b391645f [mod_cgi] check cgi fd for num bytes ready to read
(fix code which incorrectly checked con->fd, which may have resulted
 in suboptimal buffer size for read)
6 years ago
Glenn Strauss 83b2b71527 [tests] give time for periodic jobs to detect exit
give time for periodic jobs to detect backend exit
6 years ago
Glenn Strauss 16f171588f [tests] FCGI_Finish() final request before exit 6 years ago
Glenn Strauss 32443ea1c7 [tests] update test skip count for !fcgi-responder 6 years ago
Glenn Strauss 4f00aafcde [doc] NEWS 6 years ago
Glenn Strauss b03c496298 [TLS] ssl.read-ahead = "disable" for low mem (fixes #2778)
new directive ssl.read-ahead = "enable"/"disable" to control
SSL_CTX_set_read_ahead().  Default "enable".  The "disable" setting
is intended for use on low memory systems with a slow CPU which is
unable to keep up with decryption of large request bodies.

x-ref:
  "larger memory usage for file uploads via SSL on embedded system"
  https://redmine.lighttpd.net/issues/2778
6 years ago
Glenn Strauss be520a8058 [mod_scgi] detect child exit, restart proactively
(instead of detecting upon a subsequent HTTP request)

(for backends spawned by mod_scgi)
6 years ago
Glenn Strauss 64df38aad8 [mod_fastcgi] detect child exit, restart proactively
(instead of detecting upon a subsequent HTTP request)

(for backends spawned by mod_fastcgi)
6 years ago
Glenn Strauss 987a76ff58 [mod_webdav] fix crash when plugin_ctx cleaned up (fixes #2780)
fixes error trace
  (connections.c.273) missing cleanup in webdav

(thx nickrickard)

x-ref:
  "mod_webdav crash with keep-alive (1.4.44)"
  https://redmine.lighttpd.net/issues/2780
6 years ago
Glenn Strauss f57d8c54b4 [mod_cgi] skip local-redir handling if to self (fixes #2779, #2108)
Loosen local redirect handling in mod_cgi to skip handling as local
redirect if the Location matches con->uri.path, since if the request
is intended to redirect back to the same CGI using the same request
method, path info, and query string, the CGI would logically just
return the final intended response.  Loosening this handling avoids a
problem with applications (potentially) accessible through multiple
gateways, where the application is not aware of this specific handling
of Location in the Common Gateway Interface (CGI/1.1), the application
sends abs-path in the Location response header instead of absoluteURI,
and the application expects the client to receive this Location response
header instead of the server to process as a CGI local redirect.

One example of such an application is LuCI,
which sends Set-Cookie with Location: /abs-path
  https://github.com/openwrt/luci

(Note that this loose check for matching con->uri.path is not perfect
 and might not match if the CGI returned a path with a different case
 and the server is on a case-insensitive filesystem, or if the path
 returned by the CGI is rewritten elsewhere to a different con->uri.path
 before getting to mod_cgi.)

RFC3875 CGI 1.1 specification section 6.2.2 Local Redirect Response
http://www.ietf.org/rfc/rfc3875

x-ref:
  "CGI local-redir handling conflicts with LuCI redirect w/ Set-Cookie"
  https://redmine.lighttpd.net/issues/2779
  "CGI local redirect not implemented correctly"
  https://redmine.lighttpd.net/issues/2108
6 years ago
Glenn Strauss 656f9e454d - next is 1.4.45 7 years ago
Glenn Strauss 367bc5fd28 [doc] NEWS 7 years ago
Glenn Strauss 38d00abd8f [TLS] openssl 1.1.0 makes SSL_OP_NO_SSLv2 no-op
silence coverity warning

openssl 1.1.0 makes SSL_OP_NO_SSLv2 flag a no-op, leading to
logically dead code when used with openssl 1.1.0.  However, the code
is still valid with earlier openssl versions, and so must be preserved.
7 years ago
Stefan Bühler a09d80dfd1 fix SCons fullstatic build with glibc pthreads
[with some modifications by gstrauss]
7 years ago
Glenn Strauss c718064911 [mod_cgi] fall back to pipe() if pipe2() fails
This change should fix an issue with lighttpd on Debian kfreebsd-* arch
  (kfreebsd-amd64 and kfreebsd-i386)
.libs/mod_cgi.o: In function `cgi_create_env':
./src/mod_cgi.c:1103: warning: pipe2 is not implemented and will always fail

lighttpd is single-threaded so there is no race with pipe()
and then fcntl() F_SETFD FD_CLOEXEC on the pair of pipe fds.
Using pipe2() where available is still slightly more efficient
by eliding the syscalls to set FD_CLOEXEC.
7 years ago
Glenn Strauss 2ca402c64d [mod_proxy] proxy.replace-http-host enable/disable
mark directive as taking boolean value, not integer value
7 years ago
Glenn Strauss 15bc2313a4 [tests] mark tests/docroot/www/*.pl scripts a+x 7 years ago
Glenn Strauss 0f4cc0d697 [mod_evhost] fix an incorrect error trace 7 years ago
Glenn Strauss 22ca2778a8 [build] check for pipe2() at configure time
Lack of pipe2() on relic Unix as well as missing on Mac OSX is likely
one reason why threaded web servers such as nginx choose not to support
CGI except via an external service to the process.  Without pipe2(),
race conditions exist and it is not safe for a threaded server to use
pipe() and fork() when the server also does not want to potentially leak
open file descriptors to various unrelated CGI scripts.
7 years ago
Glenn Strauss 9619d643ff [build] compile fixes for AIX
x-ref:
  https://www.lighttpd.net/2016/10/31/1.4.43/  (see comments section)
7 years ago
Glenn Strauss 17f6595e1a [mod_secdownload] warn if SHA used w/o SSL crypto
issue warning at startup, instead of fatal error, if SHA used in
secdownload.algorithm = "..." but mod_secdownload was built without
SSL crypto.  When lighttpd is built without openssl, this allows most
tests/* to be run and pass, except the ones in tests/mod-secdownload.t
which use "hmac-sha1" or "hmac-sha256".

(alternatively, could have made, used isolated tests/secdownload.conf)
7 years ago
Glenn Strauss 6598968796 [mod_proxy] proxy.balance = "sticky" option (fixes #2117)
attempt to route requests to same backends based on requestor (client)
IP address and target host and port of request.

(thx bra)

x-ref:
  "Source IP sticky load balancing patch"
  https://redmine.lighttpd.net/issues/2117
7 years ago
Glenn Strauss 539deb7370 [autobuild] set NO_RDYNAMIC=yes for midipix
(thx Redfoxmoon)
7 years ago
Glenn Strauss 4d7f5737f1 [core] support Transfer-Encoding: chunked req body (fixes #2156)
support Transfer-Encoding: chunked request body in conjunction with
  server.stream-request-body = 0

dynamic handlers will still return 411 Length Required if
  server.stream-request-body = 1 or 2 (!= 0)
  since CGI-like env requires CONTENT_LENGTH be set
  (and mod_proxy currently sends HTTP/1.0 requests to backends,
   and Content-Length recommended for robust interaction with backend)

x-ref:
  "request: support Chunked Transfer Coding for HTTP PUT"
  https://redmine.lighttpd.net/issues/2156
7 years ago
Glenn Strauss f792d84cf9 [core] fix segfault when parsing a bad config file
(thx goblin)

x-ref:
  "fix a segfault when parsing a bad config file"
  https://github.com/lighttpd/lighttpd1.4/pull/75

github: closes #75
7 years ago
Glenn Strauss ede9b3fc4c [core] consolidate duplicated read-to-close code
more efficiently detect end-of-stream when closing connection

log fd prior to resetting fd to -1 when log_state_handling enabled
7 years ago
Glenn Strauss c367b1ca80 [mod_ssi] implement, ignore <!--#comment ... --> 7 years ago
Glenn Strauss 185e262bf5 [mod_ssi] basic recursive SSI include virtual (fixes #536)
EXPERIMENTAL: basic recursive SSI <!--#include virtual="..." -->
Marked experimental since behavior may change in future.

Prior behavior was simpler and treated them all as files included as-is.

New behavior treats all #include virtual="..." targets as SSI files.

In the future, this may change to be a full recursive subrequest and the
virtual path may be treated as a new subrequest and might be something
other than SSI (e.g. might be CGI).  This has not been implemented.

Current behavior processes <!--#include virtual="..." --> as static file
Enable new behavior by setting ssi.recursion-max to value other than 0.
ssi.recursion-max = X to set maximum recusion depth

x-ref:
  "add recursion to the SSI #include directive"
  https://redmine.lighttpd.net/issues/536
7 years ago
Glenn Strauss 879ce0b534 [mod_proxy] replace HTTP Host sent to backend (fixes #2770)
replace HTTP Host sent to backend if configured with
  proxy.replace-http-host = "enable"
and lighttpd.conf proxy.server definition provides replacement Host

(thx altblue)

x-ref:
  "Override proxified Host header"
  https://redmine.lighttpd.net/issues/2770
7 years ago
Glenn Strauss 090985af6b [mod_dirlisting] render dirlisting as HTML (fixes #2767)
(thx altblue)

x-ref:
  "Render dirlisting as HTML"
  https://redmine.lighttpd.net/issues/2767
7 years ago
Glenn Strauss da86a596f5 [core] permit connection-level state in modules
modules may now keep state for the lifetime of a connection,
rather than being required to be reset after every request (when
there can be multiple keep-alive requests on the same connection)
7 years ago
Glenn Strauss 28c8fec42b [core] defer li_rand_init() until first use
defer li_rand_init() until first use of li_rand_pseudo_bytes()

li_rand_init() is now deferred until first use so that installations
that do not use modules which use these routines do need to potentially
block at startup.  Current use by core lighttpd modules is in mod_auth
HTTP Digest auth and in mod_usertrack.  Deferring collection of random
data until first use may allow sufficient entropy to be collected by
kernel before first use, helping reduce or avoid situations in
low-entropy-generating embedded devices which might otherwise block
lighttpd for minutes at device startup.  Further discussion in
https://redmine.lighttpd.net/boards/2/topics/6981
7 years ago
Glenn Strauss 544ccee5e1 [core] remove srv->entropy[]
unlikely to provide any real additional benefit as long as
PRNG has been appropriately initialized with random data
7 years ago
Glenn Strauss 83ec97a054 [mod_ssi] produce content in subrequest hook
(prerequisite for future mod_ssi enhancements)

This commit also addresses the concern that mod_geoip would
(previously) need to be listed in modules prior to mod_ssi.
x-ref:
  https://github.com/lighttpd/lighttpd1.4/pull/73
7 years ago
Glenn Strauss ac9822f468 [core] combine duplicated connection reset code
connection_reset() now calls connection_response_reset()
instead of duplicating the code in both routines
7 years ago
Glenn Strauss 445bc2914a [mod_cml] include lua headers before base.h
to avoid (historical) conflict with IN and OUT macros used in lua
and openssl headers (since base.h includes openssl headers when present)
7 years ago
Glenn Strauss 431bc346df remove #include "stream.h" where not used 7 years ago
Glenn Strauss c64c2173ce [core] rename li_rand() to li_rand_pseudo_bytes()
to be more explicit that the result is pseudo-random data
and not cryptographically random.
7 years ago
Glenn Strauss 7ef58b5a81 [mod_authn_gssapi] fix missing error ret, coverity
fix missing error returns and coverity warnings
7 years ago
Glenn Strauss 1584c5d7d2 [doc] remove reference to Linux rt-signals
Linux rt-signals fdevent mechanism was removed a while ago
7 years ago