]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 years agoAsciidoc: Formatting cleanup
Mario Blättermann [Sun, 21 Mar 2021 12:02:56 +0000 (13:02 +0100)] 
Asciidoc: Formatting cleanup

4 years agoAsciidoc: Remove already imported text-utils *roff man pages
Mario Blättermann [Sun, 21 Mar 2021 11:50:16 +0000 (12:50 +0100)] 
Asciidoc: Remove already imported text-utils *roff man pages

4 years agoAsciidoc: Unify spelling of »User Commands«
Mario Blättermann [Sun, 21 Mar 2021 09:00:16 +0000 (10:00 +0100)] 
Asciidoc: Unify spelling of »User Commands«

4 years agoAsciidoc: Add Po4a hint to file headers
Mario Blättermann [Sat, 20 Mar 2021 15:42:47 +0000 (16:42 +0100)] 
Asciidoc: Add Po4a hint to file headers

4 years agoAsciidoc: Small fix in nsenter.1.adoc
Mario Blättermann [Sat, 20 Mar 2021 14:23:32 +0000 (15:23 +0100)] 
Asciidoc: Small fix in nsenter.1.adoc

4 years agoAsciidoc: Some more man page formatting improvements
Mario Blättermann [Sat, 20 Mar 2021 08:45:23 +0000 (09:45 +0100)] 
Asciidoc: Some more  man page formatting improvements

Besides some formatting tweaks, I've changed »lsblk(1)« into »lsblk(8)«
in the SEE ALSO section of mount.8.adoc. At least Archlinux and Debian
ship lsblk as a system administration command.

4 years agoAsciidoc: Re-add empty lines to man pages
Mario Blättermann [Fri, 19 Mar 2021 19:52:00 +0000 (20:52 +0100)] 
Asciidoc: Re-add empty lines to man pages

4 years agoAsciidoc: Some formatting cleanup in man pages
Mario Blättermann [Fri, 19 Mar 2021 17:25:50 +0000 (18:25 +0100)] 
Asciidoc: Some formatting cleanup in man pages

4 years agoAsciidoc: Remove already imported misc-utils *roff man pages
Mario Blättermann [Fri, 19 Mar 2021 16:16:40 +0000 (17:16 +0100)] 
Asciidoc: Remove already imported misc-utils *roff man pages

4 years agoAsciidoc: Import misc-utils man pages
Mario Blättermann [Fri, 19 Mar 2021 16:12:57 +0000 (17:12 +0100)] 
Asciidoc: Import misc-utils man pages

4 years agoAsciidoc: Remove already imported login-utils *roff man pages
Mario Blättermann [Wed, 17 Mar 2021 19:00:15 +0000 (20:00 +0100)] 
Asciidoc: Remove already imported login-utils *roff man pages

4 years agoAsciidoc: Import login-utils man pages
Mario Blättermann [Wed, 17 Mar 2021 18:57:15 +0000 (19:57 +0100)] 
Asciidoc: Import login-utils man pages

4 years agoAsciidoc: add missing bugreports section to libblkid and some cleanup
Mario Blättermann [Tue, 16 Mar 2021 20:17:50 +0000 (21:17 +0100)] 
Asciidoc: add missing bugreports section to libblkid and some cleanup

4 years agoAsciidoc: Remove already imported disk-utils *roff man pages
Mario Blättermann [Tue, 16 Mar 2021 20:13:57 +0000 (21:13 +0100)] 
Asciidoc: Remove already imported disk-utils *roff man pages

4 years agoAsciidoc: Import disk-utils man pages
Mario Blättermann [Tue, 16 Mar 2021 20:08:43 +0000 (21:08 +0100)] 
Asciidoc: Import disk-utils man pages

4 years agoAsciidoc: Fix man pages with variables to use the same value as in previous *.in...
Mario Blättermann [Tue, 16 Mar 2021 18:41:23 +0000 (19:41 +0100)] 
Asciidoc: Fix man pages with variables to use the same value as in previous *.in files

