]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
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>
4 years agohwclock: fix compiler warnings [-Wmaybe-uninitialized]
Karel Zak [Mon, 14 Dec 2020 14:56:55 +0000 (15:56 +0100)] 
hwclock: fix compiler warnings [-Wmaybe-uninitialized]

sys-utils/hwclock-rtc.c: In function 'synchronize_to_clock_tick_rtc':
sys-utils/hwclock.c:169:28: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/hwclock-rtc.c:215:24: note: 'now.tv_usec' was declared here
sys-utils/hwclock.c:168:28: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/hwclock-rtc.c:215:24: note: 'now.tv_sec' was declared here
sys-utils/hwclock.c:169:28: warning: 'begin.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/hwclock-rtc.c:215:17: note: 'begin.tv_usec' was declared here
sys-utils/hwclock.c:168:28: warning: 'begin.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/hwclock-rtc.c:215:17: note: 'begin.tv_sec' was declared here

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

sys-utils/blkdiscard.c: In function 'main':
sys-utils/blkdiscard.c:304:33: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/blkdiscard.c:152:17: note: 'now.tv_usec' was declared here
sys-utils/blkdiscard.c:305:37: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/blkdiscard.c:152:17: note: 'now.tv_sec' was declared here
sys-utils/blkdiscard.c:304:33: warning: 'last.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/blkdiscard.c:152:22: note: 'last.tv_usec' was declared here
sys-utils/blkdiscard.c:305:65: warning: 'last.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
sys-utils/blkdiscard.c:152:22: note: 'last.tv_sec' was declared here

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agomkswap: don't use deprecated security_context_t
Karel Zak [Mon, 14 Dec 2020 14:44:59 +0000 (15:44 +0100)] 
mkswap: don't use deprecated security_context_t

libselinux >= 3.1 makes security_context_t type deprecated. Let's
ifdef it to avoid unwanted warnings.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agologin-utils: don't use deprecated security_context_t
Karel Zak [Mon, 14 Dec 2020 14:44:59 +0000 (15:44 +0100)] 
login-utils: don't use deprecated security_context_t

libselinux >= 3.1 makes security_context_t type deprecated. Let's
ifdef it to avoid unwanted warnings.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: don't use deprecated security_context_t
Karel Zak [Mon, 14 Dec 2020 14:44:59 +0000 (15:44 +0100)] 
libmount: don't use deprecated security_context_t

libselinux >= 3.1 makes security_context_t type deprecated. Let's
ifdef it to avoid unwanted warnings.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: check for libselinux >= 3.1
Karel Zak [Mon, 14 Dec 2020 14:44:38 +0000 (15:44 +0100)] 
build-sys: check for libselinux >= 3.1

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: update blkid output for iso/udf
Karel Zak [Mon, 14 Dec 2020 12:42:01 +0000 (13:42 +0100)] 
tests: update blkid output for iso/udf

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsblk: read SCSI_IDENT_SERIAL also from udev
Karel Zak [Mon, 14 Dec 2020 10:38:04 +0000 (11:38 +0100)] 
lsblk: read SCSI_IDENT_SERIAL also from udev

Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoblkid: add another UDF identifiers
Karel Zak [Fri, 11 Dec 2020 09:02:22 +0000 (10:02 +0100)] 
blkid: add another UDF identifiers

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoblkid: encode all udf and iso IDs in udev output
Karel Zak [Thu, 10 Dec 2020 11:10:06 +0000 (12:10 +0100)] 
blkid: encode all udf and iso IDs in udev output

We encode to "safe" strings almost all variables for 'blkid -o udev'
and we need it also for SYSTEM_ID, PUBLISHER_ID, APPLICATION_ID,
BOOT_SYSTEM_ID and recently added VOLUME_SET_ID and DATA_PREPARER_ID.

This change makes blkid from util-linux more compatible with built-in
udevd blkid.

Addresses: https://github.com/karelzak/util-linux/pull/1215 (commit 5cbffdb74f6fec51b2cf260bea66375823fe65e7)
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibblkid: iso9660: add new test images
Pali Rohár [Thu, 10 Dec 2020 01:38:06 +0000 (02:38 +0100)] 
libblkid: iso9660: add new test images

