]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 years agolsblk: remove unncessary parent pointer
Karel Zak [Tue, 16 Oct 2018 12:29:00 +0000 (14:29 +0200)] 
lsblk: remove unncessary parent pointer

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: use real rather than hardcoded parent
Karel Zak [Tue, 16 Oct 2018 12:20:29 +0000 (14:20 +0200)] 
lsblk: use real rather than hardcoded parent

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: use devtree functions
Karel Zak [Tue, 16 Oct 2018 11:39:25 +0000 (13:39 +0200)] 
lsblk: use devtree functions

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add lsblk_device_has_dependence()
Karel Zak [Tue, 16 Oct 2018 11:37:36 +0000 (13:37 +0200)] 
lsblk: add lsblk_device_has_dependence()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: process_one_device() refactoring
Karel Zak [Mon, 15 Oct 2018 14:12:33 +0000 (16:12 +0200)] 
lsblk: process_one_device() refactoring

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add devtree_get_device_or_new()
Karel Zak [Mon, 15 Oct 2018 13:53:33 +0000 (15:53 +0200)] 
lsblk: add devtree_get_device_or_new()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: keep functions names consistent
Karel Zak [Mon, 15 Oct 2018 12:25:15 +0000 (14:25 +0200)] 
lsblk: keep functions names consistent

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: remove unused reset_device()
Karel Zak [Mon, 15 Oct 2018 12:16:32 +0000 (14:16 +0200)] 
lsblk: remove unused reset_device()

Now all is maintained by reference counting ion the devtree.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: fix devtree deallocation
Karel Zak [Mon, 15 Oct 2018 12:14:33 +0000 (14:14 +0200)] 
lsblk: fix devtree deallocation

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: split sysfs reading and scols table filling
Karel Zak [Mon, 15 Oct 2018 11:55:08 +0000 (13:55 +0200)] 
lsblk: split sysfs reading and scols table filling

This change allows read devices from sysfs only once and reuse device
properties if the device is references more than once in the tree
(RAIDs, etc.).

* every device is in the tree only once (tree->devices list)

* iterate_block_devices() reuse already read devices (for example if
  already read for any dependence)

* the smartscols table is build from the final tree

