Fix display of downtime in notifications.cgi

Fix service downtime notifications being displayed as UNKNOWN and host
downtime notifications being displayed as DOWNTIME but inheriting the
background color of the preceding notification.

This also allows the user to filter for just DOWNTIME notifications and
includes updated CSS for both the Exfoliation theme and the Classic UI.
minor doc for and source comments for worker protocol delimiter
Check events: Set correct next_check, only update status if needed.

When removing the execution time estimates I removed the switch that
set temp_host and temp_service in the rescheduling loop. As a result,
when setting the new next_check times, the last temp_host or
temp_service from the event selection loop would have its status
repeatedly updated with incorrect next_check times until finally being
updated with the correct time, or a segfault would occur if there were
either no host checks or no service checks in the rescheduling window.

These changes fix this, and also only update host/service status if the
next_check time (with second resolution) changed.
Merge branch 'worker-doc-fix' of github.com:philmayers/nagioscore into philmayers-worker-doc-fix
Merge branch 'philmayers-worker-doc-fix'
Merge branch 'fix_downtime_notifications_cgi' of github.com:awiddersheim/nagioscore into awiddersheim-fix_downtime_notifications_cgi
lib: Re-enable -Wall by default for lib.

This was disabled for lib to work with compilers that don't support it,
but not for Core and CGIs. Let's keep it on by default.

Silence the last -Wall warning in lib while we're at it.
runcmd: Additional test cases and minor cleanup.
Prevent several buffer overflows.

cgi/cmd.c:cmd_submitf() was not checking that the formatted command
string would fit in MAX_EXTERNAL_COMMAND_LENGTH bytes. It is now
considered an error if the full command can not be formatted into a
buffer of this size.

lib/nsock.c:nsock_vprintf() failed to check for vsnprintf() overflow.
Since this is used as library code in several places (with unrigorous
checks for error), an attempt is made to complete the operation using
vasprintf(). Although slower, the penalty is mostly paid in cases that
would have likely segfaulted in the past. The implementation of this
also depends on having va_copy() available and working.

lib/worker.c:wlog() and job_error() had similar vsnprintf() issues. In
these cases the truncated messages are null-terminated and sent, with
the reasoning that the buffers used are relatively large (8K and 4K,
respectively) and a truncated log message is better than none at all.

Discovered-by: Aman Gupta
Reported-by: Dirkjan Bussink
Merge branch 'emislivec-maint'
Merge branch 'awiddersheim-fix_downtime_notifications_cgi'
Changelog and THANKS for latest changes.
Prep for 4.0.8 release candidate 1.
runcmd: Recognize '<' and '>' as redirection operators.

This lets us correctly flag commands with redirection as needing to be
run in a subshell. Otherwise simple commands that only required a
subshell due to redirection were being exec()'ed directly, which is not
the intended behavior.
Add missing * in Changelog
Merge pull request #12 from awiddersheim/patch-1

Add missing * in Changelog
Changelog updates for JSON fixes
Changelog for runcmd fixes.
Prep for 4.0.8 release.
JSON CIG: Now escaping object and array keys

Previously scalar values were being escaped properly, but not array
and object keys. This commit fixes that.