]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 years agolsblk: prefer MODEL from udev DB
Karel Zak [Mon, 10 Sep 2018 08:29:37 +0000 (10:29 +0200)] 
lsblk: prefer MODEL from udev DB

sysfs device model is truncated to 16 characters:

> cat /sys/block/sda/device/model
Crucial_CT128MX1
> udevadm info --query=property /dev/sda | grep MODEL=
ID_MODEL=Crucial_CT128MX100SSD1

sysfs uses INQUARY response which has the 16 characters limitation and
udev uses something else.

Addresses: https://github.com/karelzak/util-linux/issues/690
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoscript: be sensitive to another SIGCHLD ssi_codes
Karel Zak [Wed, 5 Sep 2018 09:51:22 +0000 (11:51 +0200)] 
script: be sensitive to another SIGCHLD ssi_codes

The current signalfd handler cares on CLD_EXITED only. It's pretty
insufficient as there is more situations (and codes) when child no
more running.

Addresses: https://github.com/karelzak/util-linux/issues/686
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolscpu: use the first VM from /proc/sysinfo
Karel Zak [Tue, 4 Sep 2018 12:30:37 +0000 (14:30 +0200)] 
lscpu: use the first VM from /proc/sysinfo

Addresses: https://github.com/karelzak/util-linux/issues/685
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolscpu: make xasprintf call more robust
Karel Zak [Tue, 4 Sep 2018 11:12:34 +0000 (13:12 +0200)] 
lscpu: make xasprintf call more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: default to /lib64 for ${exec_prefix}/lib64
Karel Zak [Tue, 4 Sep 2018 09:42:19 +0000 (11:42 +0200)] 
build-sys: default to /lib64 for ${exec_prefix}/lib64

We already default to /lib for the default $exec_prefix, but the current
configure does not care about /lib64 although the use-case is exactly
same as for /lib.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: remove obsolete entry from TODO
Karel Zak [Mon, 3 Sep 2018 13:53:41 +0000 (15:53 +0200)] 
docs: remove obsolete entry from TODO

Already implemented by commit cf654e1c3ec8f6f9ac93bf4f6981d560249868d9.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotest: update UUID v5 tests
Karel Zak [Fri, 31 Aug 2018 10:48:46 +0000 (12:48 +0200)] 
test: update UUID v5 tests

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibuuid: fix name-based UUIDs
Karel Zak [Fri, 31 Aug 2018 10:27:32 +0000 (12:27 +0200)] 
libuuid: fix name-based UUIDs

The current version is not fully compatible with RFC4122. It
incorrectly encodes UUID variant

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

where M is UUID version and N is UUID variant.

 $ python -c "import uuid ; print(uuid.uuid5(uuid.UUID(int=0), 'foo'))"
 aa752cea-8222-5bc8-acd9-555b090c0ccb
                    ^^

Old version:

 $ uuidgen --namespace 00000000-0000-0000-0000-000000000000 --name 'foo' --sha1
 aa752cea-8222-5bc8-8cd9-555b090c0ccb
                    ^^

Fixed version:
 ./uuidgen --namespace 00000000-0000-0000-0000-000000000000 --name 'foo' --sha1;
 aa752cea-8222-5bc8-acd9-555b090c0ccb
                    ^^

The patch uses uuid_unpack and uuid_pack. It makes code more readable
and allow to access proper octens. The same way we already use for
time and random based UUIDs.

Addresses: https://github.com/karelzak/util-linux/issues/683
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibuuid: add note about RFC4122 UUID layout
Karel Zak [Fri, 31 Aug 2018 08:08:46 +0000 (10:08 +0200)] 
libuuid: add note about RFC4122 UUID layout

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: update fdisk output
Karel Zak [Thu, 30 Aug 2018 13:24:41 +0000 (15:24 +0200)] 
tests: update fdisk output

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofdisk: add "Disk model:" to the print output
Karel Zak [Thu, 30 Aug 2018 12:01:54 +0000 (14:01 +0200)] 
fdisk: add "Disk model:" to the print output