The patch temporary disables dependencies evaluation (in
process_blkdev() to keep the patch small and simple.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: cleanup device reference in the tree
Karel Zak [Mon, 15 Oct 2018 11:53:19 +0000 (13:53 +0200)] 
lsblk: cleanup device reference in the tree

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: remove badly named debug interface name
Karel Zak [Fri, 12 Oct 2018 10:51:03 +0000 (12:51 +0200)] 
lsblk: remove badly named debug interface name

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add basic function to build devices tree
Karel Zak [Fri, 12 Oct 2018 10:50:03 +0000 (12:50 +0200)] 
lsblk: add basic function to build devices tree

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: properly initialize structs
Karel Zak [Fri, 12 Oct 2018 10:48:42 +0000 (12:48 +0200)] 
lsblk: properly initialize structs

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: rename reset_lsblk_device() to reset_device()
Karel Zak [Tue, 9 Oct 2018 10:48:34 +0000 (12:48 +0200)] 
lsblk: rename reset_lsblk_device() to reset_device()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: rename blkdev_cxt to lsblk_device
Karel Zak [Tue, 9 Oct 2018 10:46:28 +0000 (12:46 +0200)] 
lsblk: rename blkdev_cxt to lsblk_device

The patch does not change code logic and semantic -- just rename.

* set_cxt() to set_device()
* struct blkdev_cxt to lsblk_device

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: do not require crypt()
Karel Zak [Thu, 22 Nov 2018 11:53:00 +0000 (12:53 +0100)] 
build-sys: do not require crypt()

The function is necessary only for newgrp and sulogin.

Addresses: https://github.com/karelzak/util-linux/issues/584
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: do not require dirfd()
Karel Zak [Wed, 24 Oct 2018 12:32:29 +0000 (14:32 +0200)] 
build-sys: do not require dirfd()

The dirfd() is required on many places, but it should not be required for
all utils by ./configure.ac.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: improve error message
Karel Zak [Wed, 24 Oct 2018 12:21:15 +0000 (14:21 +0200)] 
build-sys: improve error message

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/timer: add fallback if timer_create() not available
Karel Zak [Wed, 24 Oct 2018 10:28:13 +0000 (12:28 +0200)] 
lib/timer: add fallback if timer_create() not available

* add struct ul_timer as API abstraction to hide differences between
timer_create() and setitimer()

* add setitimer() detection to ./configure.ac

* add fallback code to use setitimer() if timer_create() not available
  (for example on OSX)

Addresses: https://github.com/karelzak/util-linux/issues/584
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: make sure HAVE_TIMER_CREATE defined
Karel Zak [Wed, 24 Oct 2018 10:18:54 +0000 (12:18 +0200)] 
build-sys: make sure HAVE_TIMER_CREATE defined

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoinclude/c: re-add type checking in container_of()
Ruediger Meier [Sun, 2 Dec 2018 18:23:45 +0000 (19:23 +0100)] 
include/c: re-add type checking in container_of()

This reverts parts of commit eb06d5d4, which seems to be based on
Linux kernel commit c7acec71. Unlike the original kernel patch we did
not add that even stronger type checking by using macro BUILD_BUG_ON_MSG.
So basically we removed a useful warning when compiling such
broken code:

      struct st {
            int a;
            char b;
      };
      struct st t = { .a = 1, .b = 2 };
      struct st *x = container_of(&t.a, struct st, b);
      printf("%p %p\n", (void *)&t, (void *)x);

Moreover we also introduced a new compiler warning for intel/icc:
   "arithmetic on pointer to void or function type"

Let's just revert the update of container_of() because adding a
kernel-like BUILD_BUG_ON_MSG would be too much noise and also
problematic (see kernel commit c03567a8). Also note that the original
problem addressed by the kernel commit seems to be only reproducible
with gcc 4.9, not with any later gcc nor clang,icc. Moreover, currently
we have no such use-case in the UL sources anyways.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agotests: make lsns-netnsid portable
Karel Zak [Fri, 30 Nov 2018 11:24:15 +0000 (12:24 +0100)] 
tests: make lsns-netnsid portable

It seems ip(8) link-show command does not provide link-netnsid in all
cases (versions ?). Let's try to use "ip netns list-id" as fallback.

This commit also add possibility to debug the script by $LOG variable.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: enlarge backing file for fstab-btrfs
Karel Zak [Fri, 30 Nov 2018 11:22:48 +0000 (12:22 +0100)] 
tests: enlarge backing file for fstab-btrfs

It seems the new limit for Btrfs is 47MiB.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/canonicalize: fix typo
Karel Zak [Thu, 29 Nov 2018 12:33:02 +0000 (13:33 +0100)] 
lib/canonicalize: fix typo

Addresses: https://github.com/karelzak/util-linux/commit/8b8277b7a812c04f2288460f3a8d23cdd53ff66d#commitcomment-31491031
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibmount: (fuse) follow only user_id= on umount
Karel Zak [Thu, 15 Nov 2018 11:11:29 +0000 (12:11 +0100)] 
libmount: (fuse) follow only user_id= on umount

The option user= is already handled by evaluate_permissions() and by
classic mount and umount usermount support. It seems we do not need
to duplicate support for user= in is_fuse_usermount().

The option user_id= is fuse specific and it's maintained by
libfuse/kernel in /proc/self/mountinfo. This is feature we need to
support in umount(8).

Addresses: https://github.com/karelzak/util-linux/pull/705
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibmount: Support unmount FUSE mounts
Rian Hunter [Sat, 13 Oct 2018 02:48:47 +0000 (19:48 -0700)] 
libmount: Support unmount FUSE mounts

FUSE mounts don't need an fstab entry to be unmounted.
This checks if a mount is a FUSE mount before checking for
the fstab entry, and if so returns success.

[kzak@redhat.com: - use libmount tools for mount options
                  - use namespace switches
                  - cleanup code

 The requirement is user=<username> or user_id=<uid> in /proc/self/mountinfo
 for fuse filesystem. The logic is the same as for user= mount options, but in
 this case it is not maintained by libmount in userspace, but by fuse FS in kernel.]

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/canonicalize: do restricted canonicalize in a subprocess
Rian Hunter [Sat, 13 Oct 2018 02:45:06 +0000 (19:45 -0700)] 
lib/canonicalize: do restricted canonicalize in a subprocess

Accessing FUSE mounts require suid/sgid (saved uid) to be equal to the
owner of the mount. If mount is running as a setuid process, swapping
creds by only setting the euid/egid isn't enough to change the
suid/sgid as well. We must do a full setuid()/setgid(), but that
removes our ability to re-assume the identity of the original
euid. The solution is swap creds in a child process, preserving the
creds of the parent.

[kzak@redhat.com: - use switch() rather than if() for fork
  - use all-io.h
  - close unused pipe[] ends
  - be more strict about used types]

Addresses: https://github.com/karelzak/util-linux/pull/705
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkid: fix usage()
Karel Zak [Thu, 29 Nov 2018 12:30:11 +0000 (13:30 +0100)] 
blkid: fix usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkid: make PART_ENTRY_* tags optional (add --no-part-details)
Karel Zak [Thu, 29 Nov 2018 12:21:36 +0000 (13:21 +0100)] 
blkid: make PART_ENTRY_* tags optional (add --no-part-details)

blkid(8) returns information from partition table also for empty
partitions. This is necessary for example for udev, but it could be
confusing if you care about on-device content only.

Default:
 # blkid -p /dev/md0p1; echo $?
 /dev/md0p1: PART_ENTRY_SCHEME="dos" PART_ENTRY_UUID="6d8796b1-01" PART_ENTRY_TYPE="0x83" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="204800" PART_ENTRY_DISK="9:0"
 0

With --no-part-details:
 # blkid -p /dev/md0p1 --no-part-details; echo $?
 2

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1653413
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomkswap: fix page size warning message
Noel Cragg [Thu, 29 Nov 2018 10:38:41 +0000 (11:38 +0100)] 
mkswap: fix page size warning message

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)
Carlos Santos [Thu, 22 Nov 2018 15:05:49 +0000 (13:05 -0200)] 
build-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)

