Commit Graph

50 Commits

Author SHA1 Message Date
Stefan Bühler 52d72fe8fc [scons] fix crypt() detection, other improvements
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3032 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-08-29 12:23:45 +00:00
Stefan Bühler c92496720d [mod_auth] use crypt_r instead of crypt if available
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2986 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-12 06:39:39 +00:00
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
2015-02-08 19:10:44 +00:00
Stefan Bühler 4365bdbebe Remove buffer_prepare_copy() and buffer_prepare_append()
* removed almost all usages of buffer as "memory" (without terminating
  zero)
* refactored cgi variable name encoding

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2977 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 19:10:39 +00:00
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
2015-02-08 12:37:10 +00:00
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
2013-11-13 11:43:26 +00:00
Stefan Bühler 2bcf65c285 [mod_auth] some cleanup, only search for matching auth.require path once
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2893 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-08-30 13:14:54 +00:00
Stefan Bühler c008fd7ec8 [mod_auth] fix invalid read in digest qop=auth-int handling (fixes #2478)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2877 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-06-29 09:45:27 +00:00
Stefan Bühler ce4bc0c0f7 [mod_auth] fix base64_decode (#2484)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2871 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-05-15 10:31:04 +00:00
Stefan Bühler c26b50d9ad [mod_auth] add htpasswd -s (SHA1) support if openssl is used (needs openssl for SHA1). This doesn't use any salt, md5 with salt is probably better.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2870 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-04-29 13:08:25 +00:00
Stefan Bühler 0342dfef1d [mod_auth] use crypt() on encrypted password instead of extracting salt first (fixes #2483)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2869 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-04-29 13:08:23 +00:00
Stefan Bühler bbaef6ab87 fix typo in debug output
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2835 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-05-18 12:56:28 +00:00
Stefan Bühler 61047369c7 [mod_auth] Fix digest "md5-sess" implementation (Errata ID 1649, RFC 2617) (fixes #2410)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2832 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-04-19 13:02:09 +00:00
Stefan Bühler 6c9dff7cda [mod_auth] Fix signedness error in http_auth (fixes #2370, CVE-2011-4362)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2806 152afb58-edef-0310-8abb-c4023f1b3aa9
2011-11-29 22:27:11 +00:00
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
2011-07-30 09:16:03 +00:00
Stefan Bühler 328043caf3 [ssl/md5] prefix our own md5 implementation with li_ so it doesn't conflict with the openssl one (fixes #2269)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2788 152afb58-edef-0310-8abb-c4023f1b3aa9
2011-04-24 16:02:52 +00:00
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
2010-08-06 21:57:15 +00:00
Elan Ruusamäe a813273c2f - Include IP addresses on error log on password failures (fixes #2191)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2727 152afb58-edef-0310-8abb-c4023f1b3aa9
2010-05-28 15:54:27 +00:00
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
2009-10-11 14:31:42 +00:00
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
2009-07-21 20:35:27 +00:00
Stefan Bühler 5204fd7e6c Adding support for additional chars in LDAP usernames (fixes #1941)
Allowing LDAP entries to use the chracters ' ', '@', '-', '_',
and '.' in the user name attribute.  These characters do not
modify the behavior of the LDAP filter and are common in LDAP
user names.

Signed-off-by: David M. Syzdek <david@syzdek.net>


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2526 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-06-11 10:09:14 +00:00
Stefan Bühler 7ad4792357 Add support for "real" entropy from /dev/[u]random (fixes #1977)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2524 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-06-11 09:53:34 +00:00
Stefan Bühler 7f103eab6c Fix error message if no auth backend was set
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2486 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-04-27 09:28:48 +00:00
Stefan Bühler cfba07cb82 Now really fix mod auth ldap (#1066)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2318 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-09-30 15:30:06 +00:00
Stefan Bühler 8cfa29a7a2 Fix base64 decoding in mod_auth (#1757, thx guido)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2315 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-09-30 13:48:45 +00:00
Stefan Bühler 6d1d3fc203 workaround ldap connection leak if a ldap connection failed (restarting ldap)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2303 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-09-17 14:25:42 +00:00
Stefan Bühler 88750bb7be r2096@chromobil: stefan | 2008-02-26 17:12:09 +0100
Enhancement #1544: Log the ip of failed auth tries in error.log


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2091 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-26 16:21:44 +00:00
Jan Kneschke 5c333340be free the buffers after the printed them in the error-msg
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1989 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-09-06 21:36:38 +00:00
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
2007-08-18 12:25:52 +00:00
Jan Kneschke 15e260c28b * fixed mem-leak in mod_auth (reported by Stefan Esser)
* fixed crash with md5-sess and cnonce not set in mod_auth (reported
  by Stefan Esser)
* fixed missing check for base64 encoded string in mod_auth and Basic
  auth (reported by Stefan Esser)
* fixed possible crash in Auth-Digest header parser on trailing WS in
  mod_auth (reported by Stefan Esser)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1875 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-06-15 16:22:30 +00:00
Jan Kneschke c3476ada45 fixed small mem-leak if auth failed
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1721 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-04-09 16:58:13 +00:00
Marcus Rückert d471bcc9ca r1553@h2o: darix | 2007-01-14 10:37:14 +0100
- allow empty passwords with ldap.
   patch by Jöerg Sonnenberger


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1516 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-01-14 09:40:02 +00:00
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
2006-10-04 13:26:23 +00:00
Jan Kneschke 3a152b3b76 added $apr1$ support for htpasswd (fixes #870)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1369 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-10-04 07:46:12 +00:00
Marcus Rückert 27e3de6ca4 Remove unmaintained and not working pam code.
Most people would use pam auth with /etc/{passwd,shadow}.
This is a stupid idea anyway.

* src/server.c: Remove pam from the feature list (-V)
* src/http_auth.h, src/http_auth.c: Remove the pam code.

(merge of r1115:1116 from branches/lighttpd-merge-1.4.x/)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1288 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-09-07 14:21:17 +00:00
Jan Kneschke 4a81e17c6c qop is required nc and nonce (fixes #477)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@971 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-02-01 11:32:33 +00:00
Jan Kneschke 780bc91ffe improved the error-msgs
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@882 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-11-26 12:47:09 +00:00
Jan Kneschke ad7d85b7f5 fixed possible overflow in password-salt handling
(reported on slashdot by james-web@and.org)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@871 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-11-21 15:04:28 +00:00
Jan Kneschke 62d8d1ef53 fixed md5 on 64bit platforms
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@856 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-11-17 14:39:07 +00:00
Jan Kneschke ea7b9aba9b added auto-reconnect to ldap (fixes #294), patch from joerg@netbsd.org
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@818 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-11-07 09:50:34 +00:00
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
2005-09-24 12:06:04 +00:00
Jan Kneschke be5f187d0f added support for md5 and blowfish passwords (fixes #73)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@710 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-16 10:40:45 +00:00
Jan Kneschke 35d3c10d81 on SEGFAULT tell were we where
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@603 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-21 23:09:43 +00:00
Jan Kneschke 9238cad69e added support for LDAP-bind()
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@531 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-15 09:42:17 +00:00
Jan Kneschke 5c26d86fd2 missing parts of the starttls patch
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@511 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 10:26:26 +00:00
Jan Kneschke 9a62fdb85d added valid-user support, fixed #4
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@491 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-07-31 11:49:26 +00:00
Jan Kneschke c8652e52b0 fixed #148 and let PAM use the lighttpd-handle (if someone implements it)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@372 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-06-05 20:54:55 +00:00
Jan Kneschke 232e6158a9 Fixed segv if debuggin is enabled
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@371 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-06-05 20:47:37 +00:00
Jan Kneschke dfe03995d7 Fix crash if qop is not set in the authorize response
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@360 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-05-31 08:22:37 +00:00
Jan Kneschke bcdc6a3bbc moved everything below trunk/ and added branches/ and tags/
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@30 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-02-20 14:27:00 +00:00