]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 years agoMerge branch 'ci-coverity' of https://github.com/evverx/util-linux
Karel Zak [Mon, 8 Nov 2021 13:25:12 +0000 (14:25 +0100)] 
Merge branch 'ci-coverity' of https://github.com/evverx/util-linux

* 'ci-coverity' of https://github.com/evverx/util-linux:
  ci: add a GHAction sending data to Coverity

4 years agosfdisk: fix typo in --move-data when check partition size
Karel Zak [Mon, 8 Nov 2021 13:01:55 +0000 (14:01 +0100)] 
sfdisk: fix typo in --move-data when check partition size

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosfdisk: update docs, add examples to the man page
Karel Zak [Mon, 8 Nov 2021 12:53:02 +0000 (13:53 +0100)] 
sfdisk: update docs, add examples to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibfdisk: (script) rewrite start= and size= parsing
Karel Zak [Mon, 8 Nov 2021 12:43:44 +0000 (13:43 +0100)] 
libfdisk: (script) rewrite start= and size= parsing

* let's use the same code for both supported formats
* add support for '+,' to enlarge by start move  (see previous commit)

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibfdisk: enlarge partition by move start down
Karel Zak [Mon, 8 Nov 2021 12:38:45 +0000 (13:38 +0100)] 
libfdisk: enlarge partition by move start down

Now it's possible move start of the partition only when offset or
absolute value is specified. This commit implements resize to "use all
available free space before the current start".

We already support the same for end of the partition (resize to use all
free space after the partition).

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agodocs: update IRC address
Karel Zak [Mon, 8 Nov 2021 12:09:06 +0000 (13:09 +0100)] 
docs: update IRC address

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoci: no longer refer to Travis CI
Evgeny Vereshchagin [Mon, 8 Nov 2021 04:16:56 +0000 (04:16 +0000)] 
ci: no longer refer to Travis CI

and also add a link to Coveralls coverage reports
to Documentation/howto-test to make it a little easier
to find them.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
4 years agobuild-sys: disable IPC tools on Darwin
Karel Zak [Wed, 3 Nov 2021 14:09:13 +0000 (15:09 +0100)] 
build-sys: disable IPC tools on Darwin

Fixes: https://github.com/util-linux/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoci: add a GHAction sending data to Coverity
Evgeny Vereshchagin [Wed, 3 Nov 2021 06:22:17 +0000 (06:22 +0000)] 
ci: add a GHAction sending data to Coverity

To get it to work a secret named COVERITY_SCAN_TOKEN should
be added to the util-linux repository:
https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository

It has to match the util-linux project token, which
can be found at
https://scan.coverity.com/projects/karelzak-util-linux?tab=project_settings

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
4 years agoci: build coverage reports on Coveralls
Evgeny Vereshchagin [Tue, 2 Nov 2021 15:18:19 +0000 (15:18 +0000)] 
ci: build coverage reports on Coveralls

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
4 years agodocs: update github URL
Karel Zak [Wed, 3 Nov 2021 12:58:21 +0000 (13:58 +0100)] 
docs: update github URL

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agocifuzz: switch to the util-linux organization
Evgeny Vereshchagin [Tue, 2 Nov 2021 16:02:16 +0000 (16:02 +0000)] 
cifuzz: switch to the util-linux organization

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
4 years agobuild-sys: fir distcheck for fileeq.h
Karel Zak [Tue, 2 Nov 2021 14:52:37 +0000 (15:52 +0100)] 
build-sys: fir distcheck for fileeq.h

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: (meson) fix hardlink
Karel Zak [Tue, 2 Nov 2021 14:48:38 +0000 (15:48 +0100)] 
build-sys: (meson) fix hardlink

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsfd.1.adoc: Add missing underscores
Mario Blättermann [Tue, 2 Nov 2021 13:00:24 +0000 (14:00 +0100)] 
lsfd.1.adoc: Add missing underscores