Useful for embedded systems, on which only few utilities are required.

[kzak@redhat.com: - rename to --disable-fdisks
                  - use $enable_{c,s,}fdisk in code]

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agouuidd: Add hardening settings to uuidd.service
Andreas Henriksson [Fri, 23 Nov 2018 11:10:59 +0000 (12:10 +0100)] 
uuidd: Add hardening settings to uuidd.service

This limits what the uuid daemon has access to when it runs.

Further improving this with additional option or making
things even tighter is most likely possible.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
5 years agotests: add test images for drbd v08/v09
Roland Kammerer [Thu, 22 Nov 2018 13:42:48 +0000 (14:42 +0100)] 
tests: add test images for drbd v08/v09

This adds DRBD meta data images for DRBD versions 8 and 9, as well as
the according expected output.

Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
5 years agoMerge branch 'master' of https://github.com/nyantec/util-linux
Karel Zak [Thu, 22 Nov 2018 11:04:54 +0000 (12:04 +0100)] 
Merge branch 'master' of https://github.com/nyantec/util-linux

* 'master' of https://github.com/nyantec/util-linux:
  fix a bug where switch_root would erroneously try to parse initargs

5 years agoMerge branch '2018wk41' of https://github.com/kerolasa/util-linux
Karel Zak [Thu, 22 Nov 2018 10:51:00 +0000 (11:51 +0100)] 
Merge branch '2018wk41' of https://github.com/kerolasa/util-linux

* '2018wk41' of https://github.com/kerolasa/util-linux:
  include/c: use returns_nonnull function attribute in xalloc.h

5 years agoMerge branch 'fix-uuid-oids-test' of https://github.com/Whissi/util-linux
Karel Zak [Thu, 22 Nov 2018 10:40:42 +0000 (11:40 +0100)] 
Merge branch 'fix-uuid-oids-test' of https://github.com/Whissi/util-linux

* 'fix-uuid-oids-test' of https://github.com/Whissi/util-linux:
  tests: run oids test only when uuidgen tool was built

5 years agofstrim: Add hardening settings to fstrim.service
Andreas Henriksson [Thu, 22 Nov 2018 10:13:58 +0000 (11:13 +0100)] 
fstrim: Add hardening settings to fstrim.service

This limits what the fstrim process has access to when it runs.

PrivateUsers can't be enabled because of:
"If this mode is enabled, all unit processes are run without privileges
in the host user namespace[...]"