4 years agoAsciidoc: Remove already imported *roff man pages
Mario Blättermann [Tue, 16 Mar 2021 18:35:37 +0000 (19:35 +0100)] 
Asciidoc: Remove already imported *roff man pages

4 years agoAsciidoc: Adapt Makefiles to new asciidoc man pages
Mario Blättermann [Tue, 16 Mar 2021 18:34:59 +0000 (19:34 +0100)] 
Asciidoc: Adapt Makefiles to new asciidoc man pages

4 years agoAsciidoc: Import libuuid man pages
Mario Blättermann [Sun, 14 Mar 2021 13:29:44 +0000 (14:29 +0100)] 
Asciidoc: Import libuuid man pages

4 years agoAsciidoc: Import term-utils man pages
Mario Blättermann [Sun, 14 Mar 2021 09:48:27 +0000 (10:48 +0100)] 
Asciidoc: Import term-utils man pages

4 years agoAsciidoc: Import hwclock.8.in
Mario Blättermann [Sun, 14 Mar 2021 07:58:13 +0000 (08:58 +0100)] 
Asciidoc: Import hwclock.8.in

4 years agoAsciidoc: Import rtcwake.8.in
Mario Blättermann [Sat, 13 Mar 2021 21:55:02 +0000 (22:55 +0100)] 
Asciidoc: Import rtcwake.8.in

4 years agoAsciidoc: Import sys-utils man pages, part 3
Mario Blättermann [Sat, 13 Mar 2021 21:33:34 +0000 (22:33 +0100)] 
Asciidoc: Import sys-utils man pages, part 3

4 years agoAsciidoc: Use correct ':man manual:' for man pages from section 8
Mario Blättermann [Sat, 13 Mar 2021 11:49:26 +0000 (12:49 +0100)] 
Asciidoc: Use correct ':man manual:' for man pages from section 8

4 years agoAsciidoc: Import sys-utils man pages, part 2
Mario Blättermann [Sat, 13 Mar 2021 11:22:34 +0000 (12:22 +0100)] 
Asciidoc: Import sys-utils man pages, part 2

4 years agoAsciidoc: Import sys-utils man pages, part 1
Mario Blättermann [Fri, 12 Mar 2021 20:10:37 +0000 (21:10 +0100)] 
Asciidoc: Import sys-utils man pages, part 1

4 years agoAsciidoc: Import textutils man pages
Mario Blättermann [Fri, 12 Mar 2021 13:16:26 +0000 (14:16 +0100)] 
Asciidoc: Import textutils man pages

4 years agolibblikid.3.adoc: Add missing SYNOPSIS section
Mario Blättermann [Fri, 12 Mar 2021 12:34:59 +0000 (13:34 +0100)] 
libblikid.3.adoc: Add missing SYNOPSIS section

4 years agoRemove no longer valid part of man/common/README
Mario Blättermann [Thu, 11 Mar 2021 17:48:13 +0000 (18:48 +0100)] 
Remove no longer valid part of man/common/README

4 years agoAdd asciidoc man pages and some include files
Mario Blättermann [Thu, 11 Mar 2021 17:38:46 +0000 (18:38 +0100)] 
Add asciidoc man pages and some include files

4 years agolscpu: add info that caches sizes are sum
Karel Zak [Mon, 8 Mar 2021 10:25:15 +0000 (11:25 +0100)] 
lscpu: add info that caches sizes are sum

Addresses: https://github.com/karelzak/util-linux/issues/1258
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agofdisk: (man) add info about order for -l
Karel Zak [Mon, 8 Mar 2021 09:56:47 +0000 (10:56 +0100)] 
fdisk: (man) add info about order for -l

Reported-by: Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohwclock: use pointer to adjtime data
Karel Zak [Thu, 4 Mar 2021 10:27:47 +0000 (11:27 +0100)] 
hwclock: use pointer to adjtime data

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoutmpdup: Ensure flushing when using follow flag
Andrew Shapiro [Mon, 1 Mar 2021 18:18:27 +0000 (13:18 -0500)] 
utmpdup: Ensure flushing when using follow flag