4 years agologin: improve coding style
Karel Zak [Tue, 2 Nov 2021 11:19:28 +0000 (12:19 +0100)] 
login: improve coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agologin: Restore tty size after calling vhangup()
Daan De Meyer [Sat, 30 Oct 2021 14:56:14 +0000 (15:56 +0100)] 
login: Restore tty size after calling vhangup()

If login receives the tty to work on via stdin, stdout and stderr,
login might end up closing the remaining open file descriptors to
the tty just before it calls vhangup(). When the last open file
descriptors to a tty are closed, it's configured size is reset to
0x0. To avoid this from happening, save the size before closing
the stdin, stdout and stderr file descriptors and reapply the size
after the tty is re-opened.

Fixes #1484

4 years agolsfd: remove unused --sysroot
Karel Zak [Tue, 2 Nov 2021 08:15:13 +0000 (09:15 +0100)] 
lsfd: remove unused --sysroot

It's unnecessary to redirect to any /proc dump if we can use 'test_mkfds'.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsfd: delete an unnecessary semicolon
Masatake YAMATO [Fri, 22 Oct 2021 08:10:02 +0000 (17:10 +0900)] 
lsfd: delete an unnecessary semicolon

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: introduce -p/--pid option, pids filter working in the early stage
Masatake YAMATO [Fri, 22 Oct 2021 03:48:47 +0000 (12:48 +0900)] 
lsfd: introduce -p/--pid option, pids filter working in the early stage

    $ time sudo ./lsfd -Q '(PID == 1) or (PID == 2)' > /dev/null

    real 0m0.508s
    user 0m0.230s
    sys 0m0.267s

    $ time sudo ./lsfd -p 1,2 > /dev/null

    real 0m0.088s
    user 0m0.036s
    sys 0m0.033s

    $ [ $(./lsfd -p 1,2) = $(./lsfd -Q '(PID == 1) or (PID == 2)') ]
    $ echo $?
    0

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agoMerge branch 'mount_fuzz' of https://github.com/evverx/util-linux
Karel Zak [Mon, 1 Nov 2021 13:18:21 +0000 (14:18 +0100)] 
Merge branch 'mount_fuzz' of https://github.com/evverx/util-linux

* 'mount_fuzz' of https://github.com/evverx/util-linux:
  mount_fuzz: reject giant files early

4 years agoMerge branch 'topic/hardlink'
Karel Zak [Mon, 1 Nov 2021 11:50:33 +0000 (12:50 +0100)] 
Merge branch 'topic/hardlink'

4 years agotests: update hardlink --maximum-size
Karel Zak [Mon, 1 Nov 2021 11:49:16 +0000 (12:49 +0100)] 
tests: update hardlink --maximum-size

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: add new option: -S/--maximum-size
Daniele Pizzolli [Mon, 11 Oct 2021 07:30:45 +0000 (09:30 +0200)] 
hardlink: add new option: -S/--maximum-size

Support limiting comparison by maximum file size.

[kzak@redhat.com: - resolve conflicts]

Signed-off-by: Daniele Pizzolli <dan+dev@toel.it>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agohardlink: add --cache-size
Karel Zak [Mon, 1 Nov 2021 11:00:21 +0000 (12:00 +0100)] 
hardlink: add --cache-size

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib/fileeq: fix for small memsiz
Karel Zak [Mon, 1 Nov 2021 10:14:24 +0000 (11:14 +0100)] 
lib/fileeq: fix for small memsiz

4 years agohardlink: rename --buffer-size to --io-size
Karel Zak [Mon, 1 Nov 2021 09:46:32 +0000 (10:46 +0100)] 
hardlink: rename --buffer-size to --io-size

Addresses: https://github.com/karelzak/util-linux/pull/1467
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agomount_fuzz: reject giant files early
Evgeny Vereshchagin [Sat, 30 Oct 2021 18:09:30 +0000 (18:09 +0000)] 
mount_fuzz: reject giant files early

It should help to address https://github.com/google/oss-fuzz/issues/6703

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
4 years agohardlink: rewrite files content comparison
Karel Zak [Fri, 29 Oct 2021 11:42:58 +0000 (13:42 +0200)] 
hardlink: rewrite files content comparison

