Commit Graph

11001 Commits

Author SHA1 Message Date
Karel Zak 8048a826cc Merge branch 'build-fixes' of https://github.com/rudimeier/util-linux
* 'build-fixes' of https://github.com/rudimeier/util-linux:
  build-sys: don't clean *.img files
2016-12-09 15:37:09 +01:00
Karel Zak 0a14cc8bcc libmount: revert X-* and x-* meaning
Let's hope this is last change necessary to cleanup x-* usage:

  x-*  persistent option, stored in utab, available for umount, etc.
  X-*  fstab comment only

mount(8) supports x-mount.mkdir= as well as newly recommended X-mount.mkdir=

Advantages:

 * less invasive
 * does not require exception for x-systemd
 * does not require rename x-initrd to X-initrd

The systemd and dracut users will get the new (=fixed) functionality without a
change in fstab configuration. This is the primary goal.

Disadvantages:

 * not 100% compatible libmount behavior, x-* options have not been
   previously stored in utab. The API is the same, options will be still
   available, but on x-* libmount will write to /run/mount/utab. For now
   it seems only systemd uses x-*, and they like this behavior, so...

Addresses: https://github.com/systemd/systemd/pull/4515
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-09 15:36:14 +01:00
Ruediger Meier 38f75ebe1e build-sys: don't clean *.img files
Don't know why this was added in d78df0ac but it can't be right that
libmount/python removes these files in the toplevel builddir. Moreover
I've never seen such *.img files appearing during build at all.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-09 14:27:48 +01:00
Karel Zak 08595712f3 Merge branch doc_fixes
Rebase from
  http://git.kernel.org/pub/scm/linux/kernel/git/mtk/util-linux.git doc_fixes

  docs: renice(1): Add credentials(7) to SEE ALSO
  docs: renice(1): Add SEE ALSO entry for sched(7)
  docs: mount(8): Wording fix
  docs: ionice(1): SEE ALSO: add ioprio_set(2)
  docs: lsns(8): SEE ALSO: add namespaces(7)
  docs: last(1): Eliminate oddball formatting
  docs: last(1): SEE ALSO: add reference to wtmp(5)
  docs: taskset(1): Wording fix
  docs: namei(1): SEE ALSO: add symlink(7)
  docs: kill(1): Wording fix
  docs: various pages: Use 'UID" and "GID", not "uid" and "gid" in man pages
  docs: various pages: Use "PID" not "pid" in man-pages
  docs: various pages: Use "ID" not "id" in man pages
  docs: various pages: Use consistent terminology (set-user-ID and set-group-ID)
  docs: various pages: Format pathnames as italic (.I)
2016-12-09 13:48:34 +01:00
Michael Kerrisk c0cf01b5e8 docs: renice(1): Add credentials(7) to SEE ALSO
credentials(7) explains concepts such as "process group".

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:46:15 +01:00
Michael Kerrisk 248874b1ac docs: renice(1): Add SEE ALSO entry for sched(7)
The sched(7) page as of the most recent release contains detailed
information on the 'nice' value, including a discussion of
autogrouping, which has surprising interactions with the process
nice value.

