Medium: VirtualDomain: if the configuration file is missing on stop exit with success
Merge branch 'master' of github.com:ClusterLabs/resource-agents
Low: pgsql: change pgsql-status into UNKNOWN when validation is failed on stop

Change pgsql-status into UNKNOWN when validation is failed on stop.
Because pgsql-status remains in HS even though validation failure
means stop succeeded in pgsql RA.
Medium: Squid: fix getting PIDs of squid processes (lf#2653)

Squid uses netstat -apn to figure out the list of processes
serving clients, but didn't take into account the connections in
the TIME_WAIT state which have no process. This could result in
failed stop (probably other false positives too).

Thanks to bugsquid@fantasymail.de for finding the problem and
suggesting a fix.
Low: Squid: use the advertised stop escalation timeout of 10 seconds (lf#2653)
Medium: portblock: use end-of-word instead of space at the end of the line

On newer distros (eg. Ubuntu 12.04) with iptables 1.4.12 there's no
space at the end of the output anymore, so use "end-of-word" - that
works with "end-of-string" and a space.
Merge branch 'master' of github.com:ClusterLabs/resource-agents
Medium: named: use pgrep instead of searching in ps(1) output (thanks to Timur Bakeyev)
Medium: named: fix monitor if named_rootdir is set to /
Low: tools/findif: fix comment typos

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Low: tools/findif: make ConvertQuadToInt use netmask_bits fnc

This is not only to simplify ConvertQuadToInt and practice DRY
principle, but also to make it a little bit safer.  Because
of vague data types involved (instead of uint32_t at al.),
this at least adds one assurance and that is that the logic
will not get broken on architecture with 16bit int
(provided that long has still 32bit, which is not guaranteed
either).

Newly, failure of inet_pton (especially, malformed IP address
format) is indicated via -1 return value.  Previously, such
case was not handled safely.

The patch also unifies tab usage (ConvertQuadToInt was the only
function using spaces for indentation).

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Low: tools/findif: split ValidateNetmaskBits (conv.+valid.)

This commits moves conversion logic from ValidateNetmaskBits into
a separate function (ConvertNetmaskBitsToInt).  This way, we can
validate resulting number of netmask's bits, no matter if the original
string specified netmask as IP expression (via ConvertQuadToInt) or
directly as number of its bits (via ConvertNetmaskBitsToInt).

In turn, we are reaching the original goal to remove ill-advised
reuse of the storage with a string obtained by getenv call
(see netmaskbits, its initialization and rewrite using snprintf).

Strictly viewed, pointer to string returned by getenv should rather
not be stored at all (see [1]), but at least, this patch makes
the program conform to "[t]he application shall ensure that it does
not modify the string pointed to by the getenv() function" part
of getent POSIX documentation (per [1], C standard ditto).

[1] https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=1703960

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Medium: IPaddr2: use better test for infiniband (bnc#783353)
Low: tools/findif: remove superfluous string termination

The string is already terminated at that position
(see "man fgets strlen").

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Low: tools/findif: sanitize SearchUsingRouteCmd a bit

Not knowing how the input SearchUsingRouteCmd generates and subsequently
processing [*], only the most conservative changes are contained in this
patch.

First, there was a futile assigment that would only be valid if
commented out strsep calls were in effect.  Due to this, the assigment
was also only commented out.

Next, return value used to be taken from the first strtok in sequence,
only to be overwritten by another one.

Finally, if strtok unexpectedly returned NULL (due to input format other
than expected), it was not handled gracefully.

[*] "route -n get <addr>" is not supported in RHEL neither in Fedora

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Med: heartbeat/IPv6addr.c: missing check for socket call

Suggested-by: Pavel Raiskup <praiskup@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Med: heartbeat/IPv6addr.c: bad check for socket call

Suggested-by: Pavel Raiskup <praiskup@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Low: tools/sfex_init.c: fix unchecked return value

Suggested-by: Pavel Raiskup <praiskup@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Low: tools/send_arp.linux.c: clarify fall-through in switch

Reported-by: Pavel Raiskup <praiskup@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Medium: Raid1: discover block size for dd (bnc#781137)