Addresses: https://github.com/karelzak/util-linux/issues/682
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: add fdisk_get_devmodel() and fdisk_get_devno()
Karel Zak [Thu, 30 Aug 2018 12:01:46 +0000 (14:01 +0200)] 
libfdisk: add fdisk_get_devmodel() and fdisk_get_devno()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add note about lsblk usage/free cols
Karel Zak [Fri, 24 Aug 2018 10:04:24 +0000 (12:04 +0200)] 
docs: add note about lsblk usage/free cols

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: cleanup TODO
Karel Zak [Fri, 24 Aug 2018 09:28:43 +0000 (11:28 +0200)] 
docs: cleanup TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobash-completion: update column
Karel Zak [Thu, 23 Aug 2018 12:14:29 +0000 (14:14 +0200)] 
bash-completion: update column

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: add column --table-empty-lines test
Karel Zak [Thu, 23 Aug 2018 11:41:05 +0000 (13:41 +0200)] 
tests: add column --table-empty-lines test

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agocolumn: add --table-empty-lines
Karel Zak [Thu, 23 Aug 2018 11:31:29 +0000 (13:31 +0200)] 
column: add --table-empty-lines

The option allows to add empty line to the table. The default behavior
is to ignore empty lines at all.

echo -e "A\nAA\nAAA\n\nAAAA" | ./column --table
A
AA
AAA
AAAA

$ echo -e "A\nAA\nAAA\n\nAAAA" | ./column --table --table-empty-lines
A
AA
AAA

AAAA

Addresses: https://github.com/karelzak/util-linux/issues/593
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: don't mark as extreme where average is zero
Karel Zak [Thu, 23 Aug 2018 08:13:17 +0000 (10:13 +0200)] 
libsmartcols: don't mark as extreme where average is zero

The columns with NOEXTREME flag are internally marked as extreme
(=contains extreme width) if maximal with is greater than 2 *
average_width. This detection has to sure that the average is non-zero
otherwise the column is always "extreme".

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: allow to add line to table without columns
Karel Zak [Thu, 23 Aug 2018 08:02:49 +0000 (10:02 +0200)] 
libsmartcols: allow to add line to table without columns

The table allows to add columns on the fly when lines already exist.
So, it does not make sense to reject request to add line to table
without columns.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosetpriv: add --reset-env
Karel Zak [Wed, 22 Aug 2018 09:43:32 +0000 (11:43 +0200)] 
setpriv: add --reset-env

Clear environment in way like su(1), but PATH is set to hard-coded
defaults and /etc/login.defs is not used at all (I guess we want to
keep setpriv(1) simple).

If you need anything more advanced than use env(1).

Addresses: https://github.com/karelzak/util-linux/issues/325
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosu: add note about merged /usr
Karel Zak [Wed, 22 Aug 2018 09:39:13 +0000 (11:39 +0200)] 
su: add note about merged /usr

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosetpriv: add user/group names to usage()
Karel Zak [Wed, 22 Aug 2018 08:35:51 +0000 (10:35 +0200)] 
setpriv: add user/group names to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosetpriv: allow to use group name for --groups
Karel Zak [Wed, 22 Aug 2018 08:29:09 +0000 (10:29 +0200)] 
setpriv: allow to use group name for --groups

Addresses: https://github.com/karelzak/util-linux/issues/325
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosulogin: restore signals after failed exec() only
Karel Zak [Thu, 16 Aug 2018 14:16:40 +0000 (16:16 +0200)] 
sulogin: restore signals after failed exec() only

* removes unnecessary variable

