| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
_WIN32 __declspec(dllexport) on mod_*_plugin_init()
|
|
|
|
| |
mingw does not support strftime() "%F %T"
|
|
|
|
| |
(selective implementations; not complete)
|
|
|
|
| |
_WIN32 FindFirstFile(), FindNextFile(), FindClose()
|
|
|
|
|
|
|
| |
no lstat()
no S_IFSOCK
no S_ISSOCK()
...
|
|
|
|
| |
send 409 Conflict if PUT into parent collection which does not exist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-DMOD_WEBDAV_BUILD_MINIMAL preprocessor option to disable PROPPATCH,
LOCK, UNLOCK by removing dependencies on libxml2, libsqlite3, libuuid
(even if built --with-webdav-props --with-webdav-locks)
This permits building mod_webdav.so and an alternative mod_webdav_min.so
without the extra dependencies if the build system is extended to build
mod_webdav_min, compiling mod_webdav.c with -DMOD_WEBDAV_BUILD_MINIMAL
-Dmod_webdav_plugin_init=mod_webdav_min_plugin_init
(note: build systems have not been extended here for mod_webdav_min.so)
x-ref:
"lighttpd-mod-webdav dependency to SQLite"
https://redmine.lighttpd.net/issues/3188
|
|
|
|
|
|
|
|
|
|
|
| |
modify OPTIONS response if webdav.sqlite-db-name is not configured
if webdav.sqlite-db-name is not configured, then in OPTIONS response
- do not advertise PROPPATCH, LOCK, or UNLOCK in "Allow" response header
- do not advertise DAV Compliance Class 2 in "DAV" response header
x-ref:
https://redmine.lighttpd.net/issues/3188
|
| |
|
|
|
|
|
| |
employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)
|
|
|
|
| |
employ ck_realloc_u32() shared code to slightly reduce code size
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
manually calculate off_t max for broken cross-compilation systems which
fail to enable large file support (so sizeof(off_t) != sizeof(int64_t))
If sizeof(off_t) != sizeof(int64_t), a negative number could end up in
cq->upload_temp_file_size when it was assigned INTMAX_MAX, leading to
excessive new temporary file creation occurring on each and every write.
x-ref:
"File upload regression with --disable-lfs"
https://redmine.lighttpd.net/issues/3171
|
| |
|
|
|
|
|
| |
webdav_reqbody_type_xml() must check request headers (behavior fix)
protect webdav_reqbody_type_xml() with USE_PROPPATCH (compile fix)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
alternative way of handling PROPFIND on collection where the request was
made without a trailing slash. Instead of sending 308 redirect in some
cases, set Content-Location response header *and* treat as if request
had been made with trailing slash on the collection for PROPFIND and
PROPPATCH.
https://www.rfc-editor.org/rfc/rfc4918#section-5.2
There is a standing convention that when a collection is referred to
by its name without a trailing slash, the server MAY handle the
request as if the trailing slash were present. In this case, it
SHOULD return a Content-Location header in the response, pointing to
the URL ending with the "/".
x-ref:
"The previous workaround for GVFS is breaking the new version of GVFS"
https://redmine.lighttpd.net/boards/2/topics/10468
HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)
https://www.rfc-editor.org/rfc/rfc4918#section-5.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fix logic for If-None-Match: * test on non-existent entity
(regression in lighttpd 1.4.64)
If-None-Match: * should not fail on a non-existent entity,
as it may be used to make the request conditional on the
origin server having no current representation of the entity.
(see If-None-Match in RFC2616 and RFC7232)
(This logic had been changed in lighttpd 1.4.64 in
commit 8a535e7e064b0c33c3b60a92df88b349d79b94c2
when allowing bogus, non-'*' If-None-Match etags
for non-existent entities to not-match (and pass the check)
|
|
|
|
|
| |
use preferred syntax for Content-Type: .../charset=...
(match preferred syntax specified in upcoming HTTP spec revision)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
option for partial PUT via copy/modify/rename
webdav.opts += ("partial-put-copy-modify" => "enable")
Some modern filesystems support efficiently cloning files,
making it less expensive to copy to a tempfile, modify, and
atomically rename the modified tempfile to replace the original.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
chunkqueue_chunk_file_view()
reduces size of struct chunk
use mmap with mod_deflate libdeflate, if mmap available,
even when lighttpd not built with --enable-mmap
avoid using mmap on temp files in chunkqueue (c->file.is_temp)
since pread() with a reasonable block size is typically as fast
or faster than mmap on files read sequentially and used only once,
especially when writing results to limited-size socket buffers
(and lighttpd temp files are, in most cases, by default about 1 MB)
(Exception: sometimes mmap is used for convenience or to fulfill
a requirement, e.g. one-shot libdeflate in mod_deflate)
(There are many factors which influence speed of mmap versus pread,
so this should not be construed as generic usage advice.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(thx ryandesign)
There is no COPYFILE_CLONE_FORCE on OSX <10.12 so fall back to using
fcopyfile() to avoid race condition on source (if changed to dir) if
using copyfile() with flags equivalent to COPYFILE_CLONE_FORCE, but
without the 'force' flag.
x-ref:
"error: use of undeclared identifier 'COPYFILE_CLONE_FORCE'"
https://redmine.lighttpd.net/issues/3142
|
| |
|
|
|
|
| |
(including linux/fs.h later might reveal RENAME_NOREPLACE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* copy acceleration
* safety for accelerated copying of files > 2 GB on 32-bit systems
* disable hard linking when "deprecated-unsafe-partial-put" => "enable"
(In normal operation, hard-linking is safe for copying since WebDAV
modification of any file involves full upload of file and atomic
replacement, which severs any hard-links. When deprecated unsafe
partial PUT is permitted, that is not the case.)
x-ref:
https://man7.org/linux/man-pages/man2/copy_file_range.2.html
https://www.freebsd.org/cgi/man.cgi?query=copy_file_range&sektion=2&n=1
https://man7.org/linux/man-pages/man2/ioctl_ficlone.2.html
https://keith.github.io/xcode-man-pages/clonefile.2.html
https://keith.github.io/xcode-man-pages/copyfile.3.html
|
|
|
|
|
|
|
|
|
|
|
| |
(take 2)
adjust feature defines for header visibility of copy_file_range()
(introduced in FreeBSD 13)
x-ref:
https://redmine.lighttpd.net/issues/3128
https://github.com/freebsd/freebsd-src/blob/main/sys/sys/cdefs.h#L634
|
|
|
|
|
|
|
|
|
|
|
| |
(thx devnexen)
adjust feature defines for header visibility of copy_file_range()
(introduced in FreeBSD 13)
x-ref:
https://redmine.lighttpd.net/issues/3128
https://github.com/freebsd/freebsd-src/blob/main/sys/sys/cdefs.h#L634
|
|
|
|
|
| |
detect truncated file when using copy_file_range(), even though
this should not happen with lighttpd-created temporary files
|
|
|
|
| |
(no longer used; was used as temporary buffer)
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(thx meeb5)
ignore PROPFIND "Depth" request header for files (non-collections)
RFC4918 10.2. Depth Header
"If a resource does not have internal members, then the Depth header MUST be ignored."
x-ref:
"Webdav + rclone backup"
https://redmine.lighttpd.net/boards/2/topics/10081
|
|
|
|
|
|
| |
fdevent_mkostemp() with flags arg so that caller can pass O_APPEND
renamed from fdevent_mkstemp_append(), previously always O_APPEND
|
|
|
|
|
|
| |
previously undocumented server.upload-temp-file-size in lighttpd 1.4.38
preceded introduction of lighttpd streaming options in lighttpd 1.4.40
(server.stream-request-body and server.stream-response-body)
|
|
|
|
|
| |
chunkqueue_append_buffer() always clears buffer
(instead of relying on caller to do so after the call)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most OS platforms have already provided solutions to
Y2038 32-bit signed time_t 5 - 10 years ago (or more!)
Notable exceptions are Linux i686 and FreeBSD i386.
Since 32-bit systems tend to be embedded systems,
and since many distros take years to pick up new software,
this commit aims to provide Y2038 mitigations for lighttpd
running on 32-bit systems with Y2038-unsafe 32-bit signed time_t
* Y2038: lighttpd 1.4.60 and later report Y2038 safety
$ lighttpd -V
+ Y2038 support # Y2038-SAFE
$ lighttpd -V
- Y2038 support (unsafe 32-bit signed time_t) # Y2038-UNSAFE
* Y2038: general platform info
* Y2038-SAFE: lighttpd 64-bit builds on platforms using 64-bit time_t
- all major 64-bit platforms (known to this author) use 64-bit time_t
* Y2038-SAFE: lighttpd 32-bit builds on platforms using 64-bit time_t
- Linux x32 ABI (different from i686)
- FreeBSD all 32-bit and 64-bit architectures *except* 32-bit i386
- NetBSD 6.0 (released Oct 2012) all 32-bit and 64-bit architectures
- OpenBSD 5.5 (released May 2014) all 32-bit and 64-bit architectures
- Microsoft Windows XP and Visual Studio 2005 (? unsure ?)
Another reference suggests Visual Studio 2015 defaults to 64-bit time_t
- MacOS 10.15 Catalina (released 2019) drops support for 32-bit apps
* Y2038-SAFE: lighttpd 32-bit builds on platforms using 32-bit unsigned time_t
- e.g. OpenVMS (unknown if lighttpd builds on this platform)
* Y2038-UNSAFE: lighttpd 32-bit builds on platforms using 32-bit signed time_t
- Linux 32-bit (including i686)
- glibc 32-bit library support not yet available for 64-bit time_t
- https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
- Linux kernel 5.6 on 32-bit platforms does support 64-bit time_t
https://itsubuntu.com/linux-kernel-5-6-to-fix-the-year-2038-issue-unix-y2k/
- https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
"Note: at this point, 64-bit time support in dual-time
configurations is work-in-progress, so for these
configurations, the public API only makes the 32-bit time
support available. In a later change, the public API will
allow user code to choose the time size for a given
compilation unit."
- compiling with -D_TIME_BITS=64 currently has no effect
- glibc recent (Jul 2021) mailing list discussion
- https://public-inbox.org/bug-gnulib/878s2ozq70.fsf@oldenburg.str.redhat.com/T/
- FreeBSD i386
- DragonFlyBSD 32-bit
* Y2038 mitigations attempted on Y2038-UNSAFE platforms (32-bit signed time_t)
* lighttpd prefers system monotonic clock instead of realtime clock
in places where realtime clock is not required
* lighttpd treats negative time_t values as after 19 Jan 2038 03:14:07 GMT
* (lighttpd presumes that lighttpd will not encounter dates before 1970
during normal operation.)
* lighttpd casts struct stat st.st_mtime (and st.st_*time) through uint64_t
to convert negative timestamps for comparisions with 64-bit timestamps
(treating negative timestamp values as after 19 Jan 2038 03:14:07 GMT)
* lighttpd provides unix_time64_t (int64_t) and
* lighttpd provides struct unix_timespec64 (unix_timespec64_t)
(struct timespec equivalent using unix_time64_t tv_sec member)
* lighttpd provides gmtime64_r() and localtime64_r() wrappers
for platforms 32-bit platforms using 32-bit time_t and
lighttpd temporarily shifts the year in order to use
gmtime_r() and localtime_r() (or gmtime() and localtime())
from standard libraries, before readjusting year and passing
struct tm to formatting functions such as strftime()
* lighttpd provides TIME64_CAST() macro to cast signed 32-bit time_t to
unsigned 32-bit and then to unix_time64_t
* Note: while lighttpd tries handle times past 19 Jan 2038 03:14:07 GMT
on 32-bit platforms using 32-bit signed time_t, underlying libraries and
underlying filesystems might not behave properly after 32-bit signed time_t
overflows (19 Jan 2038 03:14:08 GMT). If a given 32-bit OS does not work
properly using negative time_t values, then lighttpd likely will not work
properly on that system.
* Other references and blogs
- https://en.wikipedia.org/wiki/Year_2038_problem
- https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs
- http://www.lieberbiber.de/2017/03/14/a-look-at-the-year-20362038-problems-and-time-proofness-in-various-systems/
|
|
|
|
| |
append IMF-fixdate time string to (buffer *)
|
|
|
|
| |
reduce use of BUFFER_INTLEN_PTR where b->ptr known not to be NULL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.
Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.
In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.
- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend
Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)
internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg
|
| |
|
| |
|
| |
|
|
|
|
| |
(bug on master branch)
|
|
|
|
|
| |
(previously was defined only if mod_webdav was built with
PROPPATCH and/or LOCK support)
|
| |
|
|
|
|
| |
limit memory use under extreme conditions (edge cases)
|
|
|
|
|
|
|
| |
log XML response from chunkqueue instead of taking single buffer
(webdav.log-xml = "enable")
(prep for future changes)
|