request: Remove unused session_request member virtual_user.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
auth: Fix bug where failed base64_decode() cause segfault.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
auth: Fix buffer overflow when loading user file.

The third parameter of strncpy(3) was badly calculated.
For each entry in the users file the parameter was the length from start
of file until end of username, when it should be calculated from current
buffer position.
This causes writes outside buffer when the user file is larger than 2 *
sizeof(struct user).

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
auth: Ignore too large user entries.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
mandril: fix rule names

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
HTTP: ranges fixes and implement 416 status code (fix #184)

The ranges parser did not validate properly the maximum offset
allowed, so if a requester set limit offset equal to file size it
continue processing, internally the sendfile(2) did not failed
returning always zero, this condition was not handled and for hence
that connections keeps running without ending, it could lead to a
DoS.

This patch improves the range headers validation, fix the validation
of mk_http_send_file() routine and when the range is not satisfied, it
will return the status code 416:

      HTTP/1.1 416 Requested Range Not Satisfiable

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
QA: add HTTP range tests 04 and 05

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Logger: open the logs with the close-on-exec flag
utils: Open the PID file with close-on-exec
epoll: Set close-on-exec on the epoll FDs.

Note that there is no race here, as connections are not accepted until everything is up.
liana: Set close-on-exec on new sockets
Logger: set the log pipes to close-on-exec

Likewise no race here, as connections aren't accepted yet.
Fix a few fcntl mismatches
fastcgi: Fix of request error log and signed compare warning.

Report request errors using PLUGIN_TRACE() instead of mk_info().
Fix signed compare in fcgi_config.c.
Use PLUGIN_TRACE() for "No chunks to free".

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
auth: Fix missing PLUGIN_TRACE argument.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
auth: Fix bug 188, add extra space for '\0' termination.

The buffer was too small to fit a terminator when there were no padding
on the base64 encoded string.
This patch makes base64_decode() terminate the decoded string by
default.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
HTTP/Post: do not force content-type (RFC2616 - 7.2.1)

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Merge branch 'master' of ssh://git.monkey-project.com/srv/git/monkey