* the current code restores signals always when shell has not been
  executed -- this is correct as function sushell() modify signal
  mask, but in all another cases we do not need touch the mask.
  Especially when we ask for the  password in endless while() loop...

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosulogin: do not use plain 0 as NULL
Karel Zak [Thu, 16 Aug 2018 13:58:20 +0000 (15:58 +0200)] 
sulogin: do not use plain 0 as NULL

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: cleanup licenses sections in the files
Karel Zak [Thu, 16 Aug 2018 13:43:53 +0000 (15:43 +0200)] 
libmount: cleanup licenses sections in the files

* add SPDX-License-Identifier (see https://spdx.org/licenses/)
* add "This file part of libmount from util-linux project."
* use proper text for LGPL-2.1-or-later
* use the same texts everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: use SPDX license names
Karel Zak [Thu, 16 Aug 2018 12:47:21 +0000 (14:47 +0200)] 
docs: use SPDX license names

Let's use standardized names for licenses. The names used by SPDX
makes things more obvious at first glance. For complete list see:
https://spdx.org/licenses/

Note, this commit does not change any license or so...

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofstrim: use -n shortcut for --dry-run
Karel Zak [Thu, 16 Aug 2018 12:00:45 +0000 (14:00 +0200)] 
fstrim: use -n shortcut for --dry-run

It seems 'n' is more common than 'd'. The patch also cleanup
getopt_long() options string.

Addresses: https://github.com/karelzak/util-linux/commit/fda0e2cf043994c77c29a2d109c03ce8957b1d38#commitcomment-30097920
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Thu, 16 Aug 2018 11:47:51 +0000 (13:47 +0200)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

* 'spelling' of https://github.com/jwilk-forks/util-linux:
  Fix man page typos

6 years agoFix man page typos
Jakub Wilk [Thu, 16 Aug 2018 09:08:42 +0000 (11:08 +0200)] 
Fix man page typos

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
6 years agofincore.1: add missing space
Jakub Wilk [Thu, 16 Aug 2018 08:34:56 +0000 (10:34 +0200)] 
fincore.1: add missing space

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
6 years agosu: add --whitelist-environment
Karel Zak [Fri, 10 Aug 2018 08:49:15 +0000 (10:49 +0200)] 
su: add --whitelist-environment

* usable with --login to whitelist specified environment variables

* the list is ignored for the core variables like HOME, SHELL, USER,
  LOGNAME and PATH (su --login always resets these variables)

Note that su(1) requires password and after successful authentication
user has full control over the session, so he can set arbitrary
environment variables. The whitelist makes things more user friendly
only.

The patch removes unnecessary optimization when allocate environ[]. It
seems better to keep all in glibc hands and just reset the environment
array only.

Addresses: https://github.com/karelzak/util-linux/issues/221
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: fix typo in man install
Karel Zak [Wed, 15 Aug 2018 09:47:17 +0000 (11:47 +0200)] 
build-sys: fix typo in man install

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: report context paths on debug
Karel Zak [Tue, 14 Aug 2018 19:03:42 +0000 (21:03 +0200)] 
libmount: report context paths on debug

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add adjtime_config(5) man page
Karel Zak [Tue, 14 Aug 2018 12:53:14 +0000 (14:53 +0200)] 
docs: add adjtime_config(5) man page

The file is pretty common, but undocumented by individual man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolscpu: fixed part ID for ARM Cortex-M7
Mark Sheppard [Mon, 13 Aug 2018 15:45:01 +0000 (16:45 +0100)] 
lscpu: fixed part ID for ARM Cortex-M7

6 years agolslogins: return 1 on "lslogins nonexisting"
Karel Zak [Mon, 13 Aug 2018 12:16:28 +0000 (14:16 +0200)] 
lslogins: return 1 on "lslogins nonexisting"

The default behavior for -l and -g is to silently ignore unknown login
names, but this is very confusing when you explicitly specify just one
login name.

Note that the current implementation also prints empty "Last log" for
nonexisting user. It seems ugly.

 # lslogins nonexisting

 Last logs:

new version:

 # lslogins nonexisting
 lt-lslogins: cannot found 'nonexisting'
 # echo $?
 1

The -l and -g behaviour has not been changed.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1614967
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolslogins: add info about single-user output mode
Karel Zak [Mon, 13 Aug 2018 11:49:26 +0000 (13:49 +0200)] 
lslogins: add info about single-user output mode

The supported command line synopsis is also

lslogins foo

and it provides different output than

lslogins -l foo

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agologger: add -S to the man page
Karel Zak [Fri, 10 Aug 2018 14:55:14 +0000 (16:55 +0200)] 
logger: add -S to the man page

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agomount: add ext4 to some places to the man page
Karel Zak [Fri, 10 Aug 2018 14:27:41 +0000 (16:27 +0200)] 
mount: add ext4 to some places to the man page

6 years agolosetup: add reference to suffixes for --{sizelimit,offset}
Karel Zak [Wed, 8 Aug 2018 11:12:27 +0000 (13:12 +0200)] 
losetup: add reference to suffixes for --{sizelimit,offset}

Reported-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofstrim: update .service to follow /etc/fstab
Karel Zak [Wed, 8 Aug 2018 09:35:58 +0000 (11:35 +0200)] 
fstrim: update .service to follow /etc/fstab

Replace -a with -A to discard mounted filesystems from /etc/fstab. The
original -a forces fstrim to try to discard all filesystems, including
for example manually mounted removable media.

It seems better for widely used .service unit to follow /etc/fstab.

Addresses: https://github.com/karelzak/util-linux/issues/673
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosetarch: make <arch> optional
Karel Zak [Tue, 7 Aug 2018 09:31:14 +0000 (11:31 +0200)] 
setarch: make <arch> optional

Let's allow to change personality flags without execution domain
modification.

Old way:
  setarch `arch` --addr-no-randomize myprog

New way:
  setarch --addr-no-randomize myprog

Addresses: https://github.com/karelzak/util-linux/issues/668
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: add cal --span tests
Karel Zak [Tue, 7 Aug 2018 09:06:13 +0000 (11:06 +0200)] 
tests: add cal --span tests

Addresses: https://github.com/karelzak/util-linux/issues/677
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: check for test_cal
Karel Zak [Tue, 7 Aug 2018 08:59:06 +0000 (10:59 +0200)] 
tests: check for test_cal

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agocal: fix --span for large numbers of months
Karel Zak [Tue, 7 Aug 2018 08:52:33 +0000 (10:52 +0200)] 
cal: fix --span for large numbers of months

The need to calculate with whole years when go back for --span.

Addresses: https://github.com/karelzak/util-linux/issues/677
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agocal: use snprintf everywhere
Karel Zak [Tue, 7 Aug 2018 08:15:42 +0000 (10:15 +0200)] 
cal: use snprintf everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosetarch: split set_arch() function to small functions
Karel Zak [Mon, 6 Aug 2018 14:32:36 +0000 (16:32 +0200)] 
setarch: split set_arch() function to small functions

It seems better to keep the code more flexibile by small one-purpose
functions than by one huge monster.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoagetty.8: Avoid a warning about an unbreakable line
Bjarni Ingi Gislason [Mon, 6 Aug 2018 00:51:13 +0000 (00:51 +0000)] 
agetty.8: Avoid a warning about an unbreakable line

  Make the indent depend on the formatting command, nroff or troff.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
6 years agoman pages: Fix misuse of two-fonts-macros (BR, IR)
Bjarni Ingi Gislason [Sun, 5 Aug 2018 22:05:48 +0000 (22:05 +0000)] 
man pages: Fix misuse of two-fonts-macros (BR, IR)

  Change a two-fonts-macro to the single font one, when there is only
one genuine argument.

  Split a punctuation mark from the only argument to a two-fonts-marco.

  Remove an isolated two-fonts-macro.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
6 years agoman pages: fix formatting of long lines in tables
Bjarni Ingi Gislason [Sun, 5 Aug 2018 18:51:25 +0000 (18:51 +0000)] 
man pages: fix formatting of long lines in tables

  Define the allowed length of the last (second) column to use the
whole line for text.

  Use text blocks for long lines.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
6 years agoman pages: Remove "left" (or change to "l") in the column formats of tables
Bjarni Ingi Gislason [Fri, 3 Aug 2018 21:12:04 +0000 (21:12 +0000)] 
man pages: Remove "left" (or change to "l") in the column formats of tables

  A developmental version of "groff" issued a warning, for example with
"test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z":

troff: <logger.1>:299: warning: can't find font 't'

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
6 years agosu: add note about SIGKILL to the man page
Karel Zak [Fri, 3 Aug 2018 12:08:00 +0000 (14:08 +0200)] 
su: add note about SIGKILL to the man page

Addresses: https://github.com/karelzak/util-linux/issues/443
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'patch-1' of https://github.com/pmarillo/util-linux
Karel Zak [Fri, 3 Aug 2018 11:19:51 +0000 (13:19 +0200)] 
Merge branch 'patch-1' of https://github.com/pmarillo/util-linux

* 'patch-1' of https://github.com/pmarillo/util-linux:
  Fix translation typo

6 years agohwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc
Karel Zak [Fri, 3 Aug 2018 11:08:21 +0000 (13:08 +0200)] 
hwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc

It's kernel business to return EINVAL for unsupported RTC_UIE_ON. We
(userspace) should not make decisions about things that we do not
control.

If kernel is wrong then fix the kernel, don't hide the problem by
crazy ifdefs in userspace.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agomesg: do not print 'ttyname failed' message unless --verbose requested
Sami Kerola [Thu, 2 Aug 2018 18:35:51 +0000 (19:35 +0100)] 
mesg: do not print 'ttyname failed' message unless --verbose requested

Lots of people are confused why mesg(1) is priting this message.  Usual
cause seems to be an uninteractive shell trying to turn running 'mesg n'
from a /root/.profile where command invocation is by default on debian based
systems.  This might be rare case when failing silently is better.

[kzak@redhat.com: - add note to the man page
                  - fix if(isatty()) logic]

Reference: https://www.google.com/search?q=mesg+ttyname+failed
Review: https://marc.info/?l=util-linux-ng&m=153319988631233&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoFix translation typo
Paul M [Fri, 3 Aug 2018 07:58:54 +0000 (09:58 +0200)] 
Fix translation typo

6 years agotests: update lscpu tests
Karel Zak [Wed, 1 Aug 2018 10:09:09 +0000 (12:09 +0200)] 
tests: update lscpu tests

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofdisk: fix error message on 'd' command
Karel Zak [Wed, 1 Aug 2018 07:29:12 +0000 (09:29 +0200)] 
fdisk: fix error message on 'd' command

Command (m for help): d
No partition is defined yet!
Could not delete partition 93840461057817    <--- !

Don't print 'Could not delete..' if no partition is defined yet.

Addresses: https://github.com/karelzak/util-linux/issues/667
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoumount: add --quiet option
Karel Zak [Wed, 1 Aug 2018 07:10:07 +0000 (09:10 +0200)] 
umount: add --quiet option

The command umount supports things like --all-targets and --recursive
to umount all nodes in specified tree. Sometimes it makes sense to
aggressively use wildcards like /dev/sdb* and in this case --quiet
seems like a good choice

umount --quiet --all-targets /dev/sdb*

to suppress 'not mounted' error messages. The new option suppress only
these error messages and nothing else.

Addresses: https://github.com/karelzak/util-linux/issues/672
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolscpu: add 'Address sizes'
Karel Zak [Wed, 1 Aug 2018 06:33:32 +0000 (08:33 +0200)] 
lscpu: add 'Address sizes'

Addresses: https://github.com/karelzak/util-linux/issues/674
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofstrim: add -A|--fstab to trim according to /etc/fstab
Karel Zak [Tue, 31 Jul 2018 14:38:59 +0000 (16:38 +0200)] 
fstrim: add -A|--fstab to trim according to /etc/fstab

Addresses: https://github.com/karelzak/util-linux/issues/673
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofstrim: add control struct
Karel Zak [Tue, 31 Jul 2018 13:58:49 +0000 (15:58 +0200)] 
fstrim: add control struct

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: update fdisk dialogs
Karel Zak [Tue, 31 Jul 2018 13:20:55 +0000 (15:20 +0200)] 
tests: update fdisk dialogs

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: Accept negative numbers for last sector input
Awal Garg [Sat, 28 Jul 2018 13:20:35 +0000 (18:50 +0530)] 
libfdisk: Accept negative numbers for last sector input

[kzak@redhat.com: - add note to the man page
                  - add '-' to the dialog query
                  - cleanup functions names and libfdisk.sym]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agohwclock: remove ntpd from man page
Karel Zak [Tue, 31 Jul 2018 09:07:47 +0000 (11:07 +0200)] 
hwclock: remove ntpd from man page

It seems better to use generic "NTP daemon" in the man page than
points to specific ntpd(1) implementation as some distros use for
example chronyd(1) rather than old ntpd(1).

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolscpu: fix resource leak [coverity scan]
Karel Zak [Wed, 25 Jul 2018 10:02:28 +0000 (12:02 +0200)] 
lscpu: fix resource leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolosetup: fix mem leak, improve code [coverity scan]
Karel Zak [Wed, 25 Jul 2018 09:56:44 +0000 (11:56 +0200)] 
losetup: fix mem leak, improve code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibblkid: use xstrncpy() for PT id [coverity scan]
Karel Zak [Wed, 25 Jul 2018 09:25:33 +0000 (11:25 +0200)] 
libblkid: use xstrncpy() for PT id [coverity scan]

It's probably unnecessary change as blkid_parttable_set_id() is used
by MBR code and we use proper buffer size there, but better safe than
sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: add note about --disable-all-programs
Karel Zak [Tue, 24 Jul 2018 10:35:45 +0000 (12:35 +0200)] 
docs: add note about --disable-all-programs

Addresses: https://github.com/karelzak/util-linux/issues/666
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocfdisk: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 11:08:56 +0000 (13:08 +0200)] 
cfdisk: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoblkid: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 10:30:30 +0000 (12:30 +0200)] 
blkid: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agologin: use const qualifier for username from PAM or struct passwd [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 10:21:33 +0000 (12:21 +0200)] 
login: use const qualifier for username from PAM or struct passwd [-Wcast-qual]