The following usages of utmpdump result in no output being flushed to the specified file because the default output buffering is fully buffered:

$ utmpdump --follow --output myOutputFile /var/log/utmp
$ utmpdump --follow /var/log/utmp > myOutputFile

This change configures line buffering for these scenarios so that output will be flushed after each log event.

Signed-off-by: Andrew Shapiro <anshapiro@gmail.com>
4 years agodmesg: fix and cleanup --read-clear
Karel Zak [Mon, 1 Mar 2021 15:50:20 +0000 (16:50 +0100)] 
dmesg: fix and cleanup --read-clear

The function read_buffer() implements read and clear functionally, but
we do not differentiate between these actions in main() for error
messages, and one generic "dmesg: read kernel buffer failed" is used
in all cases. That's a bug.

This patch removes the "clear" action from read_buffer() and keeps it
for buffer reading only.  The "clear" action is implemented in main()
by separate klogctl(SYSLOG_ACTION_CLEAR) for cases. It means also for
"dmesg --read-clear"; we do not use SYSLOG_ACTION_READ_CLEAR anymore.

Now "clear+read" is:

 * syslog: SYSLOG_ACTION_READ_ALL + SYSLOG_ACTION_CLEAR
 * kmsg:   /dev/kmsg read()       + SYSLOG_ACTION_CLEAR

In old versions "dmesg --syslog --read-clear" (syalog backed) was
implemented by      logctl(SYSLOG_ACTION_READ_CLEAR) and it returns no
data for non-root  users (due to EPERM), "dmesg --read-clear" (kmsg)
returns data and EPERM for the "clear" action.

Now the command "dmesg --syslog --read-clear" and "dmesg --read-clear"
behaves in the same way -- returns data and EPERM for the "clear"
action.

Fixes: https://github.com/karelzak/util-linux/issues/1255
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsblk: update man page
Karel Zak [Mon, 1 Mar 2021 13:51:28 +0000 (14:51 +0100)] 
lsblk: update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'master' of https://github.com/adigitoleo/util-linux
Karel Zak [Mon, 1 Mar 2021 13:46:50 +0000 (14:46 +0100)] 
Merge branch 'master' of https://github.com/adigitoleo/util-linux

4 years agoUpdate lsblk.8
Leon [Mon, 1 Mar 2021 11:47:27 +0000 (22:47 +1100)] 
Update lsblk.8

4 years agoirqtop: check scols_line_set_data() return code
Karel Zak [Thu, 25 Feb 2021 13:37:17 +0000 (14:37 +0100)] 
irqtop: check scols_line_set_data() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoirqtop: small cleanup
Karel Zak [Thu, 25 Feb 2021 08:57:49 +0000 (09:57 +0100)] 
irqtop: small cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosu: fix man page typos
Štěpán Němec [Tue, 23 Feb 2021 15:25:54 +0000 (16:25 +0100)] 
su: fix man page typos

Signed-off-by: Štěpán Němec <snemec@redhat.com>
4 years agoirqtop: add per-cpu stats
Karel Zak [Wed, 24 Feb 2021 19:10:56 +0000 (20:10 +0100)] 
irqtop: add per-cpu stats

irqtop | total: 1245107402 delta: 7394 | ws.net.home | 2021-02-24 20:11:09+01:00

        cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7
  %irq: 12.9 13.0 12.8 11.9 12.4 13.4 11.6 12.0
