Don't invoke bundle if methods promise is warn-only.

However, do invoke the bundle if the agent run is a dry-run.

See Redmine #5924
replaced tabs by spaces
added a note that the ps command on linux has been change to adopt for big rss values.

Modified by Kristian Amlie <kristian.amlie@cfengine.com>
Merge pull request #1860 from vohi/redmine/5924

Don't invoke bundle if methods promise is warn-only.
Call service methods even in dry-run mode.

Otherwise the promises inside the method are not evaluated at all,
and no insight is provided into whether cf-agent would have modified
the system.

Since the promises then respect DRYRUN mode, nothing will changed
on the system.

If action_policy is set to warn_only, the methods promise will
respect that and not evaluate the bundle.

This follows up on commit 65c15626992d608eaa51ca3d47b6ccf4e8058576.

See Redmine #5924
Merge pull request #1870 from vohi/redmine/5924-2

Call service methods even in dry-run mode.
Update ChangeLog with fix for #5924
GLOBALS: how to suppress mutability in CFEngine internals.
RedMine 6397 mitigation: use alternate column instead of empty.

In SplitProcLine(), we parse the line two ways; if the two don't
agree, we winge about it; but we use the first one anyway.  We see
some cases where Solaris ps gets a better answer from the second than
from the first; so use the second by default and fall back to the
first if it's empty.
Redmine #6421: Fix incorrect newline mode when reading in execresult.

The output is expected to be text, so it should be read in text mode,
converting "\r\n" to "\n" in the resulting variable.
Merge pull request #1872 from kacfengine/execresult_newline_mode

Redmine #6421: Fix incorrect newline mode when reading in execresult.
Changelog entry for LMDB robustness patch.
Merge pull request #1873 from kacfengine/master

Changelog entry for LMDB robustness patch.
disable failing unit test redmine 6314
Merge pull request #1874 from MatthewCattell/disable-failing-aix-unit-tests

disable failing unit test redmine 6314
Fix memory leak in IsProcessNameRunning().

When it finds a matching row, it breaks out of the loop over rows;
otherwise, it free()s the fragments into which it parsed the line that
just failed.  The matching line's fragments need free()d just as much.
Assorted clean-up in processes_select.c

Casting the paramater of isspace to int is dumb; even without the
overt cast, that would happen.  As it happens, isspace wants to be
given an int whose value is either that of an unsigned char or EOF
(which is -1).  So, when passing a char to it (which is what we're
doing) we *do* need to cast it - to unsigned char - after all.
Likewise for isalnum().

Various loops were needlessly complicated by mishandling the 0 case,
leading to kludges to not end up with the wrong answer.  Use the right
test, avoid the dumb kludges.

Prefer memcpy (with explicit termination) over strncpy and kill the
wanton memset(,0,)s implicit in an initializer that assured the
strncpy() would have a trailing '\0'.

Kill a spurious continue (in an if, whose else was the rest of the
loop anyway).

Removed misleading " INFO - " from the front of a LOG_LEVEL_VERBOSE.
Chop() was being called with the wrong size for its buffer.
A loop variable could be made more local and const.
Turn some untidy while loops into for loops.
Split some lines to make them more readable.
Made diverse other locals more local.
Fewer parentheses.
Rework SplitProcLine(): smarter growing of fields outside columns.

GetProcessColumnNames() records the start and end columns of the
headings for ps-output.  SplitProcLine() uses these in its second
heuristic for parsing the columns from data lines.  (The first
heuristic simply splits on spaces, aside from a minor kludge for
STIME.  If the two heuristics disagree, we Log() a warning.)  It used
to grow the field outwards, to a space on each side, but limiting
growth to the right to (arbitrarily) ten characters.  This might
extend beyond the next column to either side.  We see Solaris ps can
have fields that abut, which would lead several fields to use the same
text, this way.

Having now studied actual ps output (details documented in a comment
at the start of the heuristic), I've changed this so that:
 * for numeric fields, it grows left, potentially into the previous
   column but never to its start;
 * for text columns it grows right but never overlaps the next column
   header.
Other columns are limited to the width of their header.

It also now strips all leading and trailing space (it used to neglect
this for the last column, even after I fixed assorted off-by-one
errors), which eliminates the need for Chop().

I've also eliminated the assumption that CMD/COMMAND is the last
column - it's easier, safer and correct to test for last column, for
all that this always just happens, for good reason, to be CMD.
Rewrite SplitProcLine() without temp buffers.

Rather than scanning the line twice, filling two arrays with fragments
obtained by two heuristics, so as to be able to compare them, do the
two scans in parallel.  This removes the needs for arrays to hold the
fragments, hence the need to clip a long field if we hit one (it'll be
COMMAND, if it happens), and saves a lot of copying.  We only need to
copy the contents (and clip them) when warning and as part of the
xstrndup(), replacing xstrdup() of a copy, needed to allocate the
fragment saved.
Merge pull request #1871 from ediosyncratic/process-fixes

RedMine 6397: rewrite SplitProcLine and clean up in its file