Image iso-different-iso-joliet-label contains different identifiers in ISO
and Joliet locations. Identifiers are prefixed with "ISO" or "Joliet"
string to verify that UNICODE Joliet has preference over ASCII ISO.

Image iso-unicode-long-label contains very long identifiers in ISO location
which do not fit into the Joliet location. In ISO location is UNICODE
character 'ï' replaced by '_' and unrepresentable spaces also by '_'.
This test verifies that libblkid can use first half of identifiers from
Joliet (which contains UNICODE) and second half from ISO which is just
uppercase and only small subset of ASCII. This image was generated by Nero
Linux software and basically this truncate and '_' replacement is done by
default for any long or UNICODE label.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: add support for VOLUME_SET_ID and DATA_PREPARER_ID
Pali Rohár [Thu, 10 Dec 2020 00:52:18 +0000 (01:52 +0100)] 
libblkid: iso9660: add support for VOLUME_SET_ID and DATA_PREPARER_ID

udf superblock code already sets VOLUME_SET_ID to Volume Set Identifier
from UDF Primary Volume Descriptor.

In iso9660 similar meaning has Volume Set Identifier in ISO9660
Primary (or Supplementary Joliet) Volume Descriptor. Therefore exports it
as VOLUME_SET_ID label.

In ISO9660 Primary (and Supplementary Joliet) Volume Descriptor exists
another member Data Preparer Identifier which is currently not parsed by
iso9660 superblock code.

To have iso9660 superblock code feature complete export also Data Preparer
Identifier as DATA_PREPARER_ID label. UDF does not have equivalent of Data
Preparer Identifier.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: parse SYSTEM_ID, PUBLISHER_ID and APPLICATION_ID from Joliet
Pali Rohár [Thu, 10 Dec 2020 00:43:46 +0000 (01:43 +0100)] 
libblkid: iso9660: parse SYSTEM_ID, PUBLISHER_ID and APPLICATION_ID from Joliet

Joliet may contain UNICODE variant of these identifiers. So prefer UNICODE
variant from Joliet over ASCII variant if Joliet one is available.

Also use same technique as for Label for reconstructing original UNICODE
variants of these identifiers.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: improve label parsing
Pali Rohár [Wed, 9 Dec 2020 23:21:55 +0000 (00:21 +0100)] 
libblkid: iso9660: improve label parsing

Label in Joliet is UNICODE (UTF16BE) but can contain only 16 characters.
Label in PVD is subset of ASCII but can contain up to the 32 characters.
Non-representable characters are stored as replacement character '_'.

Label in Joliet is in most cases trimmed but UNICODE version of label in
PVD. Based on these facts try to reconstruct original label if label in
Joliet is prefix of the label in PVD (ignoring non-representable
characters).

It is possible that label in Joliet and PVD are totally different. In this
case label from Joliet as prior this change.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: fix parsing images which do not have Primary Volume Descriptor...
Pali Rohár [Wed, 9 Dec 2020 00:22:28 +0000 (01:22 +0100)] 
libblkid: iso9660: fix parsing images which do not have Primary Volume Descriptor as the first

ECMA 119 (ISO 9660) does not mandate that Primary Volume Descriptor needs
to be the first in Volume Descriptor Set sequence.

Move assignment of labels outside of the for-loop and correctly detects
Primary Volume Descriptor via its type (0x01) at any position in sequence.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: set block size also for High Sierra format
Pali Rohár [Wed, 9 Dec 2020 00:22:10 +0000 (01:22 +0100)] 
libblkid: iso9660: set block size also for High Sierra format

High Sierra format has also block size 2048.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: check that iso->publisher_id and iso->application_id are not file...
Pali Rohár [Tue, 8 Dec 2020 23:36:13 +0000 (00:36 +0100)] 
libblkid: iso9660: check that iso->publisher_id and iso->application_id are not file paths

ECMA 119 (ISO 9660) says that if the first byte is set to (5F), the
remaining bytes of this field shall specify an identifier for a file
containing the data. As libblkid does not support reading files from the
filesystem itself it cannot parse fields which starts with 0x5F '_' char.