%delta: 13.7  9.7 22.6  7.9  9.5 17.5  8.3 10.8

       IRQ      TOTAL      DELTA NAME
       LOC  989162414       6111 Local timer interrupts
       TLB  100492740         67 TLB shootdowns
       CAL   95058001        321 Function call interrupts
        42   23893801        241 IR-PCI-MSI 1048576-edge nvidia
        30   20209392        494 IR-PCI-MSI 327680-edge xhci_hcd
       RES   12996335         86 Rescheduling interrupts
        29    1354219          4 IR-PCI-MSI 512000-edge ahci[0000:00:1f.2]
        41     682653         31 IR-PCI-MSI 409600-edge eno1
   ...

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoirqtop: print header in reverse mode
Karel Zak [Wed, 24 Feb 2021 13:29:20 +0000 (14:29 +0100)] 
irqtop: print header in reverse mode

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agodocs: update TODO (scols borders)
Karel Zak [Wed, 24 Feb 2021 12:06:40 +0000 (13:06 +0100)] 
docs: update TODO (scols borders)

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1931776
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosu: (pty) change owner and mode for pty
Karel Zak [Tue, 23 Feb 2021 10:52:45 +0000 (11:52 +0100)] 
su: (pty) change owner and mode for pty

The current situation:

 # su --pty - kzak
 $ ll $(tty)
 crw--w---- 1 root tty 136, 9 Feb 23 11:53 /dev/pts/9
 $ mesg
 mesg: cannot open /dev/pts/9: Permission denied

the pseudo-terminal is still owned by the original user.

New version:

 # su --pty - kzak
 # ll $(tty)
 crw--w---- 1 kzak tty 136, 9 Feb 23 11:56 /dev/pts/9
 # mesg
 is y

The patch follows login(1) to change the pty owner and group. It
follows "TTYPERM" and "TTYGROUP" from login.defs (or econf lib).

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agologin: move generic setting to ttyutils.h
Karel Zak [Tue, 23 Feb 2021 10:46:10 +0000 (11:46 +0100)] 
login: move generic setting to ttyutils.h

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosu: explicitly enable echo for --pty
Karel Zak [Tue, 23 Feb 2021 10:37:15 +0000 (11:37 +0100)] 
su: explicitly enable echo for --pty

Since 75ccd75a2fa1194c6415c47b0024a438e26f1ad7 we need to explicitly
set echo flag by ul_pty_slave_echo(pty, 1).

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agofdisk: support partition type name in dialogs
Karel Zak [Tue, 23 Feb 2021 08:25:57 +0000 (09:25 +0100)] 
fdisk: support partition type name in dialogs

Command (m for help): t

Selected partition 1
Partition type or alias (type L to list all): linux root x86
Changed type of partition 'Linux /usr (x86)' to 'Linux root (x86)'.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosfdisk: support for type="partition type name"
Karel Zak [Tue, 23 Feb 2021 08:21:40 +0000 (09:21 +0100)] 
sfdisk: support for type="partition type name"

For example:

 # echo 'size=10MiB, type="linux usr x86"' | sfdisk /dev/sdc
 ...
 New situation:

 Device     Start   End Sectors Size Type
 /dev/sdc1   2048 22527   20480  10M Linux /usr (x86)

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibfdisk: support partition type name parsing
Karel Zak [Tue, 23 Feb 2021 08:19:51 +0000 (09:19 +0100)] 
libfdisk: support partition type name parsing

Add to fdisk_label_advparse_parttype() support for
FDISK_PARTTYPE_PARSE_NAME to parse partition type name.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib/strutils: add ul_stralnumcmp()
Karel Zak [Tue, 23 Feb 2021 08:19:48 +0000 (09:19 +0100)] 
lib/strutils: add ul_stralnumcmp()

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: set localstatedir and sysconfdir default
Karel Zak [Fri, 19 Feb 2021 11:04:39 +0000 (12:04 +0100)] 
build-sys: set localstatedir and sysconfdir default

Let's follow our policy for default directories and explicitly default
to localstatedir=/var and sysconfdir=/etc when the default $prefix is
used.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoreadprofile: fix static analyzer warning [coverity scan]
Karel Zak [Thu, 18 Feb 2021 10:15:48 +0000 (11:15 +0100)] 
readprofile: fix static analyzer warning [coverity scan]

Make sure we do not use step=0 and zero "fn_add - add0" as divisor.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agorfkill: fix static analyzer warning [coverity scan]
Karel Zak [Thu, 18 Feb 2021 10:09:31 +0000 (11:09 +0100)] 
rfkill: fix static analyzer warning [coverity scan]

