]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 years agoinclude/pathnames: cleanup /proc/sys/kernel use
Karel Zak [Tue, 2 Feb 2021 11:39:57 +0000 (12:39 +0100)] 
include/pathnames: cleanup /proc/sys/kernel use

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'uclampset-v3' of https://github.com/qais-yousef/util-linux
Karel Zak [Tue, 2 Feb 2021 15:53:50 +0000 (16:53 +0100)] 
Merge branch 'uclampset-v3' of https://github.com/qais-yousef/util-linux

* 'uclampset-v3' of https://github.com/qais-yousef/util-linux:
  uclampset: Plumb in bash-completion
  uclampset: Plump into the build system
  uclampset: Add man page
  Add uclampset schedutil
  Move sched_attr struct and syscall definitions into header file

4 years agouclampset: Plumb in bash-completion
Qais Yousef [Tue, 13 Oct 2020 15:04:14 +0000 (16:04 +0100)] 
uclampset: Plumb in bash-completion

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
4 years agouclampset: Plump into the build system
Qais Yousef [Tue, 13 Oct 2020 15:04:06 +0000 (16:04 +0100)] 
uclampset: Plump into the build system

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
4 years agouclampset: Add man page
Qais Yousef [Tue, 13 Oct 2020 15:03:57 +0000 (16:03 +0100)] 
uclampset: Add man page

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
4 years agoAdd uclampset schedutil
Qais Yousef [Tue, 13 Oct 2020 15:03:44 +0000 (16:03 +0100)] 
Add uclampset schedutil

Utilization clamping is a new kernel feature that got merged in 5.3. It
allows controlling the performance of a process by manipulating the
utilization such that the task appears bigger or smaller than what it
really is.

There's a system-wide control to to restrict what maximum values the
process are allowed to use.

Man page added in a later patch attempts to explain the usage in more
detail.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
4 years agoagetty: Allow --init-string on a virtual console
Ivan Mironov [Mon, 1 Feb 2021 16:58:27 +0000 (21:58 +0500)] 
agetty: Allow --init-string on a virtual console

This option has valid use cases on virtual consoles. Example:
enabling screen blanking in the same way as `setterm --blank ...`
does.

Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
4 years agoeject: cleanup before successful exit
Karel Zak [Mon, 1 Feb 2021 11:21:18 +0000 (12:21 +0100)] 
eject: cleanup before successful exit

Fixes: https://github.com/karelzak/util-linux/issues/1239
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMove sched_attr struct and syscall definitions into header file
Qais Yousef [Tue, 13 Oct 2020 15:03:35 +0000 (16:03 +0100)] 
Move sched_attr struct and syscall definitions into header file

So that we can re-use them in other files.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
4 years agofsck.cramfs: fix fsck.cramfs crashes on blocksizes > 4K
ToddRK [Thu, 28 Jan 2021 11:44:41 +0000 (12:44 +0100)] 
fsck.cramfs: fix fsck.cramfs crashes on blocksizes > 4K

fsck.cramfs crashes when extracting a cramfs image with a 16KB blocksize.
The read_buffer is hardcoded for a 4KB blocksize.  When using a blocksize
larger than 4KB, the program's code uses indexes that go past the end of the
allocated space for the read_buffer and this causes the crash.

The following changes fix the problem for me in the latest 2.36.1 release of
fsck.cramfs.c.  However there are hardcoded values of 4096 in the code that
might cause problems under other circumstances and I have not attempted to
fix those.

[kzak@redhat.com: - some coding style changes to code]

Fixes: https://github.com/karelzak/util-linux/issues/1232
Signed-off-by: ToddRK <ToddRK@example.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib: use ul_prefix for close_all_fds() and mkdir_p()
Karel Zak [Thu, 28 Jan 2021 09:27:21 +0000 (10:27 +0100)] 
lib: use ul_prefix for close_all_fds() and mkdir_p()

The names are too generic and it makes problems in static libraries.