It seems more robust to use 'const' qualifier for username if this
variable points to external resources like PAM or struct passwd. The
patch introduces new variable cmd_username for username specified on
login(1) command line.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: (utils) fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:58:57 +0000 (11:58 +0200)] 
libmount: (utils) fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/colors:: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:55:25 +0000 (11:55 +0200)] 
lib/colors:: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosetterm: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:49:49 +0000 (11:49 +0200)] 
setterm: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosetterm: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:45:15 +0000 (11:45 +0200)] 
setterm: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoswapon: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:43:47 +0000 (11:43 +0200)] 
swapon: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agomkswap: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:43:30 +0000 (11:43 +0200)] 
mkswap: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: fix compiler warnings [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:39:13 +0000 (11:39 +0200)] 
libfdisk: fix compiler warnings [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: fix compiler warning [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:33:05 +0000 (11:33 +0200)] 
libmount: fix compiler warning [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/loopdev: fix compiler warning [-Wcast-qual]
Karel Zak [Mon, 23 Jul 2018 09:17:28 +0000 (11:17 +0200)] 
lib/loopdev: fix compiler warning [-Wcast-qual]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/mangle: const quialifier cleanup
Karel Zak [Fri, 20 Jul 2018 13:31:42 +0000 (15:31 +0200)] 
lib/mangle: const quialifier cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoinclude/list, include/c: update and container_of()
Karel Zak [Fri, 20 Jul 2018 13:22:35 +0000 (15:22 +0200)] 
include/list, include/c: update and container_of()

* update container_of() to version without "const" qualifier

* use container_of() in list_entry()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibblkid: const qualifier cleanup
Karel Zak [Fri, 20 Jul 2018 13:03:01 +0000 (15:03 +0200)] 
libblkid: const qualifier cleanup

* use "const" in functions where we don't modify arguments

* use "const" when cast from const buffer to any struct (superblock etc.)

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoinclude/all-io: const cleanup
Karel Zak [Fri, 20 Jul 2018 12:53:25 +0000 (14:53 +0200)] 
include/all-io: const cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: cleanup const in umount code
Karel Zak [Fri, 20 Jul 2018 12:15:42 +0000 (14:15 +0200)] 
libmount: cleanup const in umount code

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/color-names: const cleanup
Karel Zak [Fri, 20 Jul 2018 11:58:10 +0000 (13:58 +0200)] 
lib/color-names: const cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: add missing const
Karel Zak [Fri, 20 Jul 2018 11:51:52 +0000 (13:51 +0200)] 
libmount: add missing const

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: use const char in swaps parser
Karel Zak [Fri, 20 Jul 2018 11:44:53 +0000 (13:44 +0200)] 
libmount: use const char in swaps parser

The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: use const char in mountinfo parser
Karel Zak [Fri, 20 Jul 2018 11:44:53 +0000 (13:44 +0200)] 
libmount: use const char in mountinfo parser

The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: use const char in fstab parser
Karel Zak [Fri, 20 Jul 2018 11:44:53 +0000 (13:44 +0200)] 
libmount: use const char in fstab parser

The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/strutils: follow const in parse_size()
Karel Zak [Fri, 20 Jul 2018 10:52:55 +0000 (12:52 +0200)] 
lib/strutils: follow const in parse_size()

* don't cast from char to const char

* don't share endptr from strtoxxx() with rest of the code
  as the end pointer is char, but code works with const chars

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoinclude/strutils: remove unnecessary cast
Karel Zak [Fri, 20 Jul 2018 10:52:09 +0000 (12:52 +0200)] 
include/strutils: remove unnecessary cast

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agohwclock: fix warning
Karel Zak [Fri, 20 Jul 2018 10:25:38 +0000 (12:25 +0200)] 
hwclock: fix warning

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: add -Wdiscarded-qualifiers
Karel Zak [Fri, 20 Jul 2018 10:15:31 +0000 (12:15 +0200)] 
build-sys: add -Wdiscarded-qualifiers

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agomount: add details about mtab and --namespace to mount.8
Karel Zak [Thu, 19 Jul 2018 09:41:31 +0000 (11:41 +0200)] 
mount: add details about mtab and --namespace to mount.8

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: add since tag for new functions
Karel Zak [Thu, 19 Jul 2018 09:38:48 +0000 (11:38 +0200)] 
libmount: add since tag for new functions

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolsblk: add note about --list -I <maj,...>
Karel Zak [Wed, 18 Jul 2018 14:21:01 +0000 (16:21 +0200)] 
lsblk: add note about --list -I <maj,...>

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agohwclock: add --delay <seconds>
Karel Zak [Wed, 18 Jul 2018 11:59:15 +0000 (13:59 +0200)] 
hwclock: add --delay <seconds>

* add command line option --delay <seconds>

* read RTC type from /sys/class/rtc/rtc<N>/name

* default to 0.5 (500ms) for rtc_cmos or when RTC type is impossible
  determine; otherwise delay is 0.

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