Signed-off-by: <mtk.man-pages@gmail.com>
2016-12-09 13:46:15 +01:00
Michael Kerrisk f3af8329ba docs: mount(8): Wording fix
The correct word here is "practice"; "manner" would not be well
understood by most English speakers.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 82b3c4c291 docs: ionice(1): SEE ALSO: add ioprio_set(2)
ioprio_set(2) is the system call that underlies this command.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk d628c0d7a0 docs: lsns(8): SEE ALSO: add namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk fd17733fcb docs: last(1): Eliminate oddball formatting
\s-2...\s0 is unused anywhere else. Remove it.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 22a1c10ba1 docs: last(1): SEE ALSO: add reference to wtmp(5)
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk cef04ac8da docs: taskset(1): Wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 9a1f476c7c docs: namei(1): SEE ALSO: add symlink(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 8419465d2d docs: kill(1): Wording fix
Fix a wording error introduced in one of my recent commits.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk a72fa61a77 docs: various pages: Use 'UID" and "GID", not "uid" and "gid" in man pages
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 2085ba6cf6 docs: various pages: Use "PID" not "pid" in man-pages
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 9184323a59 docs: various pages: Use "ID" not "id" in man pages
The correct abbreviation of identifier is is "ID" (as used in
many pages), not "id" (as used in a few pages).

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk aedd46f66e docs: various pages: Use consistent terminology (set-user-ID and set-group-ID)
Use consistent terminology for set-user-ID and set-group-ID bits.

There's much inconsistency in the pages. "suid",
"set-user-identifier", "setuid". Stick with one terminology,
"set-user-ID" and set-grout-ID, as suggested in man-pages(7).

Signed-off-by: <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 46f057ed37 docs: various pages: Format pathnames as italic (.I)
In the majority of pages, pathnames are formatted as Italic,
which is the norm. However, there are several cases where they
are formatted as bold. This patch fixes a number of those
exceptions.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 2acd68e32a docs: renice(1): Remove obsolete BUGS text
Already at least as far back as util-linux 2.2, renice uses
getpriority(2) to fetch the process's old nice value. Thus,
the "problem" discussed in this BUGS note disappeared long ago.
This is trivially demonstrable:

    $ sleep 100 &
    [1] 24322
    $ renice -n 5 24322
    24322 (process ID) old priority 0, new priority 5
    $ renice -n 10 24322
    24322 (process ID) old priority 5, new priority 10

Rather than trying to explain the ancient problem (20 years old?),
just kill this text.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-09 13:32:34 +01:00
Michael Kerrisk f074293212 docs: renice(1): Rework discussion of unprivileged users,
The BUGS section describing the limitations on what an unprivileged
user may do to the nice value is outdated, given the kernel changes
that added RLIMIT_NICE in Linux 2.6.12. So, remove that text.

The revised details for modern Linux were partially covered in NOTES,
but there were also inaccuracies there (and the use of the word
"monotonically" was unneeded). In particular, the point is that
unprivileged users can only increase the nice value. There is no
restriction particular to the range 0..+19. So, for example, the
following scenario is possible:

1. Superuser sets the nice value of an unprivileged user's
   process to -20.
2. The unprivileged user can now renice that process to (say) -10.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-09 13:25:20 +01:00
Karel Zak f4e61504a4 hwclock: don't check for permissions
The right place to verify user permissions is kernel. The current
situation is too strict (due to previous attempts to use hwclock as
suid that has never been supported).

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-09 09:47:33 +01:00
Karel Zak 63d41c0ac0 wall: remove unnecessary include
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 16:09:15 +01:00
Karel Zak 5c493bd92f libmount: use x-systemd options as X-*
The previous patch introduces X-* options namespace for options
that have to be maintained in user space.

Unfortunately, systemd users already use mount options that are
necessary by umount or another operations. The conclusion from
discussion with systemd guys is to store all the systemd options
in userspace.

It seems better to add one line exception to libmount than force all
fstab users to rename x-systemd to X-systemd.

Addresses: https://github.com/systemd/systemd/pull/3904
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 15:27:24 +01:00
Karel Zak 83601b1af9 libmount: introduce X-* comments
x-* are fstab only and not stored in userspace (utab). In some cases
it's not optional solution because the option is also necessary for
umount or another operations. The X-* is exactly the same as x-*, but
stored to utab (or mtab on old systems).

It's usually bad idea to store mount options in userspace, but it's
better to provide any solution that force users to bypass mount(8)
(and friends) and implement 3rd-party incompatible solutions.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 14:55:02 +01:00
Karel Zak 3ebe5477db findmnt: add --tree to allow to enable tree output for --mtab
The --mtab output is merge from kernel and utab on all modern systems
(without classic /etc/mtab). It means we have all necessary information
to generate tree output.

For the backward compatibility --mtab is the list by default, the new
option --tree allows to override the default and enable tree always
when the table contains child-parent relations.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 14:24:41 +01:00
Karel Zak de22cb2b12 findmnt: add note about mount options
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 14:11:02 +01:00
Andreas Henriksson 1c4b2d4392 sulogin: bail out from getpasswd(...) on timeout
If timeout happens while waiting in prompt, bail out instead
of retrying.

Reported-by: Bjørn Mork <bjorn@mork.no>
Addresses: http://bugs.debian.org/846107
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2016-12-07 13:32:42 +01:00
Andreas Henriksson 60dea9d187 sulogin: make getpasswd(...) return NULL on ^D
This makes the caller bail out early instead of evaluating the
input as a password.

Reported-by: Bjørn Mork <bjorn@mork.no>
Addresses: http://bugs.debian.org/846112
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2016-12-07 13:32:42 +01:00
Ruediger Meier 809869ca8c build-sys: disable tailf by default
It's deprecated since 3f8478a7, so we shouldn't build it by default.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 77835be273 agetty: re-add utmp.h for Debian GNU/kFreeBSD
It's needed there to get login_tty(). On normal FreeBSD we would
need libutil.h.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 85d846b88a travis: let OSX auto-skip utmpx tools
It will disable all these programs automatically except wall(1)
which is now non-Linux compatible.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 227ebea75c build-sys: check for POSIX utmpx usage
We simply check for utmpxname and updwtmpx functions to disable
all programs which are not POSIX utmpx compatible, even though
last(1) and utmpdump(1) does not use them, see below.

utmpx.h is used in:
  login agetty write lslogins last runuser su utmpdump wall

Non-Posix utmpx usage:
   utmpxname        -> login agetty write lslogins
   updwtmpx         -> login agetty                     runuser su
   _PATH_.TMP       -> login agetty write lslogins last runuser su
   utmpx.ut_addr_v6 -> login                       last            utmpdump

POSIX utmpx usage:
   wall

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier b4b919fe5e login-utils: switch to utmpx.h
Now the build will fail on many non-Linux systems because
utmpx.h is available everywhere but we still use non-POSIX
features. We'll fix this next commit.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 81580f79fa agetty: remove obsolete HAVE_UPDWTMP fallback
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 6578ced75c login: re-add lastlog.h header
This include was removed in a365953a but we will need it again
when we move from utmp.h to utmpx.h.

On Linux (glibc, musl) the struct lastlog is defined in utmp.h
and lastlog.h just includes utmp.h.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>

Conflicts:
	login-utils/login.c

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier a924b4004c login-utils: avoid using the defined utmp sizes.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier f718c2fc7f utmpdump: code formatting for readability
BTW avoid using the defined sizes.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 77f5a94586 lslogins: remove useless strlen()
strlen() is not smarter than strncpy(). Bytes that follow a null byte
are not compared anyway.

BTW avoid using the defined sizes.

CC: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier 55771f5409 login-utils: remove _HAVE_UT_TV fallback
_HAVE_UT_TV is glibc only. Moreover we want to move to utmpx where
timeval is standard.

Now utmp/subsecond (1173d0a6) should work on all supported systems.

CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Ruediger Meier c6ba16c6a4 last: include libgen.h for basename(3p)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07 12:35:24 +01:00
Michael Kerrisk 85c928caed docs: kill(1): Wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:51:16 +01:00
Michael Kerrisk d9818c9b79 docs: kill(1): Formatting fixes
Formatting fixes for constants and structure/field names, as
per man-pages(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:51:16 +01:00
Michael Kerrisk f793f8bc91 docs: kill(1): Rework notes on thread groups
The points in the NOTES can be expressed more compactly
(there is some redundancy in the two existing paragraphs).

Also, add a reference to signal(7), since this provides
much more detail on the topic.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:51:15 +01:00
Michael Kerrisk 3d463c677e docs: kill(1): Add more detail on use of SIGTERM vs SIGKILL
It's worth adding a recommendation here to use SIGTERM
rather than SIGKILL, and explain why.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:51:15 +01:00
Michael Kerrisk b79cc53b43 docs: kill(1): Fix section reference for sigqueue(3) and add to SEE ALSO
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-05 16:51:15 +01:00
Michael Kerrisk 3be5d9772f docs: various pages: Use "system call" not "syscall"
A minor wording fix...

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-05 16:51:07 +01:00
Andreas Henriksson c7adc2f204 chrt: default to SCHED_RR policy
This fixes a regression introduced in:

commit 7a4ea5664e
"chrt: add control struct"

Previously (and as documented in the manpage) the default policy
was SCHED_RR. Now it's implicitly SCHED_OTHER (0) as the value
is not initialized explicitly anymore.

Test-command: chrt 90 echo hello

Reported-by: Patrick Pelissier <patrick.pelissier@gmail.com>
Addresses: http://bugs.debian.org/846572
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2016-12-05 13:07:50 +01:00
Karel Zak 91f20582e7 docs: nsenter(1): add missing 'see also' for --user
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-05 13:05:34 +01:00
Michael Kerrisk ff88fc3ba5 docs: nsenter(1): Formatting fix
Add formatting for 'file' argument used by various options.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 11:18:17 +01:00