Example:

 # hardlink --ignore-time --dry-run /var/lib

Old version, based on memcmp(), nothing cached:

 Mode:           dry-run
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       204.557185 seconds

New version, --method=memcmp, 32 bytes cached:

 Mode:           dry-run
 Method:         memcmp
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       5.248426 seconds

New version, zero-copy (Linux crypto API), sha1, crc32 and sha256:

 Mode:           dry-run
 Method:         sha1
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       2.870973 seconds

 Mode:           dry-run
 Method:         crc32
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       2.582651 seconds

 Mode:           dry-run
 Method:         sha256
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       3.152825 seconds

The default is sha256 to be robust..

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoinclude/fileeq: add functions to compare files content
Karel Zak [Fri, 29 Oct 2021 11:37:36 +0000 (13:37 +0200)] 
include/fileeq: add functions to compare files content

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsfd: introduce -p/--pid option, pids filter working in the early stage
Masatake YAMATO [Fri, 22 Oct 2021 03:48:47 +0000 (12:48 +0900)] 
lsfd: introduce -p/--pid option, pids filter working in the early stage

    $ time sudo ./lsfd -Q '(PID == 1) or (PID == 2)' > /dev/null

    real 0m0.508s
    user 0m0.230s
    sys 0m0.267s

    $ time sudo ./lsfd -p 1,2 > /dev/null

    real 0m0.088s
    user 0m0.036s
    sys 0m0.033s

    $ [ $(./lsfd -p 1,2) = $(./lsfd -Q '(PID == 1) or (PID == 2)') ]
    $ echo $?
    0

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agochsh: fflush stdout before reading from stdin
Lorenzo Beretta [Mon, 25 Oct 2021 13:28:02 +0000 (15:28 +0200)] 
chsh: fflush stdout before reading from stdin

Same problem as described in https://github.com/karelzak/util-linux/pull/1481

Signed-off-by: Lorenzo Beretta <vc.net.loreb@gmail.com>
4 years agochfn: flush stdout before reading stdin and fix uninitialized variable
Lorenzo Beretta [Mon, 25 Oct 2021 12:06:00 +0000 (14:06 +0200)] 
chfn: flush stdout before reading stdin and fix uninitialized variable

Same problem as described in https://github.com/karelzak/util-linux/pull/1481

Signed-off-by: Lorenzo Beretta <vc.net.loreb@gmail.com>
4 years agoMerge branch 'refactor-tests' of https://github.com/Ajchler/util-linux
Karel Zak [Mon, 25 Oct 2021 10:21:15 +0000 (12:21 +0200)] 
Merge branch 'refactor-tests' of https://github.com/Ajchler/util-linux

* 'refactor-tests' of https://github.com/Ajchler/util-linux:
  tests: split additional tests into subtests
  tests: split several tests into subtests
  tests: split test into subtest
  tests: split cal/colorw test into subtests
  tests: split cal/color test into subtests

4 years agobuild-sys: disable libmount when missing mntent.h
Karel Zak [Mon, 25 Oct 2021 09:53:55 +0000 (11:53 +0200)] 
build-sys: disable libmount when missing mntent.h

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: include xlocale.h for locale_t on MacOS
Karel Zak [Mon, 25 Oct 2021 09:45:46 +0000 (11:45 +0200)] 
build-sys: include xlocale.h for locale_t on MacOS

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: (hardlink) check for llistxattr and lgetxattr
Karel Zak [Mon, 25 Oct 2021 09:39:09 +0000 (11:39 +0200)] 
build-sys: (hardlink) check for llistxattr and lgetxattr

It seems check for sys/xattr.h is not enough. The header file exists
on MacOS, but without these functions.

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibbuid: use _UL_LIBUUID_UUID_H to cover uuid.h
Karel Zak [Mon, 25 Oct 2021 09:26:15 +0000 (11:26 +0200)] 
libbuid: use _UL_LIBUUID_UUID_H to cover uuid.h