Addresses: https://gitlab.com/cryptsetup/cryptsetup/-/issues/623
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: enable ci-build for all basic branches
Karel Zak [Tue, 26 Jan 2021 14:52:41 +0000 (15:52 +0100)] 
github: enable ci-build for all basic branches

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agodocs: update TODO
Karel Zak [Tue, 26 Jan 2021 14:51:26 +0000 (15:51 +0100)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotravis: remove old ubuntu
Karel Zak [Tue, 26 Jan 2021 14:23:29 +0000 (15:23 +0100)] 
travis: remove old ubuntu

Ubuntu 12.04 LTS (Precise Pangolin) -- from April 2012 to April 2017.

It's more and more difficult to keep code and tests in all details
compatible with it 4 years dead distro.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: make sure compiler is defined
Karel Zak [Tue, 26 Jan 2021 11:39:22 +0000 (12:39 +0100)] 
github: make sure compiler is defined

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: CC fix export
Karel Zak [Tue, 26 Jan 2021 11:09:01 +0000 (12:09 +0100)] 
github: CC fix export

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: export CC and CXX
Karel Zak [Tue, 26 Jan 2021 10:56:33 +0000 (11:56 +0100)] 
github: export CC and CXX

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: skip hwclock/systohc on GH Actions
Karel Zak [Tue, 26 Jan 2021 10:54:38 +0000 (11:54 +0100)] 
tests: skip hwclock/systohc on GH Actions

It seems the delay on GH is too large to get proper result for this
tests. We already ignore it on Travis.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: mark ul/basic as KNOWN_FAIL
Karel Zak [Tue, 26 Jan 2021 10:39:10 +0000 (11:39 +0100)] 
tests: mark ul/basic as KNOWN_FAIL

It works locally and on Travis, but fail on Github Actions.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: migrate from ext3 to ext2
Karel Zak [Tue, 26 Jan 2021 10:11:14 +0000 (11:11 +0100)] 
tests: migrate from ext3 to ext2

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: dump more information about CFS and block devices
Karel Zak [Tue, 26 Jan 2021 09:30:01 +0000 (10:30 +0100)] 
tests: dump more information about CFS and block devices

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: remove distcheck
Karel Zak [Tue, 26 Jan 2021 08:44:44 +0000 (09:44 +0100)] 
github: remove distcheck

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: cleanup cibuild.sh
Karel Zak [Mon, 25 Jan 2021 16:32:17 +0000 (17:32 +0100)] 
github: cleanup cibuild.sh

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: fix btrfs package name
Karel Zak [Mon, 25 Jan 2021 16:13:51 +0000 (17:13 +0100)] 
github: fix btrfs package name

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: fix cibuild typo
Karel Zak [Mon, 25 Jan 2021 15:57:06 +0000 (16:57 +0100)] 
github: fix cibuild typo

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: add build workflow
Karel Zak [Mon, 25 Jan 2021 15:51:51 +0000 (16:51 +0100)] 
github: add build workflow

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: allow --read-only for not-root users
Karel Zak [Mon, 25 Jan 2021 10:11:05 +0000 (11:11 +0100)] 
libmount: allow --read-only for not-root users

The command "mount -r" was supported for non-root users in very old
mount(8) versions. Unfortunately, in this case libmount replaces all
mount options from command line by options from fstab. We need
exception for MS_RDONLY.

Fixes: https://github.com/karelzak/util-linux/issues/1235
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotravis: use verbose mode (V=1) for make
Karel Zak [Mon, 25 Jan 2021 08:23:16 +0000 (09:23 +0100)] 
travis: use verbose mode (V=1) for make

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: add restrict keyword fallback
Karel Zak [Fri, 22 Jan 2021 12:28:02 +0000 (13:28 +0100)] 
build-sys: add restrict keyword fallback

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibuuid: improve "restrict" keyword use
Karel Zak [Fri, 22 Jan 2021 09:44:01 +0000 (10:44 +0100)] 
libuuid: improve "restrict" keyword use

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 on travis-ci returns:

 libuuid/src/unparse.c:42:67: error: ‘restrict’ undeclared here (not in a function)
 libuuid/src/unparse.c: In function ‘uuid_fmt’:

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'fix-vms' of https://github.com/Govelius/util-linux
Karel Zak [Thu, 21 Jan 2021 11:01:19 +0000 (12:01 +0100)] 
Merge branch 'fix-vms' of https://github.com/Govelius/util-linux

4 years agofix compiler warnings
Karel Zak [Thu, 21 Jan 2021 09:26:25 +0000 (10:26 +0100)] 
fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: add vboxsf, virtiofs to pseudo filesystems
Shahid Laher [Wed, 20 Jan 2021 18:04:33 +0000 (18:04 +0000)] 
libmount: add vboxsf, virtiofs to pseudo filesystems

Filesystems provided by a hypervisor for guest kernels:
* vboxsf: Linux 5.6
* virtiofs: Linux 5.4

Signed-off-by: Shahid Laher <govellius@gmail.com>
4 years agowipefs: fix compiler warning
Karel Zak [Wed, 20 Jan 2021 08:20:54 +0000 (09:20 +0100)] 
wipefs: fix compiler warning

misc-utils/wipefs.c: In function ‘main’:
misc-utils/wipefs.c:838:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
misc-utils/wipefs.c:838:3: note: use option -std=c99 or -std=gnu99 to compile your code

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: improve u64 use in ipcs test
Karel Zak [Tue, 19 Jan 2021 15:25:33 +0000 (16:25 +0100)] 
tests: improve u64 use in ipcs test

UINT64_MAX is 18446744073709551615, but 2^64 is 18446744073709551616.
We also need to use kbytes in all calculation in the test than bytes
as ipcs by default do not use bytes anymore.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsblk: fix filesystem array allocation
Karel Zak [Tue, 19 Jan 2021 13:59:01 +0000 (14:59 +0100)] 
lsblk: fix filesystem array allocation

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoipcs: fallback for overflow
Karel Zak [Mon, 18 Jan 2021 15:04:18 +0000 (16:04 +0100)] 
ipcs: fallback for overflow

The previous commit 7a08784ab053d6aa30db990cbec1fd35b34ed00a reduced
number of situation when we need fallback when kbytes calculated for
shmall pages, but there is still possible to see overflows.

This patch add fallback also for kbytes.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: set shmmni to 32k
Karel Zak [Mon, 18 Jan 2021 12:22:26 +0000 (13:22 +0100)] 
tests: set shmmni to 32k

Linux kernel since 6730e6580177d13f4612767873cb5a533ad63c61 checks for
limits and kernel ipc/utils.h defines

 #define IPCMNI_SHIFT         15
 #define IPCMNI               (1 << IPCMNI_SHIFT)

it means 32768 (aka shortint max). Let's use it in our tests too to
avoid "Invalid argument" when write to /proc/sys/kernel/shmmni.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoipcs: Avoid shmall overflows
Vasilis Liaskovitis [Fri, 15 Jan 2021 14:00:11 +0000 (15:00 +0100)] 
ipcs: Avoid shmall overflows

Avoid computing the number of bytes in shmall, by only
computing and printing the number of Kbytes. This avoids
some overflows, e.g.

$ echo "4503599627370496" > /proc/sys/kernel/shmall
$ ipcs -l | grep 'max total shared memory'
Before:
max total shared memory (kbytes) = 18014398509481980
After:
max total shared memory (kbytes) = 18014398509481984

$ echo "99993599627370500" > /proc/sys/kernel/shmall
99993599627370500
$ ipcs -l | grep 'max total shared memory'
Before:
max total shared memory (kbytes) = 18014398509481980
After:
max total shared memory (kbytes) = 399974398509482000

v1->v2:
  Print the non-overflow KB value only for IPC_UNIT_KB and
IPC_UNIT_DEFAULT.
  This way --bytes and --human options will still get an expected
output
  (but not avoiding the overflow).

Signed-off-by: Vasilis Liaskovitis <vliaskovitis@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agofindmnt: add option to list all fs-independent flags
Roberto Bergantinos Corpas [Tue, 12 Jan 2021 10:58:53 +0000 (11:58 +0100)] 
findmnt: add option to list all fs-independent flags

It might be useful for security auditing purposes list all possible
mount flags/options including default set which are normally not listed.

This patch adds "--vfs-all" option to list all fs-independent flags
on VFS-OPTIONS column, as well as libmount funcionality to accomplish
it.

i.e.:

$ findmnt -o VFS-OPTIONS
VFS-OPTIONS
rw,relatime
rw,nosuid,nodev,noexec,relatime
rw,nosuid,nodev,noexec,relatime
ro,nosuid,nodev,noexec
...

$ findmnt --vfs-all -o VFS-OPTIONS
VFS-OPTIONS
rw,exec,suid,dev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
rw,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
rw,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
ro,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,norelatime,nostrictatime,nolazytime,symfollow
...

[kzak@redhat.com: - cleanup coding style and comments]

Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: do not canonicalize ZFS source dataset
Karel Zak [Thu, 14 Jan 2021 11:45:28 +0000 (12:45 +0100)] 
libmount: do not canonicalize ZFS source dataset

Fixes: https://github.com/karelzak/util-linux/issues/1231
Addresses: https://github.com/systemd/systemd/issues/18188
Addresses: https://github.com/openzfs/zfs/pull/11295
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib/selinux-utils: tiny cleanup
Karel Zak [Wed, 13 Jan 2021 14:04:02 +0000 (15:04 +0100)] 
lib/selinux-utils: tiny cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agomkswap: remove deprecated SELinux matchpathcon()
Karel Zak [Wed, 13 Jan 2021 13:58:43 +0000 (14:58 +0100)] 
mkswap: remove deprecated SELinux matchpathcon()

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agochfs-chfn: remove deprecated selinux_check_passwd_access()
Karel Zak [Wed, 13 Jan 2021 13:25:12 +0000 (14:25 +0100)] 
chfs-chfn: remove deprecated selinux_check_passwd_access()

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib/selinux-utils: cleanup function names
Karel Zak [Wed, 13 Jan 2021 12:33:41 +0000 (13:33 +0100)] 
lib/selinux-utils: cleanup function names

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: move selinux_utils.c
Karel Zak [Wed, 13 Jan 2021 12:30:31 +0000 (13:30 +0100)] 
build-sys: move selinux_utils.c

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: remove fallback for security_context_t
Karel Zak [Wed, 13 Jan 2021 12:12:19 +0000 (13:12 +0100)] 
build-sys: remove fallback for security_context_t

It seems like overkill to provide this #ifdef. For example coreutils
use "char *" for all selinux contexts (since 2014).

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibblkid: fix comment block
Karel Zak [Wed, 13 Jan 2021 10:00:34 +0000 (11:00 +0100)] 
libblkid: fix comment block

The command block with /** triggers gtkdoc; don't use it for regular
comments.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'autoconf-2.70' of https://github.com/kerolasa/util-linux
Karel Zak [Tue, 12 Jan 2021 10:53:36 +0000 (11:53 +0100)] 
Merge branch 'autoconf-2.70' of https://github.com/kerolasa/util-linux

* 'autoconf-2.70' of https://github.com/kerolasa/util-linux:
  build-sys: silence non-POSIX variable name warning
  build-sys: update to autoconf 2.70

4 years agolib/loopdev: make is_loopdev() more robust
Karel Zak [Tue, 12 Jan 2021 10:43:31 +0000 (11:43 +0100)] 
lib/loopdev: make is_loopdev() more robust

It seems the current kernel can create a loop devices with a different
major number. For example

  # losetup /dev/loop12345678 file.img
  # lsblk /dev/loop12345678
  NAME          MAJ:MIN    RM SIZE RO TYPE MOUNTPOINT
  loop12345678   15:811342  0   5M  0 loop

We need a way how to verify the device is loopdev also when the device is
not associated with any backing file -- in this case there is no "loop"
directory in /sys/dev/block/<maj:min>/, but we can cannonicalize this sysfs
symlink as it points to /sys/devices/virtual/block/loop<n> (see "loop" in
the path).

Note that without this change losetup is not able to list and delete
the loop device.

Addresses: https://github.com/karelzak/util-linux/issues/1202
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: silence non-POSIX variable name warning
Sami Kerola [Thu, 24 Dec 2020 20:22:59 +0000 (20:22 +0000)] 
build-sys: silence non-POSIX variable name warning

Easiest way to get rid of the following warning is to ignore the warning.
This might cause people who use non-GNU make to have hard time, but are
there such people compiling this project?

sys-utils/Makemodule.am:226: warning: addprefix sys-utils/,$(SETARCH_LINKS: non-POSIX variable name
sys-utils/Makemodule.am:226: (probably a GNU make extension)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agobuild-sys: update to autoconf 2.70
Sami Kerola [Thu, 24 Dec 2020 11:12:14 +0000 (11:12 +0000)] 
build-sys: update to autoconf 2.70

Reference: https://lwn.net/Articles/839395/
Reviewed-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agolibblkid: make gfs2 prober more extendible
Karel Zak [Mon, 11 Jan 2021 10:58:16 +0000 (11:58 +0100)] 
libblkid: make gfs2 prober more extendible

The current GFS2 prober hard codes superblock constants, but these
constants are affected by GFS2 development.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1913844
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsblk: use MOUNTTARGETS in default output
Karel Zak [Mon, 11 Jan 2021 09:46:16 +0000 (10:46 +0100)] 
lsblk: use MOUNTTARGETS in default output

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibfdisk: (script) ignore empty values for start and size
Gaël PORTAY [Sat, 9 Jan 2021 10:03:34 +0000 (05:03 -0500)] 
libfdisk: (script) ignore empty values for start and size

Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
4 years agolsblk: use MOUNTPOINTS in --fs
Karel Zak [Fri, 8 Jan 2021 12:45:14 +0000 (13:45 +0100)] 
lsblk: use MOUNTPOINTS in --fs

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsblk: add FSROOTS column
Karel Zak [Fri, 8 Jan 2021 12:33:30 +0000 (13:33 +0100)] 
lsblk: add FSROOTS column

It displays filesystem root attached to system, for example
btrfs with two mounted subvolumes:

$ lsblk -oNAME,SIZE,MOUNTPOINTS,FSROOTS /dev/sdc1
NAME SIZE MOUNTPOINTS FSROOTS
sdc1  50M /mnt/A      /foo
  /mnt/B      /bar

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsblk: print all device mountpoints
Karel Zak [Fri, 8 Jan 2021 12:20:50 +0000 (13:20 +0100)] 
lsblk: print all device mountpoints

* add libmount FS to struct lsblk_device

* add new column MOUNTPOINTS (pl.) with multi-line cells to display
  all mountpoints relevant for the device

* the old MOUNTPOINT is backwardly compatible and it (usually) displays the
  last device mountpoint from /proc/self/mountinfo

For example btrfs with more subvolumes:

 $ lsblk -o+MOUNTPOINTS /dev/sdc1
 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT MOUNTPOINTS
 sdc1   8:33   0  50M  0 part /mnt/test  /mnt/A
                                         /mnt/test
                                         /mnt/B

Note, in this case MOUNTPOINT displays mount point where is mounted
root of the filesystem.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibsmartcols: support arrays for JSON output
Karel Zak [Fri, 8 Jan 2021 12:12:57 +0000 (13:12 +0100)] 
libsmartcols: support arrays for JSON output

This patch add support to format multi-line cells (columns with
SCOLS_FL_WRAP) to arrays in JSON output.

For example mountpoints[] in lsblk output:

Normal output:
 $ lsblk -oNAME,FSTYPE,TYPE,MOUNTPOINTS /dev/sdc1
 NAME FSTYPE TYPE MOUNTPOINTS
 sdc1 btrfs  part /mnt/A
  /mnt/test
  /mnt/B

JSON output:
$ lsblk -J -oNAME,FSTYPE,TYPE,MOUNTPOINTS /dev/sdc1
{
   "blockdevices": [
      {
 "name": "sdc1",
 "fstype": "btrfs",
 "type": "part",
 "mountpoints": [
     "/mnt/A",
     "/mnt/test",
     "/mnt/B"
 ]
      }
   ]
}

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: mark entries from /proc/swaps by MNT_FS_SWAP
Karel Zak [Fri, 8 Jan 2021 11:00:59 +0000 (12:00 +0100)] 
libmount: mark entries from /proc/swaps by MNT_FS_SWAP

The function mnt_fs_is_swaparea() does not return TRUE for entries
from /proc/swaps. This is pretty strange.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'getopt-musl' of https://github.com/sgn/util-linux
Karel Zak [Thu, 7 Jan 2021 11:09:57 +0000 (12:09 +0100)] 
Merge branch 'getopt-musl' of https://github.com/sgn/util-linux

* 'getopt-musl' of https://github.com/sgn/util-linux:
  getopt: explicitly ask for POSIX mode on POSIXLY_CORRECT

4 years agodocs: update TODO (add item about mnt_context_get_excode() )
Karel Zak [Wed, 6 Jan 2021 14:17:19 +0000 (15:17 +0100)] 
docs: update TODO (add item about mnt_context_get_excode() )

- add item about https://github.com/karelzak/util-linux/issues/1208
- remove old CAP_SYS_ADMIN note (in last versions mount(8) drops suid if
  necessary).

Addresses: https://github.com/karelzak/util-linux/issues/1208
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogetopt: explicitly ask for POSIX mode on POSIXLY_CORRECT
Đoàn Trần Công Danh [Tue, 5 Jan 2021 13:55:46 +0000 (20:55 +0700)] 
getopt: explicitly ask for POSIX mode on POSIXLY_CORRECT

GNU libc's getopt_long(3) have the tradition of not shuffling arguments
to find options when either POSIXLY_CORRECT is defined in environment
variables or '+' prepended in short options. Hence, the current code
base is fine as is fine as is for util-linux built with GNU libc.

However, musl libc only honour POSIX convention when short options
prepended with '+'. musl libc doesn't care about POSIXLY_CORRECT.
Thus, the behaviour of util-linux's getopt(1) that linked with musl-libc
doesn't match with its own documentation.

Let's make sure a '+' is always prepended to short options if
POSIXLY_CORRECT is defined.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
4 years agodocs: update TODO file (add item about libblkid ZFS)
Karel Zak [Wed, 6 Jan 2021 11:45:18 +0000 (12:45 +0100)] 
docs: update TODO file (add item about libblkid ZFS)

Addresses: https://github.com/karelzak/util-linux/issues/1228
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoRevert "fallocate: (man) add hint about off/len limitations"
Karel Zak [Wed, 6 Jan 2021 11:05:50 +0000 (12:05 +0100)] 
Revert "fallocate: (man) add hint about off/len limitations"

This reverts commit b2db5a71b5c37dea3f1d5780664fdce317389d18.

We already have this note in the man page. Don't duplicate it.

4 years agotests: update swaplabel.err
Karel Zak [Wed, 6 Jan 2021 10:13:15 +0000 (11:13 +0100)] 
tests: update swaplabel.err

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch '2020wk47' of https://github.com/kerolasa/util-linux
Karel Zak [Tue, 5 Jan 2021 14:20:50 +0000 (15:20 +0100)] 
Merge branch '2020wk47' of https://github.com/kerolasa/util-linux

* '2020wk47' of https://github.com/kerolasa/util-linux:
  build-sys: sort various lists in configure.ac
  mkswap: tell how to fix insecure permissions and owner in warning
  lsipc: make default output byte sizes to be in human units
  man: add missing backslash to caret printing macro
  lscpu: fix variable shadowing
  uuidgen: give hint in usage() what uuid namepaces can be used
  uuidgen: use errx() rather than fprintf() when priting errors
  libuuid: simplify uuid_is_null() check
  uuidparse: use uuid type definitions from libuuid header
  uuidparse: use libuuid function to test nil uuid

4 years agocfdisk: (man) add info when cfdisk writes to the device
Karel Zak [Tue, 5 Jan 2021 13:43:01 +0000 (14:43 +0100)] 
cfdisk: (man) add info when cfdisk writes to the device

This is difference between (c)fdisk and GNU Parted, fdisks keep all
changes in memory until user explicitly ask for write operation.

Addresses: https://github.com/karelzak/util-linux/pull/1227
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'disk-utils-document-resize' of https://github.com/vdmz/util-linux
Karel Zak [Tue, 5 Jan 2021 13:32:22 +0000 (14:32 +0100)] 
Merge branch 'disk-utils-document-resize' of https://github.com/vdmz/util-linux

4 years agosys-utils: mount.8: fix a typo
Eric Biggers [Thu, 31 Dec 2020 04:05:57 +0000 (20:05 -0800)] 
sys-utils: mount.8: fix a typo

It should be "inode", not "i-node".

Signed-off-by: Eric Biggers <ebiggers@google.com>
4 years agofstab.5: NTFS and FAT volume IDs use upper case
Heinrich Schuchardt [Thu, 31 Dec 2020 00:32:54 +0000 (01:32 +0100)] 
fstab.5: NTFS and FAT volume IDs use upper case

The man-page indicates that mount expects UUIDs to be lower case.

Mention that NTFS and FAT volume IDs are to be specified in upper case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocfdisk: show Q option when choosing label type
Chris Hofstaedtler [Mon, 28 Dec 2020 00:02:33 +0000 (00:02 +0000)] 
cfdisk: show Q option when choosing label type

The new message is quite terse, but fits into 78 characters.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894555
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
4 years agoMerge branch 'ia64-cramfs' of https://github.com/mator/util-linux
Karel Zak [Tue, 5 Jan 2021 11:37:23 +0000 (12:37 +0100)] 
Merge branch 'ia64-cramfs' of https://github.com/mator/util-linux

* 'ia64-cramfs' of https://github.com/mator/util-linux:
  tests: add checksum for cramfs/mkfs for LE:16384 (ia64)

4 years agoMerge branch 'optimal-33553920' of https://github.com/rfinnie/util-linux
Karel Zak [Mon, 4 Jan 2021 12:52:55 +0000 (13:52 +0100)] 
Merge branch 'optimal-33553920' of https://github.com/rfinnie/util-linux

* 'optimal-33553920' of https://github.com/rfinnie/util-linux:
  libfdisk: ignore 33553920 byte optimal I/O size

4 years agoMerge branch 'spelling' of https://github.com/scop/util-linux
Karel Zak [Mon, 4 Jan 2021 12:42:08 +0000 (13:42 +0100)] 
Merge branch 'spelling' of https://github.com/scop/util-linux

* 'spelling' of https://github.com/scop/util-linux:
  *: spelling and grammar fixes

4 years agoMerge branch 'posix-test-command' of https://github.com/concatime/util-linux
Karel Zak [Mon, 4 Jan 2021 12:22:54 +0000 (13:22 +0100)] 
Merge branch 'posix-test-command' of https://github.com/concatime/util-linux

* 'posix-test-command' of https://github.com/concatime/util-linux:
  configure: test -a|o is not POSIX

4 years agocfdisk: Implemented cfdisk's opening in read-only mode
Dmitriy Chestnykh [Mon, 4 Jan 2021 11:17:57 +0000 (12:17 +0100)] 
cfdisk: Implemented cfdisk's opening in read-only mode

[kzak@redhat.com: - clean up the patch
                  - add note "Changes will remain in memory only."]

Addresses: https://github.com/karelzak/util-linux/issues/1209
Addresses: https://github.com/karelzak/util-linux/pull/1213
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agofallocate: (man) add hint about off/len limitations
Karel Zak [Mon, 4 Jan 2021 09:50:24 +0000 (10:50 +0100)] 
fallocate: (man) add hint about off/len limitations

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoShow the 'r' option in the help menu
Vincent McIntyre [Sat, 2 Jan 2021 00:02:35 +0000 (11:02 +1100)] 
Show the 'r' option in the help menu

4 years agoManual pages: document the 'resize' command
Vincent McIntyre [Fri, 1 Jan 2021 02:37:52 +0000 (13:37 +1100)] 
Manual pages: document the 'resize' command

Reported in https://bugs.debian.org/906918, https://bugs.debian.org/915971.

Signed-off-by: Vincent McIntyre <vincent.mcintyre@csiro.au>
4 years agobuild-sys: sort various lists in configure.ac
Sami Kerola [Tue, 1 Dec 2020 21:13:00 +0000 (21:13 +0000)] 
build-sys: sort various lists in configure.ac

And convert spaces to tabs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agomkswap: tell how to fix insecure permissions and owner in warning
Sami Kerola [Sat, 28 Nov 2020 23:02:58 +0000 (23:02 +0000)] 
mkswap: tell how to fix insecure permissions and owner in warning

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agolsipc: make default output byte sizes to be in human units
Sami Kerola [Sat, 28 Nov 2020 16:29:09 +0000 (16:29 +0000)] 
lsipc: make default output byte sizes to be in human units

Recent request to make ipcs(1) list sizes in human format caused the
observation lsipc(1) is not doing that either.  This commit changes sizes to
human format, assuming --bytes option is not used.

Reference: https://github.com/karelzak/util-linux/issues/1199
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agoman: add missing backslash to caret printing macro
Sami Kerola [Wed, 25 Nov 2020 22:22:21 +0000 (22:22 +0000)] 
man: add missing backslash to caret printing macro

Fixes: 3ea54b843cb63738404a475f43cfc461aa9b57f3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agolscpu: fix variable shadowing
Sami Kerola [Thu, 26 Nov 2020 16:54:50 +0000 (16:54 +0000)] 
lscpu: fix variable shadowing

    sys-utils/lscpu-virt.c: In function ‘lscpu_read_virtualization’:
    sys-utils/lscpu-virt.c:574:9: warning: declaration of ‘buf’ shadows a previous local [-Wshadow]
      574 |    char buf[256];
          |         ^~~
    sys-utils/lscpu-virt.c:506:7: note: shadowed declaration is here
      506 |  char buf[BUFSIZ];
          |       ^~~

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agouuidgen: give hint in usage() what uuid namepaces can be used
Sami Kerola [Sun, 22 Nov 2020 22:40:45 +0000 (22:40 +0000)] 
uuidgen: give hint in usage() what uuid namepaces can be used

Also fix --help and --version alignment.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agouuidgen: use errx() rather than fprintf() when priting errors
Sami Kerola [Sun, 22 Nov 2020 22:27:24 +0000 (22:27 +0000)] 
uuidgen: use errx() rather than fprintf() when priting errors

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agolibuuid: simplify uuid_is_null() check
Sami Kerola [Sun, 22 Nov 2020 21:07:23 +0000 (21:07 +0000)] 
libuuid: simplify uuid_is_null() check

There is no need to check uuid byte by byte.  Also by using size of the uuid
type magic constant can be avoided.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agouuidparse: use uuid type definitions from libuuid header
Sami Kerola [Sun, 22 Nov 2020 20:48:38 +0000 (20:48 +0000)] 
uuidparse: use uuid type definitions from libuuid header

While on it add missing UUID_TYPE_DCE_NIL to the header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agouuidparse: use libuuid function to test nil uuid
Sami Kerola [Sun, 22 Nov 2020 20:46:40 +0000 (20:46 +0000)] 
uuidparse: use libuuid function to test nil uuid

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agolibfdisk: ignore 33553920 byte optimal I/O size
Ryan Finnie [Sun, 27 Dec 2020 18:01:26 +0000 (10:01 -0800)] 
libfdisk: ignore 33553920 byte optimal I/O size

33553920 byte optimal I/O size arises from badly-implemented USB SATA
adapters reporting 0xffff 512 byte sectors (32 MiB - 512).  Commit
acb7651f8897ae73d0f45dd75bc87630001c61b9 indirectly addresses this by
ignoring the optimal I/O size if it's not a multiple of the physical
sector size.  That works if the physical sector size is 4096, but
33553920 optimal is allowed for 512 physical.

This commit explicitly ignores 33553920, as there is no legitimate
situation where this number would be the real optimal I/O size.

Signed-off-by: Ryan Finnie <ryan@finnie.org>
Closes: https://github.com/karelzak/util-linux/issues/1221
4 years agotests: add checksum for cramfs/mkfs for LE:16384 (ia64)
Anatoly Pugachev [Sat, 19 Dec 2020 18:36:00 +0000 (21:36 +0300)] 
tests: add checksum for cramfs/mkfs for LE:16384 (ia64)

Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
4 years ago*: spelling and grammar fixes
Ville Skyttä [Thu, 17 Dec 2020 21:39:05 +0000 (23:39 +0200)] 
*: spelling and grammar fixes

4 years agolib: fix compiler warnings [-Wmaybe-uninitialized]
Karel Zak [Thu, 17 Dec 2020 10:07:38 +0000 (11:07 +0100)] 
lib: fix compiler warnings [-Wmaybe-uninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: fix compiler warnings [-Wmaybe-uninitialized]
Karel Zak [Thu, 17 Dec 2020 10:07:25 +0000 (11:07 +0100)] 
libmount: fix compiler warnings [-Wmaybe-uninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: suggest "make check-programs"
Karel Zak [Thu, 17 Dec 2020 09:57:33 +0000 (10:57 +0100)] 
tests: suggest "make check-programs"

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoconfigure: test -a|o is not POSIX
Issam E. Maghni [Thu, 17 Dec 2020 00:16:11 +0000 (19:16 -0500)] 
configure: test -a|o is not POSIX

4 years agolscpu: remove unnecessary prefix from static function
Karel Zak [Tue, 15 Dec 2020 10:31:57 +0000 (11:31 +0100)] 
lscpu: remove unnecessary prefix from static function

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoscriptlive: fix compiler warnings [-Wmaybe-uninitialized]
Karel Zak [Mon, 14 Dec 2020 14:56:55 +0000 (15:56 +0100)] 
scriptlive: fix compiler warnings [-Wmaybe-uninitialized]

term-utils/scriptlive.c: In function 'process_next_step':
term-utils/scriptlive.c:125:4: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
term-utils/scriptlive.c:122:19: note: 'now.tv_usec' was declared here
term-utils/scriptlive.c:125:4: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
term-utils/scriptlive.c:122:19: note: 'now.tv_sec' was declared here

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoscript: fix compiler warnings [-Wmaybe-uninitialized]
Karel Zak [Mon, 14 Dec 2020 14:56:55 +0000 (15:56 +0100)] 
script: fix compiler warnings [-Wmaybe-uninitialized]

term-utils/script.c: In function 'log_close.part.0.isra':
term-utils/script.c:306:3: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
term-utils/script.c:303:18: note: 'now.tv_usec' was declared here
term-utils/script.c:306:3: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
term-utils/script.c:303:18: note: 'now.tv_sec' was declared here

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