]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
8 years agobuild-sys: release++ (v2.29.2) stable/v2.29 v2.29.2
Karel Zak [Wed, 22 Feb 2017 12:06:54 +0000 (13:06 +0100)] 
build-sys: release++ (v2.29.2)

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update v2.29.2-ReleaseNotes
Karel Zak [Wed, 22 Feb 2017 12:05:47 +0000 (13:05 +0100)] 
docs: update v2.29.2-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update AUTHORS file
Karel Zak [Wed, 22 Feb 2017 11:46:56 +0000 (12:46 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: merge changes
Karel Zak [Wed, 22 Feb 2017 11:45:42 +0000 (12:45 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Wed, 22 Feb 2017 11:31:23 +0000 (12:31 +0100)] 
po: update pt_BR.po (from translationproject.org)

8 years agotests: add build-sys enable-schedutils result
Karel Zak [Wed, 22 Feb 2017 11:30:07 +0000 (12:30 +0100)] 
tests: add build-sys enable-schedutils result

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: simplify UL_ENABLE_ALIAS() semantic
Karel Zak [Tue, 21 Feb 2017 10:00:19 +0000 (11:00 +0100)] 
build-sys: simplify UL_ENABLE_ALIAS() semantic

Let's follow only $enable_ variables. In this case the MASTERNAME
(e.g. [schedutils] for --enable-schedutils) has to be without
UL_BUILD_INIT.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: fix --disable-all-programs --enable-schedutils
Karel Zak [Mon, 20 Feb 2017 13:17:37 +0000 (14:17 +0100)] 
build-sys: fix --disable-all-programs --enable-schedutils

* add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name>
  according to MASTERNAME. Note that we have to use $build_<mastername>,
  the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The
  $build_ is evaluated and modified by our UL_...() functions.

* add enable-schedutils.conf to have build-system regression test for
  this use-case

Addresses: https://github.com/karelzak/util-linux/issues/415
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: (gpt) fix force flag
Karel Zak [Wed, 15 Feb 2017 10:30:58 +0000 (11:30 +0100)] 
libblkid: (gpt) fix force flag

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: fix BLKID_PARTS_FORCE_GPT usage
Karel Zak [Tue, 14 Feb 2017 13:57:24 +0000 (14:57 +0100)] 
libblkid: fix BLKID_PARTS_FORCE_GPT usage

Now wipefs always inform about MBR as about PMBR. That's bug.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agofindmnt: use line separator for --poll output
Karel Zak [Fri, 10 Feb 2017 16:28:07 +0000 (17:28 +0100)] 
findmnt: use line separator for --poll output

Addresses: https://github.com/karelzak/util-linux/issues/409
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: fix fdisk_set_wipe_area() calls
Karel Zak [Fri, 10 Feb 2017 15:45:18 +0000 (16:45 +0100)] 
libfdisk: fix fdisk_set_wipe_area() calls

The function expects size in sectors rather than in bytes.

Addresses: https://github.com/karelzak/util-linux/issues/410
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: --quiet fixes
Karel Zak [Fri, 10 Feb 2017 11:54:23 +0000 (12:54 +0100)] 
sfdisk: --quiet fixes

Addresses: https://github.com/karelzak/util-linux/issues/412
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: improve detection of the "isnan" function in uClibc
Carlos Santos [Wed, 8 Feb 2017 15:27:36 +0000 (13:27 -0200)] 
build-sys: improve detection of the "isnan" function in uClibc

Since commit beceb14b450ded6560ed743634a5e80604a8edf3, MATH_LIBS is set
to "-lm" when the isnan function is detected. In uClibc, however, isnan
is a macro that calls __isnan, __isnanf, or __isnanl, depending on the
size of the argument (double, float or long double).

Fixes:
  http://autobuild.buildroot.net/results/2c2/2c29a78ed81ca844a87dcd076ab3e14ea080296d/
  http://autobuild.buildroot.net/results/404/404b10f359b2ae8a7216729fa1bab37fed2d3d4c/

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
8 years agoumount: exclude selinuxfs from --all
Karel Zak [Thu, 9 Feb 2017 10:21:49 +0000 (11:21 +0100)] 
umount: exclude selinuxfs from --all

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1417722
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: make rootfs lookup by parent-id more robust
Karel Zak [Wed, 1 Feb 2017 15:12:55 +0000 (16:12 +0100)] 
libmount: make rootfs lookup by parent-id more robust

The root FS id really does not have to be the smallest one.

[kzak@redhat.com: - backported to stable branch without reg.test]

Reported-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agocfdisk: support UI refresh on ^L
Karel Zak [Wed, 1 Feb 2017 14:34:57 +0000 (15:34 +0100)] 
cfdisk: support UI refresh on ^L

Addresses: https://github.com/karelzak/util-linux/issues/404
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosu: properly clear child PID
Karel Zak [Wed, 1 Feb 2017 10:58:09 +0000 (11:58 +0100)] 
su: properly clear child PID

Reported-by: Tobias Stöckmann <tobias@stoeckmann.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolscpu: don't use path_exist() before path_fopen()
Karel Zak [Tue, 31 Jan 2017 19:55:07 +0000 (20:55 +0100)] 
lscpu: don't use path_exist() before path_fopen()

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: add BUG REPORTING section to README
Karel Zak [Tue, 31 Jan 2017 15:18:11 +0000 (16:18 +0100)] 
docs: add BUG REPORTING section to README

Addresses: https://github.com/karelzak/util-linux/issues/405
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolscpu: make osrelease file optional
Karel Zak [Tue, 31 Jan 2017 12:44:43 +0000 (13:44 +0100)] 
lscpu: make osrelease file optional

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolscpu: Detect Windows Subsystem for Linux
Stanislav Brabec [Mon, 30 Jan 2017 16:01:50 +0000 (17:01 +0100)] 
lscpu: Detect Windows Subsystem for Linux

Windows 10 implements Windows Subsystem for Linux (WSL).

WSL does not implement support for SIGSEGV handler, which is used inside
is_vmware_platform(). As a result, lscpu crashes there.

Implement WSL detection, and as a side effect, work around the crash.
Note that none of existing virtualization types exactly matches.
But the the closest would be "container".

References:

Provide a way to positively detect WSL from an app compiled on Linux.
https://github.com/Microsoft/BashOnWindows/issues/423

missing support for SIGSEGV handler
https://github.com/Microsoft/BashOnWindows/issues/1637

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
8 years agofstrim: de-duplicate btrfs sub-volumes
Stanislav Brabec [Wed, 25 Jan 2017 17:30:26 +0000 (18:30 +0100)] 
fstrim: de-duplicate btrfs sub-volumes

There was a comparison of roots in uniq_fs_source_cmp(). As we care only on
device names, comparing roots makes only a little sense, and it breaks on btrfs.
As a result, FITRIM ioctl() is called for each subvolume. But by design, only
one TRIM is needed for the whole btrfs volume.

Remove it to be able to de-duplicate btrfs subvolumes.

Fixes opensuse #1020077.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
8 years agofindmnt: flush stdout after each (un)(re)mount event, when polling.
Pedro Miguel Carvalho [Sun, 29 Jan 2017 12:03:23 +0000 (12:03 +0000)] 
findmnt: flush stdout after each (un)(re)mount event, when polling.

Addresses: karelzak#407

8 years agologger: support sub-trees in the ID for RFC5424
Karel Zak [Sat, 28 Jan 2017 11:39:52 +0000 (12:39 +0100)] 
logger: support sub-trees in the ID for RFC5424

The current code supports <name>@<digit> only, but we also need
<name>@<digit>.<digit>[. ...]

RFC5424: 7.2.2 enterpriseId:

 In general, only the IANA-assigned private enterprise number is
 needed (a single number).  An enterprise might decide to use
 sub-identifiers below its private enterprise number.  If sub-
 identifiers are used, they MUST be separated by periods and be
 represented as decimal numbers.  An example for that would be
 "32473.1.2".

Addresses: https://github.com/karelzak/util-linux/issues/406
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolib/strutils: return end pointer by isdigit_string()
Karel Zak [Sat, 28 Jan 2017 11:39:30 +0000 (12:39 +0100)] 
lib/strutils: return end pointer by isdigit_string()

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: (gpt) add check for entries array size
Karel Zak [Wed, 25 Jan 2017 11:00:27 +0000 (12:00 +0100)] 
libfdisk: (gpt) add check for entries array size

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: Fix out of bounds reads on bad GPT header
Alden Tondettar [Tue, 24 Jan 2017 06:28:00 +0000 (23:28 -0700)] 
libblkid: Fix out of bounds reads on bad GPT header

If a GUID Partition Table claims to have more than 2**25 entries, or if the
size of each entry is not exactly 128 bytes, libblkid can read out of bounds
and segfault. Perform the appropriate checks.

[kzak@redhat.com: - fix typo]

Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: release++ (v2.29.1) v2.29.1
Karel Zak [Fri, 20 Jan 2017 13:13:08 +0000 (14:13 +0100)] 
build-sys: release++ (v2.29.1)

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update v2.29.1-ReleaseNotes
Karel Zak [Fri, 20 Jan 2017 13:11:26 +0000 (14:11 +0100)] 
docs: update v2.29.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update AUTHORS file
Karel Zak [Fri, 20 Jan 2017 13:07:48 +0000 (14:07 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: merge changes
Karel Zak [Fri, 20 Jan 2017 13:06:39 +0000 (14:06 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: (build-sys) don't link -lm by default
Karel Zak [Fri, 20 Jan 2017 12:57:38 +0000 (13:57 +0100)] 
tests: (build-sys) don't link -lm by default

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoman: chsh(1): add login.defs to SEE ALSO
Andreas Henriksson [Thu, 19 Jan 2017 21:50:31 +0000 (22:50 +0100)] 
man: chsh(1): add login.defs to SEE ALSO

(The shadow equivalent manpage lists it.)

8 years agochsh: use -h as shorthand for --help instead of -u
Andreas Henriksson [Thu, 19 Jan 2017 22:04:47 +0000 (23:04 +0100)] 
chsh: use -h as shorthand for --help instead of -u

The -u is still supported (but no longer documented).

(This matches the switches used by shadow chsh.)

8 years agoman: chfn(1): add chsh and login.defs to SEE ALSO
Andreas Henriksson [Thu, 19 Jan 2017 21:39:31 +0000 (22:39 +0100)] 
man: chfn(1): add chsh and login.defs to SEE ALSO

(The shadow version of the same manpage mentions these utils,
but does not mention finger.)

8 years agobuild-sys: fix compilation with ncurses and uClibc or musl libc
Carlos Santos [Thu, 19 Jan 2017 19:27:37 +0000 (17:27 -0200)] 
build-sys: fix compilation with ncurses and uClibc or musl libc

Compiling util-linux with musl and uClibc-ng toolchains when wide-char
support is not enabled in ncurses results in compilation failures with
the following message:

    error: two or more data types in declaration specifiers
    #define
     wchar_t char

The problem occurs because util-linux #defines its own wchar_t (as char)
when configured without widechar support. This conflicts with definition
of wchar_t contained in stddef.h.

This error can be reproduced running "<toolchain-cc -o test test.c" with
the following test program:

    #include <ctype.h>
    #define wchar_t char
    #include <stddef.h>

    int main()
    {
        return 0;
    }

The only way to avoid the problem it to reorder the inclusion of headers
in some files under the text-utils directory.

Addresses:
  http://autobuild.buildroot.net/results/3a2f228e0fa7b5cc28a13d49f48f1a6aef8d9d7a
  http://autobuild.buildroot.net/results/99e96069f652d511c6212a5bb6be29e68fb1747c
  http://autobuild.buildroot.net/results/2dc5721aef93b7b410153bafad78248fac3db941
  http://autobuild.buildroot.net/results/8a9e197ba7a292b18f8c0c36dca974685556a38a

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
8 years agosu, runuser: fix typo in the /etc/default path
Karel Zak [Fri, 20 Jan 2017 10:02:23 +0000 (11:02 +0100)] 
su, runuser: fix typo in the /etc/default path

Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agorunuser: add "--" to SYNOPSIS
Karel Zak [Thu, 19 Jan 2017 11:01:51 +0000 (12:01 +0100)] 
runuser: add "--" to SYNOPSIS

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoterm-utils/script: fix typo leading to syntax error
Bert van Hall [Wed, 18 Jan 2017 15:41:36 +0000 (16:41 +0100)] 
term-utils/script: fix typo leading to syntax error

Introduced in edc7e42, this typo is actually invalid C. Fix this.

Signed-off-by: Bert van Hall <bert.vanhall@avionic-design.de>
8 years agobuild-sys: use MATH_LIBS for hwclock
Karel Zak [Thu, 19 Jan 2017 10:35:24 +0000 (11:35 +0100)] 
build-sys: use MATH_LIBS for hwclock

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update v2.29.1-ReleaseNotes
Karel Zak [Wed, 18 Jan 2017 13:04:18 +0000 (14:04 +0100)] 
docs: update v2.29.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update AUTHORS file
Karel Zak [Wed, 18 Jan 2017 13:03:11 +0000 (14:03 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: merge changes
Karel Zak [Wed, 18 Jan 2017 13:01:44 +0000 (14:01 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Wed, 18 Jan 2017 12:50:12 +0000 (13:50 +0100)] 
po: update pt_BR.po (from translationproject.org)

8 years agopo: update fr.po (from translationproject.org)
Stéphane Aulery [Wed, 18 Jan 2017 12:50:12 +0000 (13:50 +0100)] 
po: update fr.po (from translationproject.org)

8 years agopo: update da.po (from translationproject.org)
Joe Hansen [Wed, 18 Jan 2017 12:50:12 +0000 (13:50 +0100)] 
po: update da.po (from translationproject.org)

8 years agolibfdisk: (gpt) make calculations more robust
Karel Zak [Mon, 16 Jan 2017 13:57:02 +0000 (14:57 +0100)] 
libfdisk: (gpt) make calculations more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: recount size when apply user device properties
Karel Zak [Fri, 13 Jan 2017 11:16:06 +0000 (12:16 +0100)] 
libfdisk: recount size when apply user device properties

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoIf mtab support is disabled, disable ro/rw mtab checks
Stanislav Brabec [Tue, 10 Jan 2017 12:54:17 +0000 (13:54 +0100)] 
If mtab support is disabled, disable ro/rw mtab checks

Commit f9906424 introduced a check that should prevent different information in
mtab and /proc/mounts. The check can require significant amount of time, and for
systems without mtab support it has no sense.

Execute this code only on systems with mtab.

When a systems with large number of nodes (thousands) mount the filesystems
simultaneously, the time required for serialization causes the utimensat() to
take a large amount of time (tens of minutes) when a large number of nodes are
simultaneously updating the timestamp.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
8 years agolibsmartcols: add scols_cell_get_alignment()
Karel Zak [Mon, 9 Jan 2017 12:28:24 +0000 (13:28 +0100)] 
libsmartcols: add scols_cell_get_alignment()

Just to hide that we use cell flags (bitwise operations) to define
cell content alignment. The patch also more explicitly specifies the
flags in the header file.

The alignment is evaluated in the order: right, center, left. The
default is left.

Note that SCOLS_CELL_FL_* are used for for table title only.

v2.29.1: function not exported by API
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolscpu: add aarch64 specific names
Karel Zak [Mon, 9 Jan 2017 12:01:39 +0000 (13:01 +0100)] 
lscpu: add aarch64 specific names

It seems that aarch64 uses a different names for some /proc/cpuinfo
fields (e.g. intel: bogomips, flags, and aarch64: BogoMIPS, features, ...)

Addresses: https://github.com/karelzak/util-linux/issues/392
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid/minix: Sanity check superblock s_state for v 1 and 2
Nate Clark [Wed, 4 Jan 2017 20:21:17 +0000 (15:21 -0500)] 
libblkid/minix: Sanity check superblock s_state for v 1 and 2

Swap devices with specific values in the uuid can look like minix
devices to blkid. Add an extra check to make sure the state of the
filesystem has valid state flags.

A couple of offending swap uuids include:
35f1f264-137f-471a-bc85-acc9f4bc04a3
35f1f264-7f13-471a-bc85-acc9f4bc04a3
35f1f264-138f-471a-bc85-acc9f4bc04a3
35f1f264-8f13-471a-bc85-acc9f4bc04a3

Without this change a swap device with any of those uuids would be
detected as minix and swap by blkid.

Signed-off-by: Nate Clark <nate@neworld.us>
8 years agolibblkid/minix: Use same checks for version 3
Nate Clark [Wed, 4 Jan 2017 20:24:32 +0000 (15:24 -0500)] 
libblkid/minix: Use same checks for version 3

fsck.minix performs the same sanity checks on all versions of the
superblock. Update the probe to perform the same sanity checks so it is
less likely a different type of filesystem will be identified as minix.

Signed-off-by: Nate Clark <nate@neworld.us>
8 years agolibblkid/minix: Match minix superblock types
Nate Clark [Wed, 4 Jan 2017 20:24:22 +0000 (15:24 -0500)] 
libblkid/minix: Match minix superblock types

All of the types in the minix super block are unsigned but in
probe_minix they were being treated as signed. This would cause some of
the extra sanity checks to pass on a non minix device. The types were
updated to match the return types of the helper functions in
disk-utils/minix_programs.h

This can be checked by creating a swap partition with one of these UUIDs
35f1f264-2468-471a-bc85-acc9f4bc04a3
35f1f264-6824-471a-bc85-acc9f4bc04a3
35f1f264-2478-471a-bc85-acc9f4bc04a3
35f1f264-7824-471a-bc85-acc9f4bc04a3

Prior to this change they would all be considered minix and swap by
blkid.

Signed-off-by: Nate Clark <nate@neworld.us>
8 years agodisk-utils/mkfs.minix: Set ninodes after checking max
Nate Clark [Wed, 4 Jan 2017 17:31:37 +0000 (12:31 -0500)] 
disk-utils/mkfs.minix: Set ninodes after checking max

ninodes in the superblock needs to be set after inodes is checked
against MINIX_MAX_INODES otherwise a value larger than MINIX_MAX_INODES
can be attempted to be stored in the superblock.

Without this change the command "mkfs.minix -2 -i 65530 <dev>" would
write a minix superblock with ninodes set to 0.

Signed-off-by: Nate Clark <nate@neworld.us>
8 years agolib/linux_version: fix stupid typo
Karel Zak [Mon, 2 Jan 2017 10:32:24 +0000 (11:32 +0100)] 
lib/linux_version: fix stupid typo

 ... introduced by commit d404065a. Sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agofindmnt: error on --target /non-exist
Karel Zak [Fri, 16 Dec 2016 11:46:45 +0000 (12:46 +0100)] 
findmnt: error on --target /non-exist

The original --target implementation (< v2.27) has been based on
stat(), so it was usable for valid paths only.

The new implementation is based on search in the mountinfo file, so it
works for arbitrary crazy path. This is not backwardly compatible and
if the path does not exist then it still returns at least root
directory mount entry.

This patch forces mnt_table_find_mountpoint() to check if the path is
valid before we search in the mountinfo file.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agomore: avoid double free() on exit
Karel Zak [Thu, 15 Dec 2016 13:40:26 +0000 (14:40 +0100)] 
more: avoid double free() on exit

On 'q' command more(1) calls end_it() function with _exit(). The
_exit() may suspend program execution due to pending I/O on very
loaded server. In this time SIGINT may be delivered due to impatient
user who will press ^C.

And then end_it() cleanup function may be executed by signal handler
too. The result is double free()...

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1403971
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: cleanup UL_NCURSES_CHECK
Karel Zak [Tue, 13 Dec 2016 11:41:18 +0000 (12:41 +0100)] 
build-sys: cleanup UL_NCURSES_CHECK

* use SUFFIX for upper-case suffix
* use AC_CHECK_TOOL() to search for ncurses-config (thanks to Mike Frysinger)
* separate checks by AS_IF()

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agofdisk: don't be silent when list non-existing device
Karel Zak [Tue, 13 Dec 2016 11:11:18 +0000 (12:11 +0100)] 
fdisk: don't be silent when list non-existing device

Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: prefer pkg-config for ncurses
Karel Zak [Mon, 12 Dec 2016 14:23:53 +0000 (15:23 +0100)] 
build-sys: prefer pkg-config for ncurses

and use ncurses{5,6}-config as fallback only.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: don't clean *.img files
Ruediger Meier [Wed, 7 Dec 2016 19:39:02 +0000 (20:39 +0100)] 
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>
8 years agodocs: renice(1): Add credentials(7) to SEE ALSO
Michael Kerrisk [Mon, 5 Dec 2016 06:49:42 +0000 (07:49 +0100)] 
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>
8 years agodocs: renice(1): Add SEE ALSO entry for sched(7)
Michael Kerrisk [Mon, 5 Dec 2016 06:28:09 +0000 (07:28 +0100)] 
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>
8 years agodocs: mount(8): Wording fix
Michael Kerrisk [Sun, 4 Dec 2016 20:00:34 +0000 (21:00 +0100)] 
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>
8 years agodocs: ionice(1): SEE ALSO: add ioprio_set(2)
Michael Kerrisk [Sat, 3 Dec 2016 19:39:35 +0000 (20:39 +0100)] 
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>
8 years agodocs: lsns(8): SEE ALSO: add namespaces(7)
Michael Kerrisk [Sat, 3 Dec 2016 19:38:52 +0000 (20:38 +0100)] 
docs: lsns(8): SEE ALSO: add namespaces(7)

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
8 years agodocs: last(1): Eliminate oddball formatting
Michael Kerrisk [Sun, 4 Dec 2016 19:23:54 +0000 (20:23 +0100)] 
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>
8 years agodocs: last(1): SEE ALSO: add reference to wtmp(5)
Michael Kerrisk [Sat, 3 Dec 2016 19:37:10 +0000 (20:37 +0100)] 
docs: last(1): SEE ALSO: add reference to wtmp(5)

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
8 years agodocs: taskset(1): Wording fix
Michael Kerrisk [Mon, 5 Dec 2016 11:39:22 +0000 (12:39 +0100)] 
docs: taskset(1): Wording fix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agodocs: namei(1): SEE ALSO: add symlink(7)
Michael Kerrisk [Mon, 5 Dec 2016 11:36:50 +0000 (12:36 +0100)] 
docs: namei(1): SEE ALSO: add symlink(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agodocs: kill(1): Wording fix
Michael Kerrisk [Wed, 7 Dec 2016 13:04:17 +0000 (14:04 +0100)] 
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>
8 years agodocs: various pages: Use 'UID" and "GID", not "uid" and "gid" in man pages
Michael Kerrisk [Sun, 4 Dec 2016 19:51:32 +0000 (20:51 +0100)] 
docs: various pages: Use 'UID" and "GID", not "uid" and "gid" in man pages

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
8 years agodocs: various pages: Use "PID" not "pid" in man-pages
Michael Kerrisk [Sun, 4 Dec 2016 19:44:04 +0000 (20:44 +0100)] 
docs: various pages: Use "PID" not "pid" in man-pages

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
8 years agodocs: various pages: Use "ID" not "id" in man pages
Michael Kerrisk [Sun, 4 Dec 2016 19:40:01 +0000 (20:40 +0100)] 
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>
8 years agodocs: various pages: Use consistent terminology (set-user-ID and set-group-ID)
Michael Kerrisk [Sun, 4 Dec 2016 19:34:54 +0000 (20:34 +0100)] 
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>
8 years agodocs: various pages: Format pathnames as italic (.I)
Michael Kerrisk [Sat, 3 Dec 2016 20:13:59 +0000 (21:13 +0100)] 
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>
8 years agodocs: renice(1): Remove obsolete BUGS text
Michael Kerrisk [Fri, 9 Dec 2016 12:32:34 +0000 (13:32 +0100)] 
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>
8 years agodocs: renice(1): Rework discussion of unprivileged users,
Michael Kerrisk [Fri, 9 Dec 2016 12:25:20 +0000 (13:25 +0100)] 
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>
8 years agohwclock: don't check for permissions
Karel Zak [Fri, 9 Dec 2016 08:47:33 +0000 (09:47 +0100)] 
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>
8 years agosulogin: bail out from getpasswd(...) on timeout
Andreas Henriksson [Mon, 28 Nov 2016 16:24:50 +0000 (17:24 +0100)] 
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>
8 years agosulogin: make getpasswd(...) return NULL on ^D
Andreas Henriksson [Mon, 28 Nov 2016 16:24:49 +0000 (17:24 +0100)] 
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>
8 years agodocs: kill(1): Wording fix
Michael Kerrisk [Mon, 5 Dec 2016 09:46:48 +0000 (10:46 +0100)] 
docs: kill(1): Wording fix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agodocs: kill(1): Formatting fixes
Michael Kerrisk [Mon, 5 Dec 2016 09:43:53 +0000 (10:43 +0100)] 
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>
8 years agodocs: kill(1): Rework notes on thread groups
Michael Kerrisk [Mon, 5 Dec 2016 09:38:53 +0000 (10:38 +0100)] 
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>
8 years agodocs: kill(1): Add more detail on use of SIGTERM vs SIGKILL
Michael Kerrisk [Mon, 5 Dec 2016 09:24:54 +0000 (10:24 +0100)] 
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>
8 years agodocs: kill(1): Fix section reference for sigqueue(3) and add to SEE ALSO
Michael Kerrisk [Sat, 3 Dec 2016 19:37:51 +0000 (20:37 +0100)] 
docs: kill(1): Fix section reference for sigqueue(3) and add to SEE ALSO

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
8 years agodocs: various pages: Use "system call" not "syscall"
Michael Kerrisk [Sun, 4 Dec 2016 16:44:55 +0000 (17:44 +0100)] 
docs: various pages: Use "system call" not "syscall"

A minor wording fix...

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
8 years agochrt: default to SCHED_RR policy
Andreas Henriksson [Fri, 2 Dec 2016 14:10:18 +0000 (15:10 +0100)] 
chrt: default to SCHED_RR policy

This fixes a regression introduced in:

commit 7a4ea5664edba98bff28adec3a9c3cfb5763a495
"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>
8 years agodocs: nsenter(1): add missing 'see also' for --user
Karel Zak [Mon, 5 Dec 2016 12:05:34 +0000 (13:05 +0100)] 
docs: nsenter(1): add missing 'see also' for --user

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: nsenter(1): Formatting fix
Michael Kerrisk [Mon, 5 Dec 2016 09:55:41 +0000 (10:55 +0100)] 
docs: nsenter(1): Formatting fix

Add formatting for 'file' argument used by various options.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agodocs: nsenter(1): Describe the 'file' argument used by namespace options
Michael Kerrisk [Mon, 5 Dec 2016 09:52:09 +0000 (10:52 +0100)] 
docs: nsenter(1): Describe the 'file' argument used by namespace options

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agolsns: Fix parser for /proc/<pid>/stat which is including space in comm
OGAWA Hirofumi [Wed, 23 Nov 2016 05:13:34 +0000 (14:13 +0900)] 
lsns: Fix parser for /proc/<pid>/stat which is including space in comm

For example, child process of spamd has

    32031 (spamd child) S 32026 32026 32026 0 -1 4210752 338 0 0 0 ...

fscanf("%d %*s %c %d*[^\n]") in read_process() can't parse above as we
expected, because %s only skips non-whitespace. I.e. it parses like
following,

    32031 (spamd child) S 32026 32026 32026 0 -1 4210752 338 0 0 0 ...
    +---+ +----+ +
      %d    %*s  %c

and returns 2 (pid=32031, state=c).

This fixes it by skipping task->comm part manually.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
8 years agosfdisk: cleanup --dump error messages
Karel Zak [Wed, 30 Nov 2016 09:53:56 +0000 (10:53 +0100)] 
sfdisk: cleanup --dump error messages

old:
  # truncate -s 1G empty && ./sfdisk --dump empty
  sfdisk: failed to dump partition table: Success

new:
  # truncate -s 1G empty && ./sfdisk --dump empty
  sfdisk: empty: does not contain a recognized partition table.

Addresses: https://github.com/karelzak/util-linux/issues/375
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: don't be silent when list non-existing device
Karel Zak [Tue, 29 Nov 2016 14:58:18 +0000 (15:58 +0100)] 
sfdisk: don't be silent when list non-existing device

Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: update package release number during development
Ruediger Meier [Thu, 17 Nov 2016 02:09:59 +0000 (03:09 +0100)] 
build-sys: update package release number during development

Now we use
   v2.29-5-g8ffab30  -> 2.29.5-8ffa   (libblkid 2.29.5)
instead of
   v2.29-5-g8ffab30  -> 2.29.5-8ffa   (libblkid 2.29.0)

otherwise the bugfix releases (2.29.1) would look newer that latest HEAD.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
8 years agobuild-sys: fix empty package release number
Ruediger Meier [Thu, 17 Nov 2016 02:09:58 +0000 (03:09 +0100)] 
build-sys: fix empty package release number

Was broken for major releases since b0e6b25e:
  $ blkid -V
  blkid from util-linux 2.28  (libblkid 2.28., 12-Apr-2016)

Now we also set 0 in this case, like:
  $ blkid -V
  blkid from util-linux 2.30  (libblkid 2.30.0, 12-Apr-2016)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
8 years agoIPC namespaces also isolate POSIX message queues
Michael Kerrisk (man-pages) [Thu, 10 Nov 2016 11:00:09 +0000 (12:00 +0100)] 
IPC namespaces also isolate POSIX message queues

As described in pid_namespaces(7), IPC namespaces also
isolate POSIX message queues. Update the unshare(1)
and nsenter(1) pages to clarify that.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoProvide better cross references for namespace concepts
Michael Kerrisk (man-pages) [Thu, 10 Nov 2016 11:00:05 +0000 (12:00 +0100)] 
Provide better cross references for namespace concepts

For each namespace that is discussed, add more explicit
references to the corresponding clone(2) flags and
add references to relevant section 7 namespace pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>