It seems _UUID_UUID_H is too generic.

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agodocs: add hint for non-public reports
Karel Zak [Mon, 25 Oct 2021 09:15:01 +0000 (11:15 +0200)] 
docs: add hint for non-public reports

Fixes: https://github.com/karelzak/util-linux/issues/1482
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'flush' of https://github.com/ericonr/util-linux
Karel Zak [Mon, 25 Oct 2021 08:42:22 +0000 (10:42 +0200)] 
Merge branch 'flush' of https://github.com/ericonr/util-linux

* 'flush' of https://github.com/ericonr/util-linux:
  vipw: flush stdout before getting answer.

4 years agoagetty: use getttynam() if available
Ludwig Nussel [Thu, 21 Oct 2021 13:00:59 +0000 (15:00 +0200)] 
agetty: use getttynam() if available

/etc/ttys seems to be a rather archaic concept that is not meant to
exist on Linux. Nevertheless it does. glibc has getttynam() which
correctly parses /etc/ttys. So let's give it a try before falling back
to the built in defaults. One can set the terminal type for a
specific tty using e.g.:

echo 'ttyS0 "" xterm' > /etc/ttys

[kzak@redhat.com: - improve configure.ac part
                  - log error on failed strdup()]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoMerge branch 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux
Karel Zak [Mon, 25 Oct 2021 08:23:16 +0000 (10:23 +0200)] 
Merge branch 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux

* 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux:
  docs: Uniformize references to section titles

4 years agovipw: flush stdout before getting answer.
Érico Nogueira [Fri, 22 Oct 2021 17:28:50 +0000 (14:28 -0300)] 
vipw: flush stdout before getting answer.

Otherwise the question is displayed only after the user presses Return,
and the program looks like it's hanging.

This happens at least on musl libc.

Reported by @loreb.

Signed-off-by: Érico Nogueira <erico.erc@gmail.com>
4 years agologger: fix --size use for stdin
Karel Zak [Thu, 21 Oct 2021 16:47:40 +0000 (18:47 +0200)] 
logger: fix --size use for stdin

The stdin version counts log header into the message size, but
for example when it reads message from argv[] it counts only message
itself.

 $ logger --stderr  --size 3 "abcd"
 <13>Oct 21 18:48:29 kzak: abc

 $ echo "abcd" | logger --stderr  --size 3
 logger: cannot allocate 18446744073709551597 bytes: Cannot allocate memory

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoRevert "logger: verify --size of large enough for message header"
Karel Zak [Thu, 21 Oct 2021 16:44:32 +0000 (18:44 +0200)] 
Revert "logger: verify --size of large enough for message header"

This reverts commit 2fdea5a26480d46ec9445b0ea17fc984f84eecc9.

4 years agobuild-sys: use set +e before patch --try in ./autogen.sh
Karel Zak [Thu, 21 Oct 2021 16:27:46 +0000 (18:27 +0200)] 
build-sys: use set +e before patch --try in ./autogen.sh

Addresses: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agologger: realloc buffer when header size changed
Karel Zak [Thu, 21 Oct 2021 14:00:01 +0000 (16:00 +0200)] 
logger: realloc buffer when header size changed

This is probably paranoid optimization, but when we generate a new
header we need to be sure that buffer is not smaller than calculated
maximal size of user's data.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agologger: verify --size of large enough for message header
Karel Zak [Thu, 21 Oct 2021 13:40:41 +0000 (15:40 +0200)] 
logger: verify --size of large enough for message header

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agowdctl: update man page
Karel Zak [Thu, 21 Oct 2021 13:04:33 +0000 (15:04 +0200)] 
wdctl: update man page

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsfd: (adoc) add more exapmles
Masatake YAMATO [Wed, 20 Oct 2021 14:22:28 +0000 (23:22 +0900)] 
lsfd: (adoc) add more exapmles

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: remove --source option
Masatake YAMATO [Wed, 20 Oct 2021 13:29:45 +0000 (22:29 +0900)] 
lsfd: remove --source option

