Commit Graph

46 Commits (c9b56735b87ddd6dd68f12e9476089f70502fc7b)

Author SHA1 Message Date
Glenn Strauss d7638b9b10 fix some warnings reported by static analysis tool
iterate over environ via array-index notation with char **ptr on stack
(instead of repeatedly re-accessing global 'environ')

check getsockname() return values including addrlen

[mod_dirlisting] pass buf size into http_list_directory_sizefmt()

github: resolves #48
7 years ago
Glenn Strauss c63427c999 [mod_dirlisting] class for dir <tr> (fixes #2304)
x-ref:
  "special class for directories tr's in directory listing"
  https://redmine.lighttpd.net/issues/2304
7 years ago
Glenn Strauss 47f3dbebe4 use li_[iu]tostrn() instead of li_[iu]tostr()
From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3136 152afb58-edef-0310-8abb-c4023f1b3aa9
7 years ago
Glenn Strauss d17d48e01e [stat] mimetype.xattr-name global config option (fixes #2631)
For backwards compatibility with existing lighttpd configs, default is
  mimetype.xattr-name = "Content-Type"

Those who wish to use the freedesktop.org definition of xattr mimetype
can set the following in the global lighttpd config:
  mimetype.xattr-name = "user.mime_type"

From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3131 152afb58-edef-0310-8abb-c4023f1b3aa9
7 years ago
Glenn Strauss 8abd06a7ff consistent inclusion of config.h at top of files (fixes #2073)
From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9
7 years ago
Stefan Bühler f3606dc539 [mod_dirlisting] dir-listing.hide-dotfiles = "enabled" by default (fixes #1081)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3094 152afb58-edef-0310-8abb-c4023f1b3aa9
7 years ago
Stefan Bühler c512345fa2 [config] check config option scope; warn if server option is given in conditional
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3049 152afb58-edef-0310-8abb-c4023f1b3aa9
8 years ago
Stefan Bühler 27ab3f76db [mod_dirlisting] remove sys/syslimits.h; base.h already includes limits.h
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3024 152afb58-edef-0310-8abb-c4023f1b3aa9
8 years ago
Stefan Bühler 47cddfd4f3 [mod_dirlisting] fix dir-listing.set-footer not showing
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3008 152afb58-edef-0310-8abb-c4023f1b3aa9
8 years ago
Stefan Bühler ad3e93ea96 Use buffer API to read and modify "used" member
- a lot of code tried to handle manually adding terminating zeroes and
  keeping track of the correct "used" count.
  Replaced all "external" usages with simple wrapper functions:
  * buffer_string_is_empty (used <= 1), buffer_is_empty (used == 0);
    prefer buffer_string_is_empty
  * buffer_string_set_length
  * buffer_string_length
  * CONST_BUF_LEN() macro
- removed "static" buffer hacks (buffers pointing to constant/stack
  memory instead of malloc()ed data)
- buffer_append_strftime(): refactor buffer+strftime uses
- li_tohex(): no need for a buffer for binary-to-hex conversion:
  the output data length is easy to predict
- remove "-Winline" from extra warnings: the "inline" keyword just
  supresses the warning about unused but defined (static) functions;
  don't care whether it actually gets inlined or not.

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2979 152afb58-edef-0310-8abb-c4023f1b3aa9
8 years ago
Stefan Bühler 1be163b44a Remove chunkqueue_get_{append,prepend}* API
Although those were "easy" to use, they violated the abstraction:
  content of the chunkqueue should only be modified via the API.
  Replace with chunkqueue_get_memory() and chunkqueue_use_memory() for
  functions that read data from network (reusing large buffers),
  chunkqueue_steal_with_tempfiles() to store request bodies on disk
  temporarily.
  Modules that were generating content and need a buffer maintain the
  buffer manually (have to be careful to free the buffer on errors, as
  it isn't part of the chunkqueue yet).

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2976 152afb58-edef-0310-8abb-c4023f1b3aa9
8 years ago
Stefan Bühler 6afad87d2e fix buffer, chunk and http_chunk API
* remove unused structs and functions
    (buffer_array, read_buffer)
  * change return type from int to void for many functions,
    as the return value (indicating error/success) was never checked,
    and the function would only fail on programming errors and not on
    invalid input; changed functions to use force_assert instead of
    returning an error.
  * all "len" parameters now are the real size of the memory to be read.
    the length of strings is given always without the terminating 0.
  * the "buffer" struct still counts the terminating 0 in ->used,
    provide buffer_string_length() to get the length of a string in a
    buffer.
    unset config "strings" have used == 0, which is used in some places
    to distinguish unset values from "" (empty string) values.
  * most buffer usages should now use it as string container.
  * optimise some buffer copying by "moving" data to other buffers
  * use (u)intmax_t for generic int-to-string functions
  * remove unused enum values: UNUSED_CHUNK, ENCODING_UNSET
  * converted BUFFER_APPEND_SLASH to inline function (no macro feature
    needed)
  * refactor: create chunkqueue_steal: moving (partial) chunks into another
    queue
  * http_chunk: added separate function to terminate chunked body instead of
    magic handling in http_chunk_append_mem().
    http_chunk_append_* now handle empty chunks, and never terminate the
    chunked body.

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2975 152afb58-edef-0310-8abb-c4023f1b3aa9
8 years ago
Stefan Bühler 4a6838103d [mod_dirlisting,mod_redirect,mod_rewrite] abort config parsing if pcre-compile fails or isn't available
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2968 152afb58-edef-0310-8abb-c4023f1b3aa9
9 years ago
Moritz Wilhelmy 4d55d4ada3 add support for (Free)BSD extended attributes
enable with `./configure --with-attr` and `mimetype.use-xattr =
"enable"` in the config.

set attribute with:

    setextattr user Content-Type text/plain path/to/www/file

From: Moritz Wilhelmy <mw@barfooze.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2966 152afb58-edef-0310-8abb-c4023f1b3aa9
9 years ago
Stefan Bühler 07dd0bd0a5 add force_assert() to enforce assertions as simple assert()s are disabled by -DNDEBUG (fixes #2546)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2948 152afb58-edef-0310-8abb-c4023f1b3aa9
9 years ago
Stefan Bühler d59c910d6a [mod_dirlisting] fix memory leak if pcre fails
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2941 152afb58-edef-0310-8abb-c4023f1b3aa9
9 years ago
Stefan Bühler 6f208cfde1 fix/silence bugs reported by ccc-analyzer (clang)
These should all be non critical:
 * memory leaks on startup in error cases (which lead to
   immediate shutdowns anyway)
 * http_auth/ldap: passing uninitialized "ret" to ldap_err2string
 * sizeof(T) not matching the target pointer in malloc/calloc calls;
   those cases were either:
   * T being the wrong pointer type - shouldn't matter as long as all
     pointers have same size
   * T being larger than the type needed
 * mod_accesslog: direct use after free in cleanup (server shutdown);
   could crash before "clean" shutdown
 * some false positives (mod_compress, mod_expire)
 * assert(srv->config_context->used > 0); - this is always the case,
   as there is always a global config block

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2920 152afb58-edef-0310-8abb-c4023f1b3aa9
10 years ago
Stefan Bühler 90dd8af32b Always use our 'own' md5 implementation, fixes linking issues on MacOS (fixes #2331)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2799 152afb58-edef-0310-8abb-c4023f1b3aa9
12 years ago
Stefan Bühler 38f2d1ddd7 cleanup fdevent code, removed linux-rtsig handler, replaced some fprintf calls
* use log functions
 * convert flags
 * fix handler callback prototype

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2752 152afb58-edef-0310-8abb-c4023f1b3aa9
13 years ago
Stefan Bühler 22e8b456a9 Fix header inclusion order, always include "config.h" before any system header
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2624 152afb58-edef-0310-8abb-c4023f1b3aa9
14 years ago
Stefan Bühler 4df22f2a32 Fix issues found with clang analyzer
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2594 152afb58-edef-0310-8abb-c4023f1b3aa9
14 years ago
Stefan Bühler 63a010f686 Add some dirlisting enhancements (fixes #1458)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2478 152afb58-edef-0310-8abb-c4023f1b3aa9
14 years ago
Stefan Bühler 638ee6cad9 Add revision number to package version for svn/git checkouts
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2467 152afb58-edef-0310-8abb-c4023f1b3aa9
14 years ago
Stefan Bühler 63f785a2f8 Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2414 152afb58-edef-0310-8abb-c4023f1b3aa9
14 years ago
Stefan Bühler ad12e4c5b2 Insert many con->mode checks; they should prevent two modules to handle the same request if they shouldn't (#631)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2271 152afb58-edef-0310-8abb-c4023f1b3aa9
15 years ago
Stefan Bühler 0c16fddde3 Handle only HEAD, GET and POST in mod_dirlisting (same as in staticfile) (#1687)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2253 152afb58-edef-0310-8abb-c4023f1b3aa9
15 years ago
Stefan Bühler 52861d77df Replace buffer_{append,copy}_string with the _len variant where possible (#1732, thx crypt)
Replace BUFFER_{APPEND,COPY}_STRING_CONST with _len(b, CONST_STRL_LEN(x))


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2250 152afb58-edef-0310-8abb-c4023f1b3aa9
15 years ago
Stefan Bühler 4bf89c62b6 Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2152 152afb58-edef-0310-8abb-c4023f1b3aa9
15 years ago
Jan Kneschke 51826fc05c renamed ltostr() to LI_ltostr() to fix compile on HP/UX (fixes #465)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1951 152afb58-edef-0310-8abb-c4023f1b3aa9
16 years ago
Jan Kneschke bbd42c4e03 added dir-listing.set-footer = <string> to set a footer under the
dirlisting (fixes #1277)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1911 152afb58-edef-0310-8abb-c4023f1b3aa9
16 years ago
Marcus Rückert dac6d449dd - backported fix from trunk
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1900 152afb58-edef-0310-8abb-c4023f1b3aa9
16 years ago
Jan Kneschke fff10e1d1a reduced default PATH_MAX to 255 (fixes #826)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1733 152afb58-edef-0310-8abb-c4023f1b3aa9
16 years ago
Jan Kneschke 8fca20187e fixed conditional dir-listing.exclude (fixes #930)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1732 152afb58-edef-0310-8abb-c4023f1b3aa9
16 years ago
Marcus Rückert 8cd1471cb3 - white space cleanup part 2 this time 1.4 ;)
i hope it helps with merging stuff back to 1.5

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1371 152afb58-edef-0310-8abb-c4023f1b3aa9
17 years ago
Jan Kneschke 874173ce56 added summary-tag to all tables in dirlisting and status
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1367 152afb58-edef-0310-8abb-c4023f1b3aa9
17 years ago
Jan Kneschke a1e6331f04 fixed encoding of UTF8 data (Jani Taskinen <sniper@iki.fi>)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@942 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke a39e5713d5 show HEADER.txt if it exists (fixes #246) (<mnag@FreeBSD.org>)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@891 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 33101e2057 include content-type in HTML too
- fixes #365 (patch from sniper@php.net)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@890 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 60ccbd89f7 fixed unsigned compares
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@855 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 976f32182e simplified buffer-encoding functions into one function
- all of them do some kind of string-to-hex conversion
  (html, rel-uri, hex)
- add a rel-uri encoding next to the old rel-uri-part one
- fixes #266


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@822 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke b4d9d061c8 either remove include config.h or covered it in HAVE_CONFIG_H
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@733 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 9a2e653557 if pcre is not avaible the UNUSED(regex) tries to tag a non-existent parameter
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@615 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 34e169d58d Patch for new option 'dir-listing.exclude' (closes #215)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@605 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 86ac3fb37f if pathconf fails (like on obsd and nfs) fall back to NAME_MAX or 256
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@600 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke 1a1fc2d54d forgot to add the legacy option as conditional
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@590 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago
Jan Kneschke d8394f7f2e moved code to mod_staticfile, mod_dirlisting and mod_indexfile
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@541 152afb58-edef-0310-8abb-c4023f1b3aa9
18 years ago