Fix various typos
nologin: add new command

Currently it's maintained as distro specific (or people use impolite
/bin/false way).

Signed-off-by: Karel Zak <kzak@redhat.com>
findmnt: always allocate memory for cell value

Since b3386c83fe77, findmnt's output uses TT_FL_FREEDATA, which causes
a crash here when string literal is returned instead of a heap address.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
setterm: fix term.h/ncurses.h include ordering

The ncurses term.h header has logic in it to detect if nucrses.h has
already been included and void defining things when it has.  But since
setterm includes term.h and the ncurses.h, it doesn't work and we can
get fun build-time warnings like:

  CC       term-utils/setterm-setterm.o
In file included from term-utils/setterm.c:109:0:
/usr/include/ncursesw/ncurses.h:827:12: warning: redundant redeclaration of 'tigetflag' [-Wredundant-decls]
 extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);  /* implemented */
            ^
In file included from term-utils/setterm.c:106:0:
/usr/include/ncursesw/term.h:775:12: note: previous declaration of 'tigetflag' was here
 extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);
            ^

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
clean up term lib handling

The ncurses package has been providing pkg-config files for a while now.
So let's start using them to get the proper linker & compiler flags.  It
can make a difference when ncurses is configured in a way that requires
extra link time flags but util-linux doesn't provide them, or when the
headers live in a weird place and util-linux can't find them.

Since the NCURSES_LIBS is always defined for the Makefile, there's no need
to gate on the HAVE_NCURSES conditional.  When it's disabled, the var will
simply be empty.

With a minor tweak to how tinfo is handled, we can do the same thing -- we
just always use TINFO_LIBS in the Makefile's.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
build-sys: simplify python detection

This allows './configure --enable-most-builds' and 'make distcheck' to
work when both python2 and python3 are installed, and user has set python
version preference using symlink and PATH order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libmount: Save errno if mkostemp() failed

After mkostemp() failed, umask() and free() might alter the errno
to another value.  Not sure those calls really changes the errno
or not.  But let's be more conservative.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
textual: fix misspelled words in -rc1

Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
bash-completion: use '\n' as IFS when ask for filenames

The bash completion for more(1) treats the space-separated pieces of
filenames as different files.

	$ touch foo\ bar
	$ more foo<TAB>
	bar foo

Reported-by: Ángel González <ingenit@zoho.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Merge branch 'master' of https://github.com/yurchor/util-linux
losetup: don't require 512-byte aligned offsets

Kernel aligns the device size, but the offset where the device starts
is not required to be aligned.

 # losetup --offset 32 -f file.img

is just fine, the final size of the look device will be (in sectors)

  (backing_file_size - offset) >> 9

so we have to do the same in userspace when we check for successful
set capacity ioctl.

Signed-off-by: Karel Zak <kzak@redhat.com>
fsck: don't print warning if there is no /etc/fstab at all

Reported-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: make mnt_table_replace_file() more robust [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
last: check fstat() return [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
utmpdump: make analyzers happy

Signed-off-by: Karel Zak <kzak@redhat.com>
pylibmount: make tab parsers more robust [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
pylibmount: check for mnt_fs_get_tag() return value [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: use proper type in xfs log checker [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: remove dead code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu: don't pass null pointer to string functions [coverity scan]

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