-Q '(SOURCE == ...)' works well for the same purpose.
See https://github.com/karelzak/util-linux/pull/1418#issuecomment-945643880

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: add KTHREAD column
Masatake YAMATO [Tue, 19 Oct 2021 08:05:08 +0000 (17:05 +0900)] 
lsfd: add KTHREAD column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for displaying symlinks
Masatake YAMATO [Fri, 15 Oct 2021 20:38:49 +0000 (05:38 +0900)] 
lsfd: (test) add a case for displaying symlinks

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for displaying COMMAND column
Masatake YAMATO [Fri, 15 Oct 2021 19:24:28 +0000 (04:24 +0900)] 
lsfd: (test) add a case for displaying COMMAND column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for displaying socket pairs
Masatake YAMATO [Fri, 15 Oct 2021 18:48:43 +0000 (03:48 +0900)] 
lsfd: (test) add a case for displaying socket pairs

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for displaying DEV column
Masatake YAMATO [Fri, 15 Oct 2021 17:47:03 +0000 (02:47 +0900)] 
lsfd: (test) add a case for displaying DEV column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) improve the code converting file descriptor numbers
Masatake YAMATO [Fri, 15 Oct 2021 17:34:38 +0000 (02:34 +0900)] 
lsfd: (helper) improve the code converting file descriptor numbers

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for displaying a character device
Masatake YAMATO [Fri, 15 Oct 2021 16:42:57 +0000 (01:42 +0900)] 
lsfd: (test) add a case for displaying a character device

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: add --debug-filter option
Masatake YAMATO [Fri, 15 Oct 2021 02:24:23 +0000 (11:24 +0900)] 
lsfd: add --debug-filter option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for testing SIZE column
Masatake YAMATO [Fri, 15 Oct 2021 02:04:27 +0000 (11:04 +0900)] 
lsfd: (test) add a case for testing SIZE column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for testing FLAGS (wronly,nonblock) column
Masatake YAMATO [Fri, 15 Oct 2021 01:59:05 +0000 (10:59 +0900)] 
lsfd: (test) add a case for testing FLAGS (wronly,nonblock) column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) add "nonblock" parameter to pipe-no-fork factory
Masatake YAMATO [Fri, 15 Oct 2021 01:58:03 +0000 (10:58 +0900)] 
lsfd: (helper) add "nonblock" parameter to pipe-no-fork factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) update examples in the help message
Masatake YAMATO [Fri, 15 Oct 2021 01:28:09 +0000 (10:28 +0900)] 
lsfd: (helper) update examples in the help message

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) add "dentries" parameter to directory factory
Masatake YAMATO [Thu, 14 Oct 2021 15:17:43 +0000 (00:17 +0900)] 
lsfd: (helper) add "dentries" parameter to directory factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) add "dir" parameter to directory factory
Masatake YAMATO [Thu, 14 Oct 2021 15:01:49 +0000 (00:01 +0900)] 
lsfd: (helper) add "dir" parameter to directory factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) test POS column
Masatake YAMATO [Thu, 14 Oct 2021 13:55:28 +0000 (22:55 +0900)] 
lsfd: (test) test POS column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) add "offset" parameter to ro-regular-file factory
Masatake YAMATO [Thu, 14 Oct 2021 13:51:49 +0000 (22:51 +0900)] 
lsfd: (helper) add "offset" parameter to ro-regular-file factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) accept an integer argument for a parameter
Masatake YAMATO [Thu, 14 Oct 2021 13:51:18 +0000 (22:51 +0900)] 
lsfd: (helper) accept an integer argument for a parameter

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) add "file" parameter to ro-regular-file factory
Masatake YAMATO [Thu, 14 Oct 2021 09:49:34 +0000 (18:49 +0900)] 
lsfd: (helper) add "file" parameter to ro-regular-file factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) allow to pass extra parameters
Masatake YAMATO [Thu, 14 Oct 2021 09:47:39 +0000 (18:47 +0900)] 
lsfd: (helper) allow to pass extra parameters

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) use more "const" modifiers
Masatake YAMATO [Thu, 14 Oct 2021 09:34:48 +0000 (18:34 +0900)] 
lsfd: (helper) use more "const" modifiers

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (helper) set proper errno before calling err()
Masatake YAMATO [Thu, 14 Oct 2021 13:46:30 +0000 (22:46 +0900)] 
lsfd: (helper) set proper errno before calling err()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (filter) accept % char as a part of column name
Masatake YAMATO [Fri, 15 Oct 2021 21:08:38 +0000 (06:08 +0900)] 
lsfd: (filter) accept % char as a part of column name

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (filter) fix a memory leak
Masatake YAMATO [Thu, 21 Oct 2021 11:54:38 +0000 (20:54 +0900)] 
lsfd: (filter) fix a memory leak

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: remove prototype decls for removed functions
Masatake YAMATO [Sun, 17 Oct 2021 11:01:09 +0000 (20:01 +0900)] 
lsfd: remove prototype decls for removed functions

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: declare local variables at the beginning of block
Masatake YAMATO [Thu, 21 Oct 2021 12:01:28 +0000 (21:01 +0900)] 
lsfd: declare local variables at the beginning of block

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agowdctl: add --setpregovernor
Karel Zak [Thu, 21 Oct 2021 11:09:58 +0000 (13:09 +0200)] 
wdctl: add --setpregovernor

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agowdctl: set_watchdog() refactoring
Karel Zak [Thu, 21 Oct 2021 10:38:16 +0000 (12:38 +0200)] 
wdctl: set_watchdog() refactoring

