ipcs: cleanup jumplabel stlyes

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: quote generated arguments for ipcrm

In case that awk fails to parse out the right id the next
ipc command will give us a clear error message instead of
telling us to use correct syntax.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: add basic test case for ipcs -q -i n

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: add basic test case for ipcs -s -i n

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: add basic test case for ipcs -m -i n

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
ipcs: fix ipc_msg_get_info fallback case

"ipcs -q" (case id < 0) was broken since v2.22-256-g35118df if /sys
is not usable. The main issue was that the use of msqid argument did not
cleanly distinguished between "queue identifier" and "index of kernel's
internal array".

Also now the fallback case and the regular case behave more equally
regarding it's return value (introducing another counter j).

Note that the case id >= 0 now performs a slower lookup. This could be
avoided but then we would better handle both case differently like it
was before the above mentioned cleanup commit.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
ipcs: fix ipc_shm_get_info fallback case

"ipcs -m -i n" (case id >= 0) was broken since v2.22-251-g61e14b4 if /sys
is not usable.

See also comments for commit "ipcs: fix ipc_msg_get_info fallback case".

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
ipcs: fix ipc_sem_get_info fallback case

"ipcs -s -i n" (case id >= 0) was broken since v2.22-254-g1e2418a if /sys
is not usable.

See also comments for commit "ipcs: fix ipc_msg_get_info fallback case".

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
ipcs: fix memleak in ipc_*_get_info functions

In case of error (maxid < 0) we do not enter following for loop. It will
return 0 and free the structs afterwards because i is still 0.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
travis-ci: abort if make check fails

make check should work now on current travis build image.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: swaplabel needs to respect pagesize

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: fix utmpdump/to-text for bigendian

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: fix utmpdump/ipv6totxt for bigendian

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: fix utmpdump/to-binary for bigendian

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: fix utmpdump/ipv6tobin for bigendian

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: fix last for bigendian

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
flock: use nfs4 fallback on EBADF too

The kernel regression (probably v3.4, commit 55725513) introduces a
new errno for O_RDONLY on NFS. Now it returns EBADF rather than EIO.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1078618
Signed-off-by: Karel Zak <kzak@redhat.com>
mcookie: use lib/randutils

The mcookie should reuse existing code, and there is definitely no need
to prefer /dev/random for this utility.  See reference for explanation
about later statement.

References: http://www.2uo.de/myths-about-urandom/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mcookie: allow --file option be defined multiple times

Earlier only the last option argument took effect.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mcookie: use same variable type consistently

Signed-off-by: Sami Kerola <kerolasa@iki.fi>