libblkid: fix blkid_parse_tag_string() to ignore incomplete tags

fstab entry:

    FOO=     /       btrfs  defaults       1 1

Program received signal SIGABRT, Aborted.
0x00007f016ccd8819 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56   return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:196

Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
su: consistent angular brackets and lowercase in help text of 'su'

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
lib/colors: add support for auto, always and never modes

 ... to implement --color[=<when>]

Signed-off-by: Karel Zak <kzak@redhat.com>
dmesg: support --color[={auto,always,never}]

Signed-off-by: Karel Zak <kzak@redhat.com>
dmesg: fix usage() typo

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
docs: note ddate removal

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
prlimit: delete rem_prlim prototype

We can just move the function up before any of its callers.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
lib/colors: add colormode_or_err()

... to make the code easy to use in utils.

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: use -Wno-clobbered for some BSD crap

 * extend UL_WARN_ADD() for accept non-default CFLAGS variable
 * add BSD_WARN_CFLAGS with -Wno-clobbered
 * use all this for pg(1) and more(1)

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: use MS_SILENT for /{proc,etc}/filesystems

mount(8) needs to be doing silent mounts when doing this brute
forcing or when the filesystem is not explicitly specified.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: do not use va_list in the Ask API

  # fdisk /dev/sda
  Welcome to fdisk (util-linux 2.23).

  [...]

  Command (m for help): a
  Segmentation fault (core dumped)

It's too fragile, the va_list implementation is architecture specific
and it seems we need such thing in libfdisk at all.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: don't re-allocate range string in Ask API

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev: fix loopcxt_check_size() to work with blkdevs

The loopcxt_check_size() is workaround for kernels < v3.9, kernel has
been fixed by commit 541c742a7559eb65f0e36d3e2338c2ca532a3e61.

The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.

Addresses: https://bugs.archlinux.org/task/35193
Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
losetup: use warn_size() for regular files only

Signed-off-by: Karel Zak <kzak@redhat.com>
losetup: add --raw and --noheadings

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: add losetup tests

Signed-off-by: Karel Zak <kzak@redhat.com>
lsblk: add SERIAL column

 ... to return short serial number of the disk (from udev db)

Addresses: https://github.com/karelzak/util-linux/issues/33
Signed-off-by: Karel Zak <kzak@redhat.com>
standard SEE ALSO section of man pages

The standard format is to seperate each entry with a comma, and
for each one to be on a line by itself.  Most util-linux pages
follow this, but a few do not.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
lib/tty: don't hardcode terminal fd in get_terminal_name()

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: don't ignore root fs on umount -a

The release v2.22 (the new umount) introduces a regression when root
fs is excluded from umount --all. There is not reason for this
exception. The libmount should be smart enough to disable mtab update
after rootfs umount.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>