* keep wanted values in struct wd_control
* make set_watchdog() more readable

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agowdctl: print the current and available governors
Karel Zak [Thu, 21 Oct 2021 10:16:35 +0000 (12:16 +0200)] 
wdctl: print the current and available governors

 # wdctl
 ...
 Pre-timeout:    0 seconds
 Pre-timeout governor: noop
 Available pre-timeout governors: userspace noop panic
 ...

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agodocs: add links to adjtime_config manpage
Karel Zak [Thu, 21 Oct 2021 09:36:44 +0000 (11:36 +0200)] 
docs: add links to adjtime_config manpage

Fixes: https://github.com/karelzak/util-linux/issues/1478
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: split additional tests into subtests
Vojtěch Eichler [Tue, 19 Oct 2021 18:45:28 +0000 (20:45 +0200)] 
tests: split additional tests into subtests

4 years agobuild-sys: remove bashism
Karel Zak [Tue, 19 Oct 2021 16:54:31 +0000 (18:54 +0200)] 
build-sys: remove bashism

Addresses: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: Fix test/misc/swaplabel failure due to change in mkswap behaviour.
Mark Hindley [Mon, 18 Oct 2021 17:53:01 +0000 (17:53 +0000)] 
tests: Fix test/misc/swaplabel failure due to change in mkswap behaviour.

mkswap now warns if the image file has holes. If fallocate is used to create the
file, use POSIX semantics to ensure the file has no holes.

This fixes the test failure

misc: swaplabel                      ... FAILED (misc/swaplabel)
========= script: /build/util-linux-2.37.2/tests/ts/misc/swaplabel =================
================= OUTPUT =====================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= EXPECTED ===================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= O/E diff ===================
==============================================

The additional error appears in swaplabel.err:

 mkswap: <swapfile> contains holes or other unsupported extents.
         This swap file can be rejected by kernel on swap activation!
         Use --verbose for more details.

[zeha@debian.org: this appears to be important/required when building
inside cowbuilder, on an ext3 filesystem.]

Signed-off-by: Mark Hindley <mark@hindley.org.uk>
4 years agobuild-sys: make libtool patching more robust
Karel Zak [Tue, 19 Oct 2021 08:52:10 +0000 (10:52 +0200)] 
build-sys: make libtool patching more robust

Fixes: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agowdctl: sysfs open refactoring
Karel Zak [Tue, 19 Oct 2021 08:11:37 +0000 (10:11 +0200)] 
wdctl: sysfs open refactoring