So for now ignore iso->publisher_id and iso->application_id values which
starts with '_' character.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: iso9660: do not check is_str_empty() for iso->system_id and boot->boot_syst...
Pali Rohár [Tue, 8 Dec 2020 23:34:23 +0000 (00:34 +0100)] 
libblkid: iso9660: do not check is_str_empty() for iso->system_id and boot->boot_system_id

ECMA 119 (ISO 9660) does not say anything if all bytes are of these fields
are FILLER then fields are not set. It says it for iso->publisher_id and
iso->application_id.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agotests: (fileutils) remove unused code
Karel Zak [Tue, 8 Dec 2020 12:09:10 +0000 (13:09 +0100)] 
tests: (fileutils) remove unused code

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: (blkid) add erofs image
Karel Zak [Tue, 8 Dec 2020 09:52:20 +0000 (10:52 +0100)] 
tests: (blkid) add erofs image

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibblkid: add erofs filesystem support
Gao Xiang [Sat, 5 Dec 2020 07:44:10 +0000 (15:44 +0800)] 
libblkid: add erofs filesystem support

Enhanced Read-Only File System (EROFS) has been included in Linux
kernel, many Linux distributions, buildroot and Android AOSP for
a while. Plus, nowadays, it's known that EROFS has been commercially
used by several Android vendors for their system partitions.
util-linux in busybox can also detect it recently.

This patch adds support for detecting EROFS filesystem to libblkid.

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
4 years agoMerge branch 'master' of https://github.com/pali/util-linux into master
Karel Zak [Mon, 7 Dec 2020 12:44:25 +0000 (13:44 +0100)] 
Merge branch 'master' of https://github.com/pali/util-linux into master

* 'master' of https://github.com/pali/util-linux:
  libblkid: udf: update test output for APPLICATION_ID and PUBLISHER_ID
  libblkid: udf: add support for PUBLISHER_ID
  libblkid: udf: add support for APPLICATION_ID
  libblkid: udf: check that dstrings are encoded in OSTA Compressed Unicode

4 years agoMerge branch 'fix/losetup-printf' of https://github.com/bahnwaerter/util-linux into...
Karel Zak [Mon, 7 Dec 2020 12:37:41 +0000 (13:37 +0100)] 
Merge branch 'fix/losetup-printf' of https://github.com/bahnwaerter/util-linux into master

* 'fix/losetup-printf' of https://github.com/bahnwaerter/util-linux:
  losetup: fix wrong printf() format specifier for ino_t data type

4 years agologin: fix compiler warning [-Werror=strict-prototypes]
Karel Zak [Mon, 7 Dec 2020 12:26:33 +0000 (13:26 +0100)] 
login: fix compiler warning [-Werror=strict-prototypes]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolosetup: fix wrong printf() format specifier for ino_t data type
Manuel Bentele [Sat, 5 Dec 2020 22:51:27 +0000 (23:51 +0100)] 
losetup: fix wrong printf() format specifier for ino_t data type

Since the range of the ino_t data type is platform-specific (depending on
the wordsize), a usage of the fixed format specifier %PRIu64 is not correct
for ino_t on some 32-bit architectures, eg. ARM (Raspberry Pi 1). This issue
may lead to undefinied output and is not reported by gcc (in version 10.2.0
and 8.3.0-6+rpi1) even though -Wformat is enabled by -Wall. Therefore it is
most likely that it seems to be a false negative error in gcc's format
specifier check, so that this issue was never detected before.

This change fixes the issue by the use of a cast, since there is no
platform-independent format specifier for ino_t available. The wrong format
specifier %PRIu64 is replaced by %ju, where its corresponding variable of
type ino_t is casted to uintmax_t. The type uintmax_t represents the largest
platform-specific unsigned integer, so that all integer values are preserved
for a platform-independent printing.

Fixes: https://github.com/karelzak/util-linux/issues/1211
Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
4 years agolibblkid: udf: update test output for APPLICATION_ID and PUBLISHER_ID
Pali Rohár [Sat, 5 Dec 2020 20:10:23 +0000 (21:10 +0100)] 
libblkid: udf: update test output for APPLICATION_ID and PUBLISHER_ID

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: udf: add support for PUBLISHER_ID
Pali Rohár [Sat, 5 Dec 2020 19:45:25 +0000 (20:45 +0100)] 
libblkid: udf: add support for PUBLISHER_ID