>>>     CID 365738:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "ret". Field "ret" is uninitialized.
326             return ret;

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: fix typo in man page
Karel Zak [Thu, 18 Feb 2021 09:48:47 +0000 (10:48 +0100)] 
hardlink: fix typo in man page

Addresses: https://github.com/karelzak/util-linux/commit/3292501316f5731d8e311a000012b49a411a36e6#commitcomment-47222034
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: (python) fix compiler warning
Karel Zak [Wed, 17 Feb 2021 11:25:49 +0000 (12:25 +0100)] 
libmount: (python) fix compiler warning

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib: use procutils.c on Linux only
Karel Zak [Wed, 17 Feb 2021 11:24:13 +0000 (12:24 +0100)] 
lib: use procutils.c on Linux only

Fixes: https://github.com/karelzak/util-linux/issues/1251
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: fix indention
Karel Zak [Wed, 17 Feb 2021 10:48:03 +0000 (11:48 +0100)] 
hardlink: fix indention

The original Julian's hardlink.c code is pretty readable, but for
util-linux we use a little different indention (aka Linux kernel
coding style).

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: update hardlink tests
Karel Zak [Wed, 17 Feb 2021 10:15:45 +0000 (11:15 +0100)] 
tests: update hardlink tests

The important is result, not summary or verbose output.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: add --quiet option
Karel Zak [Wed, 17 Feb 2021 10:14:54 +0000 (11:14 +0100)] 
hardlink: add --quiet option

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: cleanup man page
Karel Zak [Fri, 5 Feb 2021 10:42:44 +0000 (11:42 +0100)] 
hardlink: cleanup man page

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: s/DEBUG/VERBOSE/
Karel Zak [Fri, 5 Feb 2021 10:13:13 +0000 (11:13 +0100)] 
hardlink: s/DEBUG/VERBOSE/

We usually use "debug" for very detailed information. For end-user
information is better to talk about "verbose" output.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: translate verbose messages
Karel Zak [Fri, 5 Feb 2021 10:09:50 +0000 (11:09 +0100)] 
hardlink: translate verbose messages

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: cleanup summary
Karel Zak [Fri, 5 Feb 2021 10:06:48 +0000 (11:06 +0100)] 
hardlink: cleanup summary

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use size_to_human_string()
Karel Zak [Fri, 5 Feb 2021 09:58:29 +0000 (10:58 +0100)] 
hardlink: use size_to_human_string()

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use only err.h to print errors and warnings
Karel Zak [Thu, 4 Feb 2021 12:56:45 +0000 (13:56 +0100)] 
hardlink: use only err.h to print errors and warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use monotonic time like other utils
Karel Zak [Thu, 4 Feb 2021 12:43:05 +0000 (13:43 +0100)] 
hardlink: use monotonic time like other utils

- use out gettime_monotonic()
- use timeval for calculation rather than double

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use errx() when parse options
Karel Zak [Thu, 4 Feb 2021 12:23:32 +0000 (13:23 +0100)] 
hardlink: use errx() when parse options

Don't waste time with some cleanup on --exclude and --include regex
errors.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use err() if possible
Karel Zak [Thu, 4 Feb 2021 12:14:51 +0000 (13:14 +0100)] 
hardlink: use err() if possible

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: cleanup --minimum-size stuff
Karel Zak [Thu, 4 Feb 2021 12:06:56 +0000 (13:06 +0100)] 
hardlink: cleanup --minimum-size stuff

* use uintmax_t
* use strtosize_or_err()
* add info about suffixes to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: move default to options initialization
Karel Zak [Thu, 4 Feb 2021 11:54:45 +0000 (12:54 +0100)] 
hardlink: move default to options initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: cleanup usage()
Karel Zak [Thu, 4 Feb 2021 11:50:10 +0000 (12:50 +0100)] 
hardlink: cleanup usage()