Let's make the sysfs handler usable in more functions.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agowdctl: add --setpretimeout
Karel Zak [Tue, 19 Oct 2021 07:47:44 +0000 (09:47 +0200)] 
wdctl: add --setpretimeout

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agoblockdev: remove accidental non-breaking spaces
Chris Hofstaedtler [Mon, 18 Oct 2021 07:40:01 +0000 (07:40 +0000)] 
blockdev: remove accidental non-breaking spaces

commit 9147d2ad8abb73cea5799323fc73ccdaf675826f introduced these
C2A0 spaces, but without saying anything. Likely this was an
accident.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996751
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
4 years agomcookie: fix infinite-loop when use -f
Hiroaki Sengoku [Fri, 15 Oct 2021 05:02:46 +0000 (14:02 +0900)] 
mcookie: fix infinite-loop when use -f

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolsfd: remove duplicated an O_ flag entry
Masatake YAMATO [Fri, 15 Oct 2021 20:40:17 +0000 (05:40 +0900)] 
lsfd: remove duplicated an O_ flag entry

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agotests: split several tests into subtests
Vojtěch Eichler [Thu, 14 Oct 2021 10:33:45 +0000 (12:33 +0200)] 
tests: split several tests into subtests

4 years agobuild-sys: patch libtool.m4 for darwin
Karel Zak [Thu, 14 Oct 2021 10:17:31 +0000 (12:17 +0200)] 
build-sys: patch libtool.m4 for darwin

Fixes: https://github.com/karelzak/util-linux/issues/1468
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agotests: (logger) check for socat
Karel Zak [Thu, 14 Oct 2021 08:46:45 +0000 (10:46 +0200)] 
tests: (logger) check for socat

Addresses: https://github.com/karelzak/util-linux/issues/1466
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agosu: reset RLIMIT_AS too
Karel Zak [Thu, 14 Oct 2021 08:28:59 +0000 (10:28 +0200)] 
su: reset RLIMIT_AS too

Fixes: https://github.com/karelzak/util-linux/issues/1465
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agodocs: add note about GitHub PR
Karel Zak [Thu, 14 Oct 2021 08:22:14 +0000 (10:22 +0200)] 
docs: add note about GitHub PR

Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agofindmnt: (adoc) Added section stating exit code semantics
Mister Me [Thu, 7 Oct 2021 14:34:00 +0000 (08:34 -0600)] 
findmnt: (adoc) Added section stating exit code semantics

per issue #1464:

    https://github.com/karelzak/util-linux/issues/1464

[kzak@redhat.com: - move the text from DESCRIPTION to EXIT STATUS section]

Signed-off-by: Glenn Golden <gdg@zplane.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agobuild-sys: link lib_common to test_procfs
Masatake YAMATO [Sun, 10 Oct 2021 08:01:40 +0000 (17:01 +0900)] 
build-sys: link lib_common to test_procfs

Suggested by Thomas Weißschuh at
https://github.com/karelzak/util-linux/pull/1418#pullrequestreview-775639562

4 years agolsfd: (adoc) write about filter expression
Masatake YAMATO [Tue, 5 Oct 2021 14:55:30 +0000 (23:55 +0900)] 
lsfd: (adoc) write about filter expression

Charelle Collett helped me improve the setences.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add a case for displaying a directory
Masatake YAMATO [Mon, 11 Oct 2021 22:24:42 +0000 (07:24 +0900)] 
lsfd: (test) add a case for displaying a directory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: (test) add cases for displaying a regular file and pipe
Masatake YAMATO [Sun, 10 Oct 2021 00:58:55 +0000 (09:58 +0900)] 
lsfd: (test) add cases for displaying a regular file and pipe

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 years agolsfd: add FUID and OWNER columns
Masatake YAMATO [Mon, 11 Oct 2021 21:42:37 +0000 (06:42 +0900)] 
lsfd: add FUID and OWNER columns

UID and USER is for processes.
FUID and OWNER is for owners of files.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>