wipefs: don't erase nested partition tables by default

It's possible the partition contains a partition table (BSD, or hybrid
boot images). It could be unexpected for users that the lost all (or
another) partitions when work with non-whole disk device. Let's
require --force.

For example:

 # wipefs --all /dev/sdb

erases all including partition table, but on hybrid disk where the
first partition starts at first sector (so partition table is within
the first partition):

 # wipefs --all /dev/sdb1
 /dev/sdb1: ignore nested "dos" partition table on non-whole disk device
 wipefs: Use the --force option to force erase.

asks for --force.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1077310
Signed-off-by: Karel Zak <kzak@redhat.com>
mount: note that -c unused for mount.<type> in man page

Addresses: https://github.com/karelzak/util-linux/issues/70
Signed-off-by: Karel Zak <kzak@redhat.com>
kill: make options --pid and --queue mutually exclusive

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: remove unnecessary indirection

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: add signal receiver program

Target to kill with a check that will be written later.

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: check kill is converting signals names correctly

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: check various ways to specify kill signal

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: check kill print pid option

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: check kill all user processes

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: add --verbose option to display what is killed

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/procutils: reset errno before strtol() call

When going through /proc the last entry made readdir() to alter errno,
which made the strtol() to think something went wrong, resulting kill(1)
tests to fail when running in --parallel mode.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/procutils: notice setuid() process ownership changes

Earlier the owner of a process was determined by owner of the
/proc/<pid>/stat file.  When changes user ID privileges with setuid() the
stat file ownership is not updated, that resulted kill(1) to consider
such processes where running using same uid as the present process.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Merge branch 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit

* 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit:
  lib/procutils: notice setuid() process ownership changes
  lib/procutils: reset errno before strtol() call
  kill: add --verbose option to display what is killed
  tests: check kill all user processes
  tests: check kill print pid option
  tests: check various ways to specify kill signal
  tests: check kill is converting signals names correctly
  tests: add signal receiver program
  kill: remove unnecessary indirection
  kill: make options --pid and --queue mutually exclusive
tests: add kill_functions.sh to avoid duplicate code

Signed-off-by: Karel Zak <kzak@redhat.com>
dmesg: move get_boot_time() to lib/timeutils

In future the last(1) will use get_boot_time() as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
last: fix is_phantom() detection

The /proc/<pid>/loginuid is not always available, and when so a running
session should not be determined to be gone.  This is a regression from
commit mentioned in reference.

Sessions that have started before previous system boot, and did not log
out meanwhile, will be marked as gone.  It is fair to say that these
sessions are most likely result of a wtmp corruption.

Reference: 404fa3f93c00c7e130f5a0ec963b2dc6a3743986
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/c.h: add macro to print definitions as string

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mkswap, swaplabel: move version number to header

Corrently only the swap version 1 is supported, which is a magic value so
move it to header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mkswap: remove legacy swap structure

If software archeolgists want to know how the old, and unused, swap
header looked they can dig it from the revision history.

Reference: 4c85aa3a4c26f2a2c33bf16960b548d5bbd5b4bf
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/swapheader.h: ensure type sizes

Use consistently the same type sizes as in libblkid and kernel.

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