libmount: allow unspecified source on remount

kernel does not require mount source (e.g. device name) on remount, it
means that fstab/mtab/mountinfo should be optional in this case.
For example:

 mount -o rw,remount /

has to work on system without mounted /proc.

Signed-off-by: Karel Zak <kzak@redhat.com>
login: Fix unused variables in login.c if _HAVE_UT_TV isn't defined

Wrap around the variable declaration for `tv' with ifdef so the compilers
don't warn about unused variables if we're compiling without UT_TV. This
happens with the musl libc, since it doesn't define _HAVE_UT_TV, even
though it _does_ have the ut_tv field in the utmp struct.

Signed-off-by: Will Johansson <will.johansson@gmail.com>
docs: fix the grammar of the recent comment about comments

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
textual: do not start option descriptions with a capital

This normalizes the help text of getopt, clarifies one description,
and also adjust two comments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: improve the sorting of the options in the man page of getopt

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: don't use bold or italics for "[option]" in synopsis of man pages

As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: adjust the grammar, text, sorting and formatting of logger man page

The message argument is not an option and should not be listed among
those.  Describe the optional argument of --rfc5424 better.  Use the
= and no space for optional option arguments.  Don't italicize words
unnecessarily.  Use bold for literal things.  And sort the options
alphabetically (apart from -V and -h).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: adjust some formatting and wordings in a handful of man pages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: fix the grammar and formatting in the man page of sfdisk

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
sfdisk: in the usage text show -v for --version instead of -V

In sfdisk -V is taken by --verify.  Use for the description of --version
the same indentation as for --help, not that of the other options.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
lslogins: allow changing password changed and expiration time formats

The password change and expiry has are marked with resolution of a day,
so add a new short iso-8601 format.  With this system admins can easily
find users has not updated their password lately

$ lslogins --time-format=iso --user --output=pwd-change,user | sort -n

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lslogins: make journald last logs time stamps to honor --time-format

This makes by default the last logs to have year in output when necessary.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lslogins: tell why command failed

Printing usage() without hint what is wrong does not help an user.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lslogins: fix short options

Usage is promising -e is an option alias of --export, so make it work.
And get rid of -x that was accepted, but not in use.

Long only enum member OPT_VER was probably a development time idea, that
never got to be used.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lslogins: reject unknown time format arguments

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lslogins: add space to systemd journal header and message

This commit changes journal messages in individual user printout the
following way.

Dec 13 16:02:05 systemd[324]:Time has been changed	(old)
Dec 13 16:02:05 systemd[324]: Time has been changed	(new)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lslogins: use hardcoded paths from pathnames.h

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
chfn: remove function prototypes

Requires resuffling functions order they work without issues.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
chfn: rewrite prompt() to use strutils

The left and right white space trimming can be done with strutils.h
[lr]trim_whitespace() functions.

As a minor fix when user input exceeds maxium allowed gecos field length
the remaining characters in stdin are purged so that re-prompting works
correctly.

Additionally the prompt() is made to add message to check_gecos_string(),
so that there are less similar strings for translation project to deal.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
chfn: use xasprintf() rather than bunch of strlen() and malloc() calls

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