Fixed bug where selecting Command Expansion from Configuration CGI page would display commands instead

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2621 5f96b256-904b-4d8d-8c98-d829582c6739
Updated CGI utility functions to support UTF-8 characters

Specifically the escape_string() function in cgiutils.c was updated. 
In order to support this we needed to set the encoding which is set 
using setlocale(). 

Because setlocale() specifies both the language and the encoding, 
the function that reads the CGI variables now calls a function to 
parse the HTTP_ACCEPT_LANGUAGE variable and attempt to set the 
locale based on the user's preferred language and locality.

This wasn't really necessary because all we really needed was to 
set the encoding to UTF-8, but it may be useful in the future and 
is less ethnocentric than just blindly setting the locale to 
en_US.utf8. :-)



git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2622 5f96b256-904b-4d8d-8c98-d829582c6739
Clean up function declaration

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2625 5f96b256-904b-4d8d-8c98-d829582c6739
runcmd: Fix quoting issues when running commands

The important part of this patch is one line that makes sure that if
we're in single quoted mode, we should ignore '\' as an escape
character.

Without this, foo\\bar was interprented exactly the same as 'foo\\bar'.
With it, the former is executed as one backslash, the latter as two.

There's is also a new test-runcmd, with a small set of test cases for
the command quoter.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2627 5f96b256-904b-4d8d-8c98-d829582c6739
checks: Check command output does not show up pre-escaped

Why would you think it did?

Since we assumed that check output was escaped, we tried to unescape
it, and that becomes highly weird.

So, this bug meant that, unless a command is quoted (which, as shown in
the parent commit, you couldn't do), if you're trying to test quoting by
writing a check command that echoes your input, you needed four
backslashes in your input to get one in your output. Trying to read the
quad-escaped commands in the input, in turn, quickly makes a user want
to escape from this application.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2628 5f96b256-904b-4d8d-8c98-d829582c6739
base/nebmods: Log module loading errors to stdout

It's really, really tiresome to watch logs for module errors
when Nagios just keeps rolling on in case it can't load one or
more modules. This patch makes sure at least errors are printed
to stdout as well.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2629 5f96b256-904b-4d8d-8c98-d829582c6739