iso9660 superblock code already sets PUBLISHER_ID to Publisher Identifier
from ISO9660 Supplementary Volume Descriptor.

In udf field LVInfo1 from Implementation Use Volume Descriptor could
contain information such as Owner Name. More UDF generating tools
(e.g. Solaris's labelit or Linux udftools 2.3+) set this field to person
who creating the filesystem therefore its meaning is similar to ISO9660
Publisher Identifier. So for compatibility with iso9660 superblock code
export this field via PUBLISHER_ID label.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: udf: add support for APPLICATION_ID
Pali Rohár [Sat, 5 Dec 2020 19:43:22 +0000 (20:43 +0100)] 
libblkid: udf: add support for APPLICATION_ID

iso9660 superblock code already sets APPLICATION_ID to Application
Identifier from ISO9660 Supplementary Volume Descriptor.

In udf similar meaning has Application Identifier from UDF Primary Volume
Descriptor. Therefore exports it as APPLICATION_ID label.

More tools for generating hybrid ISO+UDF images (e.g. genisoimage, mkisofs
or nero) set Application Identifier in UDF Primary Volume Descriptor to
just empty string. But they set Implementation Identifier in UDF Primary
Volume Descriptor to their tool name.

So if Application Identifier is empty then exports Implementation
Identifier as APPLICATION_ID label.

Please note that Application Identifier and Implementation Identifier are
stored in UDF only in ASCII, not UNICODE.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agolibblkid: udf: check that dstrings are encoded in OSTA Compressed Unicode
Pali Rohár [Sat, 5 Dec 2020 19:39:35 +0000 (20:39 +0100)] 
libblkid: udf: check that dstrings are encoded in OSTA Compressed Unicode

dstring structures are in UL_ENCODE_LATIN1/UL_ENCODE_UTF16BE encodings only
when corresponding desc_charset structures are set to the OSTA Compressed
Unicode. So add missing checks.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
4 years agologin: tidy up manual page
Sami Kerola [Mon, 16 Nov 2020 21:37:29 +0000 (21:37 +0000)] 
login: tidy up manual page

Add defaults to couple logindefs, and generally clean up  manual page a
little bit.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agolib/fileutils: make close_all_fds() to be similar with close_range()
Sami Kerola [Wed, 2 Dec 2020 22:56:16 +0000 (22:56 +0000)] 
lib/fileutils: make close_all_fds() to be similar with close_range()

The util-linux close_all_fds() serves the same purpose as close_range()
that will over time obsolete local implementation completely.  For
upcoming few years it is best to have a fallback that uses same input
arguments as the new system call.  That allows surrounding code and
variables not to be affected by version of mass file descriptor closing
function.

Proposed-by: Karel Zak <kzak@redhat.com>
Reference: https://github.com/karelzak/util-linux/pull/1205#discussion_r534080128
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agologin: use close_range() system call when possible
Sami Kerola [Sat, 14 Nov 2020 12:55:10 +0000 (12:55 +0000)] 
login: use close_range() system call when possible

This system call was added while back, but does not have glibc support yet.
Lets try to use the new facility early on.  The promise in reference link is
that the new call is faster, and works when /proc is not mounted.

Reference: https://lwn.net/Articles/789000/
Reference: https://lwn.net/Articles/789023/
Reference: https://kernelnewbies.org/LinuxChanges#Linux_5.9.New_close_range.28.29_system_call_for_easier_closing_of_file_descriptors
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agologin: move message printing out from main()
Sami Kerola [Sat, 14 Nov 2020 11:32:54 +0000 (11:32 +0000)] 
login: move message printing out from main()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4 years agologin: use xalloc memory allocation helpers everywhere
Sami Kerola [Fri, 13 Nov 2020 23:04:43 +0000 (23:04 +0000)] 
login: use xalloc memory allocation helpers everywhere

Apart two function calls login(1) already used xalloc functions.  If there
was a time when login tried to gracefully handle allocation errors that has
not been true for long time.

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