Let's make --help more util-linux compatible.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use our xalloc.h
Karel Zak [Thu, 4 Feb 2021 11:19:34 +0000 (12:19 +0100)] 
hardlink: use our xalloc.h

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: check and use sys/xattr.h
Karel Zak [Thu, 4 Feb 2021 11:14:13 +0000 (12:14 +0100)] 
hardlink: check and use sys/xattr.h

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: use PRCE2 posix header file
Karel Zak [Thu, 4 Feb 2021 11:06:53 +0000 (12:06 +0100)] 
hardlink: use PRCE2 posix header file

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: cleanup includes and types
Karel Zak [Thu, 4 Feb 2021 10:12:21 +0000 (11:12 +0100)] 
hardlink: cleanup includes and types

* use config.h like other code on package
* use c.h and remove from code stuff defined in the header file
* remove FALSE/TRUE redefinition

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: replace with code from Debian
Karel Zak [Thu, 4 Feb 2021 09:42:53 +0000 (10:42 +0100)] 
hardlink: replace with code from Debian

The current version used in util-linux is based on original code from
Jakub Jelinek.

The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink.  This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.

Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).

Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoci: trigger CiFuzz for the master branch only
Evgeny Vereshchagin [Mon, 15 Feb 2021 13:25:19 +0000 (13:25 +0000)] 
ci: trigger CiFuzz for the master branch only

CIFuzz and OSS-Fuzz are in sync with the master branch so it would
probably make sense to avoid running it for long-lived branches.

Inspired by https://github.com/karelzak/util-linux/pull/1248#issuecomment-776342252

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
4 years agotests: don't reply on scsi_debug partitions
Karel Zak [Thu, 11 Feb 2021 11:44:44 +0000 (12:44 +0100)] 
tests: don't reply on scsi_debug partitions

The disk layout as created by scsi_debug depends on kernel version.
Let's make the partition sizes hardcoded in our tests than rely on
kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibfdisk: (dos) fix last possible sector calculation
Karel Zak [Thu, 11 Feb 2021 10:49:56 +0000 (11:49 +0100)] 
libfdisk: (dos) fix last possible sector calculation

* rename 'last' to 'first' as we use this value as the first available free
  sector rather than last used

* use '-1' when calculate last partition sector to compare with last
  disk sector

* improve debug messages

Fixes: https://github.com/karelzak/util-linux/issues/1249
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoagetty: tty eol defaults to REPRINT
Sami Loone [Tue, 9 Feb 2021 09:46:36 +0000 (10:46 +0100)] 
agetty: tty eol defaults to REPRINT

Adapting tty eol settings from defaults misbehaves as CTRL('r') aka
REPRINT is confused with CR. Consequently --skip-login does not set
tty CR<->NL translations and thus acts against advertised CR as eol
default.

[kzak@redhat.com:
   It seems this issue has been introduced by commit f566447 where we
   merged sulogin and agetty terminal initialization together to the file
   include/ttyutils.h.

  The original agetty has really used .eol=13 (aka CR) for the default.
  The problem is invisible for sulogin(1) because it always asks for a
  password and .eol= is set to NL/CR, the same agetty when it asks for
  username.]

Addresses: https://github.com/karelzak/util-linux/pull/1247
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'switch_root-check-if-mounted' of https://github.com/Whissi/util-linux
Karel Zak [Wed, 10 Feb 2021 09:52:16 +0000 (10:52 +0100)] 
Merge branch 'switch_root-check-if-mounted' of https://github.com/Whissi/util-linux

4 years agotests: be explicit with file permissions for cramfs
Karel Zak [Tue, 9 Feb 2021 17:02:13 +0000 (18:02 +0100)] 
tests: be explicit with file permissions for cramfs

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibmount: fix /{etc,proc}/filesystems use
Karel Zak [Tue, 9 Feb 2021 09:36:04 +0000 (10:36 +0100)] 
libmount: fix /{etc,proc}/filesystems use