Further improving this with additional option or making
things even tighter is most likely possible.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosetarch: fix obscure sparc32bash use-case
Karel Zak [Thu, 22 Nov 2018 10:03:35 +0000 (11:03 +0100)] 
setarch: fix obscure sparc32bash use-case

Reported-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoinclude/c: use returns_nonnull function attribute in xalloc.h
Sami Kerola [Sat, 6 Oct 2018 11:31:09 +0000 (12:31 +0100)] 
include/c: use returns_nonnull function attribute in xalloc.h

Let the compiler optimize based on the knowledge that the return value will
never be null.

Reference: https://patchwork.ozlabs.org/patch/281112/#631159
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agolibblkid: add check for DRBD9
Roland Kammerer [Tue, 20 Nov 2018 16:10:49 +0000 (17:10 +0100)] 
libblkid: add check for DRBD9

This adds the according meta-data structs + defines and an additional
function to detect DRBD9 magics.

Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
5 years agoagetty: Return old behavior with empty logname
Stanislav Brabec [Mon, 19 Nov 2018 23:38:14 +0000 (00:38 +0100)] 
agetty: Return old behavior with empty logname

c094fcd37 introduced a behavior change: When Return is entered with empty
logname, nothing happens. As it confuses users, return back the old
behavior: re-prompt.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agolibblkid: Fix hidding typo
Andreas Henriksson [Mon, 12 Nov 2018 19:50:23 +0000 (20:50 +0100)] 
libblkid: Fix hidding typo

Spelling error spotted by lintian.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
5 years agofstrim: Add Documentation key to fstrim.service
Andreas Henriksson [Mon, 12 Nov 2018 18:45:51 +0000 (19:45 +0100)] 
fstrim: Add Documentation key to fstrim.service

5 years agouuidd: Add Documentation key to uuidd.service
Andreas Henriksson [Mon, 12 Nov 2018 18:39:45 +0000 (19:39 +0100)] 
uuidd: Add Documentation key to uuidd.service

5 years agofstrim: use long options in systemd service file
Sami Kerola [Sun, 12 Aug 2018 12:56:33 +0000 (13:56 +0100)] 
fstrim: use long options in systemd service file

Long options are more user friendly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agoMerge branch 'master' of github.com:karelzak/util-linux
Paul Asmuth [Mon, 12 Nov 2018 13:22:12 +0000 (14:22 +0100)] 
Merge branch 'master' of github.com:karelzak/util-linux

5 years agofix a bug where switch_root would erroneously try to parse initargs
Paul Asmuth [Fri, 9 Nov 2018 16:02:11 +0000 (17:02 +0100)] 
fix a bug where switch_root would erroneously try to parse initargs

before this change, switch_root would try to parse all arguments,
including 'initargs', using getopt, which would lead to an 'unrecognized
option' error when trying to pass a flag to the init program

5 years agounshare: allow to set user ID and group ID
Laurent Vivier [Fri, 5 Oct 2018 11:09:30 +0000 (13:09 +0200)] 
unshare: allow to set user ID and group ID

This patch introduces two new parameters to set the
user ID and the group ID of the program to be executed.
Setting group ID also drops supplementary groups.

The option names used are the same as for nsenter,
-S, --setuid and -G, --setgid.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agounshare: allow to set a new root
Laurent Vivier [Fri, 5 Oct 2018 11:09:29 +0000 (13:09 +0200)] 
unshare: allow to set a new root

This patch instroduces two new parameters to set the new
root and the new working directory in this new root.

This allows to combine "unshare chroot" in one command,
and doing like this the /proc filesystem is correctly
mounted in the new root with "--mount-proc".

The new parameters are -R, --root and -w, --wd. The names
are the same as for nsenter, except for "-r" that is already
used by "--map-root-user" and replaced by "-R".

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoagetty: fix output of escaped characters
Christian Hesse [Wed, 7 Nov 2018 12:55:06 +0000 (13:55 +0100)] 
agetty: fix output of escaped characters

Signed-off-by: Christian Hesse <mail@eworm.de>
5 years agolibblkid: fix detection of dm-integrity superblock
Milan Broz [Wed, 7 Nov 2018 11:48:37 +0000 (12:48 +0100)] 
libblkid: fix detection of dm-integrity superblock

Some new features in Linux kernel 4.19 for dm-integrity use metadata
format version 2, patch adds it to detection.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
5 years agoagetty: fix portability issues
Samuel Thibault [Mon, 12 Nov 2018 10:31:17 +0000 (11:31 +0100)] 
agetty: fix portability issues

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: run oids test only when uuidgen tool was built
Thomas Deutschmann [Sun, 11 Nov 2018 01:17:55 +0000 (02:17 +0100)] 
tests: run oids test only when uuidgen tool was built

oids test did not check if uuidgen was available.

oids test was also calling uuidgen from PATH which could result
in wrong results if uuidgen from a previous util-linux installation
was used.

With this commit we will check if uuidgen was built and make sure
that we only call the uuidgen binary we just built. If uuidgen is
not available we will skip this test.

5 years agortcwake: use poweroff if shutdown is not found
Justin Chen [Thu, 1 Nov 2018 18:10:38 +0000 (11:10 -0700)] 
rtcwake: use poweroff if shutdown is not found

Some systems do not have the shutdown command. Use poweroff as an
alternative.

Signed-off-by: Justin Chen <justinpopo6@gmail.com>
5 years agobuild-sys: release++ (v2.33) v2.33
Karel Zak [Tue, 6 Nov 2018 11:08:46 +0000 (12:08 +0100)] 
build-sys: release++ (v2.33)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.33-ReleaseNotes
Karel Zak [Tue, 6 Nov 2018 11:06:56 +0000 (12:06 +0100)] 
docs: update v2.33-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Tue, 6 Nov 2018 11:03:34 +0000 (12:03 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Tue, 6 Nov 2018 11:00:00 +0000 (12:00 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update uk.po (from translationproject.org)

5 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update pt_BR.po (from translationproject.org)

5 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update pl.po (from translationproject.org)

5 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update ja.po (from translationproject.org)

5 years agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update fr.po (from translationproject.org)

5 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update es.po (from translationproject.org)

5 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update cs.po (from translationproject.org)

5 years agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Tue, 6 Nov 2018 09:56:03 +0000 (10:56 +0100)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

5 years agoeject: use err() rather than abort()
Karel Zak [Mon, 5 Nov 2018 09:34:10 +0000 (10:34 +0100)] 
eject: use err() rather than abort()

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1645920
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: fix typos
Jakub Wilk [Sat, 3 Nov 2018 19:55:45 +0000 (20:55 +0100)] 
docs: fix typos

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
5 years agoagetty: when logname is erased, re-enable reloads
Stanislav Brabec [Fri, 26 Oct 2018 13:02:17 +0000 (15:02 +0200)] 
agetty: when logname is erased, re-enable reloads

When user starts to enter logname, 8b58ffdd blocks issue reloads.
Reloads remain blocked even if user deletes all typed characters.

Make things visually consistent: If no characters are entered,
re-enable reloads.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodocs: add info about branches; update travis.yml
Karel Zak [Wed, 24 Oct 2018 11:02:59 +0000 (13:02 +0200)] 
docs: add info about branches; update travis.yml

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkzone: fix report zones sector offset check
Masato Suzuki [Tue, 23 Oct 2018 09:31:35 +0000 (18:31 +0900)] 
blkzone: fix report zones sector offset check

To catch an offset error, an offset should be begger than or equal to
a device size in the condition.

Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
5 years agoagetty: don't put the VC into canonical mode
Lubomir Rintel [Fri, 19 Oct 2018 20:08:17 +0000 (22:08 +0200)] 
agetty: don't put the VC into canonical mode

The wait_for_term_input()'s select() needs to be tripped when the user
starts typing. Otherwise the reloads can abort an already in-progress login.

Coupled with \4 and \6 expansions that happen to be there on Fedora Server,
this means reload on every netlink event. With a couple of IPv6 routers
announcing their networks and temporary addresses in use can make it
sometimes virtually impossible to log in.

Seems like zero lflags do the job just fine on a Linux VT. Reset it to
canonical mode before running login.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: release++ (v2.33-rc2) v2.33-rc2
Karel Zak [Fri, 19 Oct 2018 10:19:32 +0000 (12:19 +0200)] 
build-sys: release++ (v2.33-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.33-ReleaseNotes
Karel Zak [Fri, 19 Oct 2018 10:18:07 +0000 (12:18 +0200)] 
docs: update v2.33-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Fri, 19 Oct 2018 10:16:45 +0000 (12:16 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Fri, 19 Oct 2018 10:14:52 +0000 (12:14 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: don't use __u32
Karel Zak [Thu, 11 Oct 2018 12:22:08 +0000 (14:22 +0200)] 
agetty: don't use __u32

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: make output more robust
Karel Zak [Thu, 11 Oct 2018 11:29:39 +0000 (13:29 +0200)] 
agetty: make output more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: cleanup issue output change, remove bool
Karel Zak [Thu, 11 Oct 2018 11:21:23 +0000 (13:21 +0200)] 
agetty: cleanup issue output change, remove bool

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: move all issue variables to struct
Karel Zak [Thu, 11 Oct 2018 11:12:02 +0000 (13:12 +0200)] 
agetty: move all issue variables to struct

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: Reload only if it is really needed
Stanislav Brabec [Wed, 10 Oct 2018 17:26:34 +0000 (19:26 +0200)] 
agetty: Reload only if it is really needed

If netlink event arrives and related escapes are part of issue, agetty
reloads and re-display the prompt. Reload is triggered not only by IP
address change, but also by IPv6 RAs. In some environments it causes
reload several times in a minute, and even complicates the login.

To prevent this, reload only if a real change appears.

This consists of:
split print_issue_file() to several functions:

eval_issue_file() prints issue to memory. It does not affect terminal in
any way.

print_issue_file() prints issue file from memory.

cmp_issue_file() compares the issue file and returns true, if reload is
needed.

The implementation requires additional change:

do_prompt() does not evaluate the issue file. It is responsibility of
calling function.

Test suite:

Use issue that contais \4 and/or \6 escape.

After installing new instance, restart agetty by typing a letter and then
Enter 6 times.

To check whether reload happens, type a letter. When reload happens,
letter disappears.

1. Unplug network cable. Wait a while and re-plug network cable.
You should see 2 reloads on single stack and 3 reloads on dual stack.

2. Run a loop
while : ; do
sed -i '$areload_test' /etc/issue
agetty --reload
sleep 3
sed -i '/reload_test/d' /etc/issue
agetty --reload
sleep 3
done
You should see regular reload every 3 seconds.

3. Run a loop
while : ; do
agetty --reload
sleep 3
done
Before: You see regular reload every 3 seconds.
After: No reloads.

4. Run a loop
while : ; do
ifconfig lo 127.0.0.1 netmask 255.0.0.0
sleep 3
ifconfig lo 127.0.0.2 netmask 255.0.0.0
sleep 3
done
Before: You see regular reload every 3 seconds.
After: No reloads.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agoagetty: Watch only protocol requested by issue escapes
Stanislav Brabec [Wed, 10 Oct 2018 17:26:27 +0000 (19:26 +0200)] 
agetty: Watch only protocol requested by issue escapes

To decrease number of reloads, watch only protocol requested by \4 and \6
escapes in issue file.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agoagetty: rename variable changed to triggered
Stanislav Brabec [Wed, 10 Oct 2018 17:26:21 +0000 (19:26 +0200)] 
agetty: rename variable changed to triggered

changed variable name is not correct. It does not say that network
interface changed its address. It just says that the netlink message
processing was triggered.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agobash-completion: cleanup mount and umount --namespace
Karel Zak [Fri, 5 Oct 2018 09:48:04 +0000 (11:48 +0200)] 
bash-completion: cleanup mount and umount --namespace

* use only PATHs rather than PIDs to namespaces

* add --namespace to umount too

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch '2018wk40' of https://github.com/kerolasa/util-linux
Karel Zak [Fri, 5 Oct 2018 09:42:59 +0000 (11:42 +0200)] 
Merge branch '2018wk40' of https://github.com/kerolasa/util-linux

* '2018wk40' of https://github.com/kerolasa/util-linux:
  bash-completion: catch up with option changes

5 years agolibmount: keep namespaces support optional
Karel Zak [Fri, 5 Oct 2018 09:04:04 +0000 (11:04 +0200)] 
libmount: keep namespaces support optional

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: add USE_LIBMOUNT_SUPPORT_NAMESPACES
Karel Zak [Fri, 5 Oct 2018 09:02:26 +0000 (11:02 +0200)] 
build-sys: add USE_LIBMOUNT_SUPPORT_NAMESPACES

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobash-completion: catch up with option changes
Sami Kerola [Thu, 4 Oct 2018 20:36:22 +0000 (21:36 +0100)] 
bash-completion: catch up with option changes

Check what has changed in usage functions in between v2.32..a77bd80d5 and
update bash-completion files accordingly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agosfdisk: disable --activate for Hybrid GPT/MBR
Karel Zak [Thu, 4 Oct 2018 12:06:45 +0000 (14:06 +0200)] 
sfdisk: disable --activate for Hybrid GPT/MBR

Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: add getopt to TODO
Karel Zak [Thu, 4 Oct 2018 10:54:05 +0000 (12:54 +0200)] 
docs: add getopt to TODO

Addresses: https://github.com/karelzak/util-linux/issues/701
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosfdisk: be more verbose about PMBR on --activate
Karel Zak [Thu, 4 Oct 2018 10:40:10 +0000 (12:40 +0200)] 
sfdisk: be more verbose about PMBR on --activate

Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agorename: avoid undefined function prototype for `fpurge`
Patrick Steinhardt [Wed, 26 Sep 2018 06:23:09 +0000 (08:23 +0200)] 
rename: avoid undefined function prototype for `fpurge`

In case where the non-standard `fpurge` function is available, we
redefine `__fpurge` to `fpurge`. We can do so because the only
difference between both functions is that one returns an error code
while the other does not. But as we do not check the error code either
way, we do not care about which one of them we use.

The above redefinition happens unconditionally if we know that `fpurge`
exists. Most notably, we also redefine it if we already do have an
`__fpurge` function available that could be used. This causes problems
on musl-based platforms, where we detect availability of `fpurge` in
libc, but where no function declaration for it exists in "stdio_ext.h".
The compiler thus prints a warning due to an unknown function, even
though it will link just fine.

Avoid this warning by only redefining `__fpurge` to `fpurge` when
HAVE___FPURGE is not defined.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
5 years agolsblk: fix unknown type `stat` caused by missing header
Patrick Steinhardt [Wed, 26 Sep 2018 06:23:08 +0000 (08:23 +0200)] 
lsblk: fix unknown type `stat` caused by missing header

The structure `blkdev_cxt` has a `struct stat` member embedded, whose
size may not be known on some systems because of a missing include for
"sys/stat.h". On glibc-based systems, this header is included
transitively via "sys/statvfs.h", but on musl-based systems it is not.

Fix the resulting compile error due to unknown size of the struct by
including "sys/stat.h".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
5 years agolibfdisk: fix printf format modifier
Ruediger Meier [Tue, 25 Sep 2018 22:37:29 +0000 (00:37 +0200)] 
libfdisk: fix printf format modifier

libfdisk/src/script.c: In function ‘fdisk_script_read_context’:
libfdisk/src/script.c:452:33: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
   snprintf(buf, sizeof(buf), "%zu", fdisk_get_grain_size(cxt));
                                 ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agolibfdisk: fix OSX compiler warning
Ruediger Meier [Tue, 25 Sep 2018 22:37:28 +0000 (00:37 +0200)] 
libfdisk: fix OSX compiler warning

libfdisk/src/context.c:1354:54: error: unused parameter 'cxt' [-Werror,-Wunused-parameter]
const char *fdisk_get_devmodel(struct fdisk_context *cxt)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agoagetty: cleanup code to copy to log strings
Karel Zak [Wed, 3 Oct 2018 15:08:11 +0000 (17:08 +0200)] 
agetty: cleanup code to copy to log strings

man utmp:
  String fields are terminated by a null byte ('\0') if they are shorter
  than the size of the field.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosu: cleanup code to copy to log strings
Karel Zak [Wed, 3 Oct 2018 15:08:11 +0000 (17:08 +0200)] 
su: cleanup code to copy to log strings

man utmp:
  String fields are terminated by a null byte ('\0') if they are shorter
  than the size of the field.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agologin: cleanup code to copy to log strings
Karel Zak [Wed, 3 Oct 2018 15:08:11 +0000 (17:08 +0200)] 
login: cleanup code to copy to log strings

man utmp:
  String fields are terminated by a null byte ('\0') if they are shorter
  than the size of the field.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomkfs.cramfs: properly copy disk name
Karel Zak [Wed, 3 Oct 2018 15:07:37 +0000 (17:07 +0200)] 
mkfs.cramfs: properly copy disk name

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