* always update context->helper
* consolidate helper and syscall status use

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoswitch_root: check if mount point to move even exists
Thomas Deutschmann [Mon, 8 Feb 2021 14:30:25 +0000 (15:30 +0100)] 
switch_root: check if mount point to move even exists

Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
4 years agobuild-sys: add --disable-scriptutils
Karel Zak [Mon, 8 Feb 2021 14:01:33 +0000 (15:01 +0100)] 
build-sys: add --disable-scriptutils

This new ./configure option disables script, scriptreplay ans
scriptlive.

Fixes: https://github.com/karelzak/util-linux/issues/1244
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibsmartcols: remove unnecessary code
Karel Zak [Mon, 8 Feb 2021 13:47:38 +0000 (14:47 +0100)] 
libsmartcols: remove unnecessary code

Fixes: https://github.com/karelzak/util-linux/pull/1243
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: fix distcheck job
Karel Zak [Fri, 5 Feb 2021 14:21:56 +0000 (15:21 +0100)] 
github: fix distcheck job

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agogithub: add 'distcheck' workflow job
Karel Zak [Fri, 5 Feb 2021 14:03:49 +0000 (15:03 +0100)] 
github: add 'distcheck' workflow job

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'gh-actions-bionic' of https://github.com/mrc0mmand/util-linux
Karel Zak [Fri, 5 Feb 2021 09:29:26 +0000 (10:29 +0100)] 
Merge branch 'gh-actions-bionic' of https://github.com/mrc0mmand/util-linux

* 'gh-actions-bionic' of https://github.com/mrc0mmand/util-linux:
  ci: run the build test for each pull request
  ci: build both w/ and w/o sanitizers on GH Actions
  ci: code cleanup
  ci: deal with uninstrumented binaries using instrumented libs
  text-utils: correctly detect ASan under clang
  ci: use the correct compiler version
  ci: 'downgrade' Ubuntu version to Bionic

4 years agobuild-sys: fix schedutils/sched_attr.h include
Karel Zak [Fri, 5 Feb 2021 09:23:04 +0000 (10:23 +0100)] 
build-sys: fix schedutils/sched_attr.h include

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agologin: use full tty path for PAM_TTY
Karel Zak [Wed, 3 Feb 2021 13:45:15 +0000 (14:45 +0100)] 
login: use full tty path for PAM_TTY

pam_set_item() man page:
 PAM_TTY
   The terminal name: prefixed by /dev/ if it is a device file;
   for graphical, X-based, applications the value for this item
   should be the $DISPLAY variable.

It seems for example pam_timestamp module is not robust enough to
differentiate between /dev/ and pty/0 and it assumes that '/' in the
path always means '/dev/' prefix ...

Fixes: https://github.com/karelzak/util-linux/issues/1242
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosu: use full tty path for PAM_TTY
Karel Zak [Wed, 3 Feb 2021 13:45:15 +0000 (14:45 +0100)] 
su: use full tty path for PAM_TTY

pam_set_item() man page:
 PAM_TTY
   The terminal name: prefixed by /dev/ if it is a device file;
   for graphical, X-based, applications the value for this item
   should be the $DISPLAY variable.

It seems for example pam_timestamp module is not robust enough to
differentiate between /dev/ and pty/0 and it assumes that '/' in the
path always means '/dev/' prefix ...

Fixes: https://github.com/karelzak/util-linux/issues/1242
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: cleanup uclampset dependencies
Karel Zak [Tue, 2 Feb 2021 15:32:51 +0000 (16:32 +0100)] 
build-sys: cleanup uclampset dependencies

chrt requires sched_setattr() or sched_setscheduler(), the both is
covered by have_schedsetter variable in ./configure.ac. This variable
is useless for uclampset, because it requires sched_setattr(). Let's
make it more explicit for uclampset.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agouclampset: cleanup --hel output
Karel Zak [Tue, 2 Feb 2021 11:40:39 +0000 (12:40 +0100)] 
uclampset: cleanup --hel output

Signed-off-by: Karel Zak <kzak@redhat.com>
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>