]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
7 years agolsblk: try device/dev to read devno
Karel Zak [Fri, 9 Feb 2018 13:18:18 +0000 (14:18 +0100)] 
lsblk: try device/dev to read devno

Now sysfs_devname_to_devno() reads devno from /dev or
/sys/block/<name>/dev, but it seems that NVME uses
/sys/block/<name>/device/dev.

Reported-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update TODO
Karel Zak [Wed, 7 Feb 2018 10:37:32 +0000 (11:37 +0100)] 
docs: update TODO

Let's think about "mount --onlyonce".

Addresses: https://github.com/karelzak/util-linux/issues/448
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocal: clean up man page synopsis syntax
Karel Zak [Wed, 7 Feb 2018 10:06:58 +0000 (11:06 +0100)] 
cal: clean up man page synopsis syntax

Let's use '[ ]' rather than '< >' to be compatible with our another
man pages. Note that all time addressing on cal(1) command line is
optional.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1542883
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update TODO
Karel Zak [Wed, 7 Feb 2018 09:36:28 +0000 (10:36 +0100)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agomount: add note about "already mounted" behavior
Karel Zak [Mon, 5 Feb 2018 11:18:49 +0000 (12:18 +0100)] 
mount: add note about "already mounted" behavior

Addresses: https://github.com/karelzak/util-linux/issues/448
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: add mpool blkid test image
Karel Zak [Mon, 5 Feb 2018 10:58:09 +0000 (11:58 +0100)] 
tests: add mpool blkid test image

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofindmnt.8: remove spurious spaces before "--tree" and "--verbose"
Jakub Wilk [Sun, 4 Feb 2018 18:31:17 +0000 (19:31 +0100)] 
findmnt.8: remove spurious spaces before "--tree" and "--verbose"

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
7 years agotests: rewrite cal(1) bigyear test
Karel Zak [Fri, 2 Feb 2018 09:31:24 +0000 (10:31 +0100)] 
tests: rewrite cal(1) bigyear test

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: use TS_HELPER_CAL
Karel Zak [Fri, 2 Feb 2018 09:16:27 +0000 (10:16 +0100)] 
tests: use TS_HELPER_CAL

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocal: add ifdef TEST_CAL
Karel Zak [Fri, 2 Feb 2018 09:05:15 +0000 (10:05 +0100)] 
cal: add ifdef TEST_CAL

The test program follows CAL_TEST_TIME=<sec> rather than libc time().
It allows to use cal(1) in regression tests in cases where output
depends on the current time.

(We already use the same for example for logger.)

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: update setarch test
Karel Zak [Thu, 1 Feb 2018 15:53:45 +0000 (16:53 +0100)] 
tests: update setarch test

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: fix debug message
Karel Zak [Thu, 1 Feb 2018 15:52:14 +0000 (16:52 +0100)] 
libmount: fix debug message

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosys-utils: use errexec()
Karel Zak [Thu, 1 Feb 2018 14:44:25 +0000 (15:44 +0100)] 
sys-utils: use errexec()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agovipw: use errexec()
Karel Zak [Thu, 1 Feb 2018 14:41:42 +0000 (15:41 +0100)] 
vipw: use errexec()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agonewgrp: use errexec()
Karel Zak [Thu, 1 Feb 2018 14:41:23 +0000 (15:41 +0100)] 
newgrp: use errexec()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoschedutils: use errexec()
Karel Zak [Thu, 1 Feb 2018 14:40:59 +0000 (15:40 +0100)] 
schedutils: use errexec()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotext-utils: use errexec()
Karel Zak [Thu, 1 Feb 2018 14:40:43 +0000 (15:40 +0100)] 
text-utils: use errexec()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/exec_shell: (and pager) use errexec()
Karel Zak [Thu, 1 Feb 2018 14:38:24 +0000 (15:38 +0100)] 
lib/exec_shell: (and pager) use errexec()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosu: use errexec()
Karel Zak [Thu, 1 Feb 2018 14:37:22 +0000 (15:37 +0100)] 
su: use errexec()

The new macro is fully compatible with original (coreutils) code.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoinclude/c: add errexec()
Karel Zak [Thu, 1 Feb 2018 13:58:52 +0000 (14:58 +0100)] 
include/c: add errexec()

The new errexec() macro consolidate and unify the way how util-linux
tools react to failed exec()-like functions:

 * exit code 126 when program located, but not usable
 * exit code 127 when could not find program to exec

The exit codes are compatible with coreutils.

Note that all the change is located in c.h; the file exitcodes.h
contains API specific (mkfs, fsck, ...) codes only.

Addresses: https://github.com/karelzak/util-linux/pull/311
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofindfs: don't include exitcodes.h
Karel Zak [Thu, 1 Feb 2018 13:49:49 +0000 (14:49 +0100)] 
findfs: don't include exitcodes.h

The code uses findfs return codes only.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofstrim: don't include exitcodes.h
Karel Zak [Thu, 1 Feb 2018 13:49:49 +0000 (14:49 +0100)] 
fstrim: don't include exitcodes.h

The code uses generic and libmount return codes only.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: gtkdoc-fixxref v1.27 requires module option
Karel Zak [Thu, 1 Feb 2018 12:23:40 +0000 (13:23 +0100)] 
build-sys: gtkdoc-fixxref v1.27 requires module option

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agomisc: remove %p from debug messages
Karel Zak [Thu, 1 Feb 2018 12:18:57 +0000 (13:18 +0100)] 
misc: remove %p from debug messages

From libs where suid program may be executed by non-root user.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolib/exec_shell: cleanup function attributes
Karel Zak [Thu, 1 Feb 2018 11:25:39 +0000 (12:25 +0100)] 
lib/exec_shell: cleanup function attributes

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoMerge branch 'libblkid-atari' of https://github.com/yontalcar/util-linux
Karel Zak [Wed, 31 Jan 2018 10:08:06 +0000 (11:08 +0100)] 
Merge branch 'libblkid-atari' of https://github.com/yontalcar/util-linux

* 'libblkid-atari' of https://github.com/yontalcar/util-linux:
  libblkid: atari - reject devices with blocksize != 512
  libblkid: atari - don't add duplicate entries
  libblkid: atari - test if any partition fits disk size
  tests: added missing expected outputs for partx (atari)
  libblkid: atari - fix bad variable name
  tests: added test for libblkid atari pt
  libblkid: Support for Atari partitioning scheme

7 years agodocs: update TODO
Karel Zak [Wed, 31 Jan 2018 10:06:40 +0000 (11:06 +0100)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: update cal(1) tests
Karel Zak [Tue, 30 Jan 2018 15:19:14 +0000 (16:19 +0100)] 
tests: update cal(1) tests

* remove extra space after year output
f066c107ce6b76b4b11b239b9ab77561d4e0b84e

* don't print blank space behind last char on row
8315a2ff1507571ef14d77beac867b34a7d5e6da

* print just specified number of month for -1, -3 and -n
        2bcf8f7934649a5ee7925cdfdb12ca5abbf59b38

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocal: remove extra space after year output
Karel Zak [Tue, 30 Jan 2018 15:17:10 +0000 (16:17 +0100)] 
cal: remove extra space after year output

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocal: don't use year header for -1, -3 or -n
Karel Zak [Tue, 30 Jan 2018 15:14:15 +0000 (16:14 +0100)] 
cal: don't use year header for -1, -3 or -n

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocal: follow terminal width
Karel Zak [Tue, 30 Jan 2018 14:38:06 +0000 (15:38 +0100)] 
cal: follow terminal width

* modify number of months in row according to the terminal width
* don't print blank space behind last char on row

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibblkid: atari - reject devices with blocksize != 512
Vaclav Dolezal [Tue, 30 Jan 2018 12:50:15 +0000 (13:50 +0100)] 
libblkid: atari - reject devices with blocksize != 512

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agobuild-sys: (configure) fix bashisms
Mike Frysinger [Thu, 25 Jan 2018 04:21:49 +0000 (23:21 -0500)] 
build-sys: (configure) fix bashisms

The `test` command only recognizes =, not ==.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 years agozramctl: use xstrdup()
Karel Zak [Tue, 30 Jan 2018 11:21:03 +0000 (12:21 +0100)] 
zramctl: use xstrdup()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoAdded the support for lz4hc, deflate, and 842
Libor Bukata [Wed, 24 Jan 2018 16:10:09 +0000 (17:10 +0100)] 
Added the support for lz4hc, deflate, and 842
compression algorithms in zramctl utility.

Signed-off-by: Libor Bukata <lbukata@gmail.com>
7 years agolibblkid: atari - don't add duplicate entries
Vaclav Dolezal [Wed, 24 Jan 2018 12:52:49 +0000 (13:52 +0100)] 
libblkid: atari - don't add duplicate entries

This should protect against looped XGMs.

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agolibblkid: atari - test if any partition fits disk size
Vaclav Dolezal [Wed, 24 Jan 2018 12:38:14 +0000 (13:38 +0100)] 
libblkid: atari - test if any partition fits disk size

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agocal: do not set months_in_row with -3 option
J William Piggott [Mon, 22 Jan 2018 20:07:15 +0000 (15:07 -0500)] 
cal: do not set months_in_row with -3 option

Having the -3 option set months_in_row causes ordinal days
to wrap; it overrides the automatic handling of months_in_row
that falls back to 2 month columns for ordinal days.

Before:
cal -3j 2020
                           2020

            July                         August                      September
Sun Mon Tue Wed Thu Fri Sat   Sun Mon Tue Wed Thu Fri Sat   Sun Mon Tue Wed Thu Fri Sat
    182 183 184 185 186 187                   213 214 215   244 245 246 247 248 249 250
188 189 190 191 192 193 194   216 217 218 219 220 221 222   251 252 253 254 255 256 257
195 196 197 198 199 200 201   223 224 225 226 227 228 229   258 259 260 261 262 263 264
202 203 204 205 206 207 208   230 231 232 233 234 235 236   265 266 267 268 269 270 271
209 210 211 212               237 238 239 240 241 242 243   272 273

Patched:
cal -3j 2020
                           2020

          December                      January
Sun Mon Tue Wed Thu Fri Sat   Sun Mon Tue Wed Thu Fri Sat
335 336 337 338 339 340 341                 1   2   3   4
342 343 344 345 346 347 348     5   6   7   8   9  10  11
349 350 351 352 353 354 355    12  13  14  15  16  17  18
356 357 358 359 360 361 362    19  20  21  22  23  24  25
363 364 365                    26  27  28  29  30  31

          February
Sun Mon Tue Wed Thu Fri Sat
                         32
 33  34  35  36  37  38  39
 40  41  42  43  44  45  46
 47  48  49  50  51  52  53
 54  55  56  57  58  59  60

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agocal: honor num_months when only a year argument
J William Piggott [Mon, 22 Jan 2018 20:05:08 +0000 (15:05 -0500)] 
cal: honor num_months when only a year argument

I don't know if this was an oversight or an overzealous
interpretation of POSIX. Just in case, I'll address the
POSIX possibility. POSIX description for cal(1) says:

  If only the year operand is given, cal shall produce a
  calendar for all twelve months in the given calendar year.

It also says that cal(1) has no options, so in that context
if an option is given then it should be expected to override
POSIX behavior.

Before patched all of these command displayed a full year:
cal -1 2020
cal -3 2020
cal -n6 2020

Patched the number of months options are honored.

This patch also fixes the -1 option which was a no-op.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agomount(8): drop redundant filesystem-specific sections
Mike Frysinger [Fri, 19 Jan 2018 18:45:20 +0000 (13:45 -0500)] 
mount(8): drop redundant filesystem-specific sections

Add a new section to the top of the filesystem-specific chapter to point
people generally to the filesystem-specific man pages.  This way we can
delete all the redundant subsections that say the same thing.

These subsections are deleted because they offer no options.  Which is
the same as all the filesystems the kernel supports but this man page
doesn't explicitly list (of which there are a few).
  coherent minix ramfs romfs squashfs sysv xenix

These subsections are deleted because they simply point to the respective
<fs>(5) or mount.<fs>(8) page which we now document at the top.  Some also
discuss the syscall ABI, but that doesn't seem appropriate for this page.
  btrfs cifs ext2 ext3 ext4 nfs nfs4 proc smbfs tmpfs xfs

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 years agorfkill: provide RFKILL_TYPE_FM if undefined
Ruediger Meier [Tue, 23 Jan 2018 15:59:28 +0000 (16:59 +0100)] 
rfkill: provide RFKILL_TYPE_FM if undefined

As discussed last year it's nice to be compatible to 2.6.32
https://www.spinics.net/lists/util-linux-ng/msg13963.html

BTW also re-define NUM_RFKILL_TYPES if needed, although we are
not really using it.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agotests: fix fincore/count KNOWN_FAIL
Ruediger Meier [Tue, 23 Jan 2018 15:59:27 +0000 (16:59 +0100)] 
tests: fix fincore/count KNOWN_FAIL

It has to be set after calling ts_init.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agotests: suppress warning for old sync(1)
root [Tue, 23 Jan 2018 15:59:26 +0000 (16:59 +0100)] 
tests: suppress warning for old sync(1)

Old sync(1) prints a warning which looks ugly among our
test output: "sync: ignoring all arguments"

Seen on travis, Ubuntu <= 14.04 (Trusty).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agofsck.cramfs: fix error message
Ruediger Meier [Tue, 23 Jan 2018 15:59:25 +0000 (16:59 +0100)] 
fsck.cramfs: fix error message

errno is invalid in case that we just read(3) too short.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agotests: rewrite fsck-bad-header
Ruediger Meier [Tue, 23 Jan 2018 15:59:24 +0000 (16:59 +0100)] 
tests: rewrite fsck-bad-header

Fix test for systems with pagesize != 4096
Loop over many combinations of sizes, endianness and blocksizes.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agofsck.cramfs: fix crash when superblock size is too small
Ruediger Meier [Tue, 23 Jan 2018 15:59:23 +0000 (16:59 +0100)] 
fsck.cramfs: fix crash when superblock size is too small

This hopefully fixes the original problem addressed by the reverted
patch 7cb962c7.

The bug was introduced by myself in
    f991dbd3 "fsck.cramfs: allow smaller superblock sizes"

CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agoRevert "fsck.cramfs: Fix bus error on broken file system."
Ruediger Meier [Tue, 23 Jan 2018 15:59:22 +0000 (16:59 +0100)] 
Revert "fsck.cramfs: Fix bus error on broken file system."

This reverts commit 7cb962c77015e9383b53eeb22ce732cb5216bbc3.

It can't be right that we mmap (start + super.size) bytes from a file
which is usually only super.size bytes large. The patch "fixed" a
problem when super.size is bad but now it fails for the correct case:

$ mkdir -p root/subdir
$ ./mkfs.cramfs -p root cramfs
$ ./fsck.cramfs cramfs
Bus error (core dumped)

We will fix the original problem later.

CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agotests: added missing expected outputs for partx (atari)
Vaclav Dolezal [Wed, 24 Jan 2018 11:20:11 +0000 (12:20 +0100)] 
tests: added missing expected outputs for partx (atari)

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agolibblkid: atari - fix bad variable name
Vaclav Dolezal [Wed, 24 Jan 2018 11:16:23 +0000 (12:16 +0100)] 
libblkid: atari - fix bad variable name

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agotests: added test for libblkid atari pt
Vaclav Dolezal [Tue, 23 Jan 2018 15:10:59 +0000 (16:10 +0100)] 
tests: added test for libblkid atari pt

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agolibblkid: Support for Atari partitioning scheme
Vaclav Dolezal [Wed, 10 Jan 2018 16:58:39 +0000 (17:58 +0100)] 
libblkid: Support for Atari partitioning scheme

Addresses: https://github.com/karelzak/util-linux/issues/517
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agotests: use subtests for weeknum cal(1) tests
Karel Zak [Mon, 22 Jan 2018 16:09:25 +0000 (17:09 +0100)] 
tests: use subtests for weeknum cal(1) tests

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: use subtests for weekarg cal(1) tests
Karel Zak [Mon, 22 Jan 2018 15:55:07 +0000 (16:55 +0100)] 
tests: use subtests for weekarg cal(1) tests

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotest: use subtests for jan1753 cal(1) test
Karel Zak [Mon, 22 Jan 2018 15:54:06 +0000 (16:54 +0100)] 
test: use subtests for jan1753 cal(1) test

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: merge year cal(1) tests
Karel Zak [Mon, 22 Jan 2018 14:59:06 +0000 (15:59 +0100)] 
tests: merge year cal(1) tests

* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: merge 1m and 3m cal(1) tests
Karel Zak [Mon, 22 Jan 2018 14:53:00 +0000 (15:53 +0100)] 
tests: merge 1m and 3m cal(1) tests

* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: merge sep1752 cal(1) tests
Karel Zak [Mon, 22 Jan 2018 14:46:01 +0000 (15:46 +0100)] 
tests: merge sep1752 cal(1) tests

* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: use subtests for sep1752w test
Karel Zak [Mon, 22 Jan 2018 14:01:05 +0000 (15:01 +0100)] 
tests: use subtests for sep1752w test

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: simplify cal(1) sep1752w test
Karel Zak [Mon, 22 Jan 2018 13:37:43 +0000 (14:37 +0100)] 
tests: simplify cal(1) sep1752w test

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: add cal(1) --week=40 1752
Karel Zak [Mon, 22 Jan 2018 13:26:39 +0000 (14:26 +0100)] 
tests: add cal(1) --week=40 1752

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocal: fix first week calculation
J William Piggott [Mon, 22 Jan 2018 12:03:27 +0000 (07:03 -0500)] 
cal: fix first week calculation

Commit efafeaf set 1 Jan as week 1, but the change
was missed in week_to_day() and in the man page.

Before
cal --week=40 --iso 1752
      October 1752
   Su Mo Tu We Th Fr Sa
41  1  2  3  4  5  6  7
42  8  9 10 11 12 13 14
43 15 16 17 18 19 20 21
44 22 23 24 25 26 27 28
45 29 30 31

Patched
cal --week=40 --iso 1752
     September 1752
   Su Mo Tu We Th Fr Sa
36                 1  2
37  3  4  5  6  7  8  9
38 10 11 12 13 14 15 16
39 17 18 19 20 21 22 23
40 24 25 26 27 28 29 30

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agocal: fix week calculations for 1752
J William Piggott [Mon, 22 Jan 2018 12:01:23 +0000 (07:01 -0500)] 
cal: fix week calculations for 1752

Before:
cal --week=39 1752
     September 1752
   Su Mo Tu We Th Fr Sa
36        1  2 14 15 16
37 17 18 19 20 21 22 23
38 24 25 26 27 28 29 30

Patched:
cal --week=39 1752
      October 1752
   Su Mo Tu We Th Fr Sa
39  1  2  3  4  5  6  7
40  8  9 10 11 12 13 14
41 15 16 17 18 19 20 21
42 22 23 24 25 26 27 28
43 29 30 31

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agoMerge branch 'patch-2' of https://github.com/sourcejedi/util-linux
Karel Zak [Mon, 22 Jan 2018 13:01:42 +0000 (14:01 +0100)] 
Merge branch 'patch-2' of https://github.com/sourcejedi/util-linux

* 'patch-2' of https://github.com/sourcejedi/util-linux:
  mount(8): umount does not (anymore?) say `none busy'

7 years agomount: be more accurate in man page about propagation flags
Karel Zak [Mon, 22 Jan 2018 12:54:49 +0000 (13:54 +0100)] 
mount: be more accurate in man page about propagation flags

Addresses: https://github.com/karelzak/util-linux/issues/565
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoMerge branch 'master' of https://github.com/rluzynski/util-linux
Karel Zak [Mon, 22 Jan 2018 12:31:22 +0000 (13:31 +0100)] 
Merge branch 'master' of https://github.com/rluzynski/util-linux

* 'master' of https://github.com/rluzynski/util-linux:
  cal: Use ALTMON_* correctly

7 years agolscpu: (arm) cleanup code
Karel Zak [Mon, 22 Jan 2018 12:20:51 +0000 (13:20 +0100)] 
lscpu: (arm) cleanup code

* check for strtol() errors
* fix indention
* fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolscpu: move ARM decoding to lscpu-arm.c
Karel Zak [Mon, 22 Jan 2018 12:08:11 +0000 (13:08 +0100)] 
lscpu: move ARM decoding to lscpu-arm.c

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolscpu: move struct lscpu_desc header file
Karel Zak [Mon, 22 Jan 2018 11:59:11 +0000 (12:59 +0100)] 
lscpu: move struct lscpu_desc header file

The lscpu code is growing and it seems better to allow to make code
more structured.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoMerge branch 'arm-cpus' of https://github.com/suihkulokki/util-linux
Karel Zak [Mon, 22 Jan 2018 11:47:47 +0000 (12:47 +0100)] 
Merge branch 'arm-cpus' of https://github.com/suihkulokki/util-linux

* 'arm-cpus' of https://github.com/suihkulokki/util-linux:
  lscpu: Decode ARM CPUs

7 years agocal: Use ALTMON_* correctly
Rafal Luzynski [Tue, 21 Mar 2017 08:27:08 +0000 (09:27 +0100)] 
cal: Use ALTMON_* correctly

cal: use ALTMON_* and _NL_ABALTMON_* constants to display
months in a standalone form correctly.  These constants have just
been newly added to glibc.  ALTMON_x has been used in BSD family
since 1990s and has been accepted as the future POSIX extension.
_NL_ABALTMON_* is exclusively a GNU extension but it is expected
to be added to POSIX in future.

More info: https://sourceware.org/bugzilla/show_bug.cgi?id=10871

7 years agocal: fix julian calendars for large years
J William Piggott [Thu, 18 Jan 2018 02:21:02 +0000 (21:21 -0500)] 
cal: fix julian calendars for large years

Before:
cal --r julian 31 12 2147483646
 December 2147483646
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Patched:
cal --r julian 31 12 2147483646
 December 2147483646
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agobuild-sys: remove redundant EXTRA_DIST files
Ruediger Meier [Sat, 20 Jan 2018 18:06:24 +0000 (19:06 +0100)] 
build-sys: remove redundant EXTRA_DIST files

The sources of AC_CONFIG_FILES (*.in) are automatically
distributed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agobuild-sys: avoid using prog_DEPENDENCIES
Ruediger Meier [Sat, 20 Jan 2018 18:06:23 +0000 (19:06 +0100)] 
build-sys: avoid using prog_DEPENDENCIES

Use EXTRA_prog_DEPENDENCIES to have the benefit
of automake's automatic prog_DEPENDENCIES.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agobuild-sys: remove unneeded dependencies on bla.h.in
Ruediger Meier [Sat, 20 Jan 2018 18:06:22 +0000 (19:06 +0100)] 
build-sys: remove unneeded dependencies on bla.h.in

We have already automakes's automatic dependencies like
  bla.h.in -> bla.h -> foo.o -> bar.la

An explicit direct dependency bla.h.in -> bar.la
is redundant and useless anyways.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agobuild-sys: automake is able to find headers in builddir ...
Ruediger Meier [Sat, 20 Jan 2018 18:06:21 +0000 (19:06 +0100)] 
build-sys: automake is able to find headers in builddir ...

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agobuild-sys: remove generated headers from dist tar ball
Ruediger Meier [Sat, 20 Jan 2018 18:06:20 +0000 (19:06 +0100)] 
build-sys: remove generated headers from dist tar ball

Headers should only be listed in either *_HEADERS or
*_SOURCES, especially when we want nodist_*_HEADERS.

Since all the generated headers are made by configure we
don't even need to use BUILT_SOURCES or other tricks.

Also see automake docs 9.4.1 Built Sources Example:
  case "Build bindir.h from configure"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
7 years agohwclock: add --ul-debug implementing debug.h
J William Piggott [Sun, 24 Dec 2017 20:38:58 +0000 (15:38 -0500)] 
hwclock: add --ul-debug implementing debug.h

Undocumented at this time, because it is a skeleton
implementation.  More debugging points are to be added after
refactoring is complete, or ad hoc in the mean time.

When fully implemented, enough time may have passed that the
deprecated --debug could be used to replace --ul-debug.

[kzak@redhat.com: - use __UL_INIT_DEBUG_FROM_STRING() to initialize the mask
                  - add hwclock_init_debug()]

Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years ago mount(8): umount does not (anymore?) say `none busy'
Alan Jenkins [Sun, 21 Jan 2018 16:41:17 +0000 (16:41 +0000)] 
 mount(8): umount does not (anymore?) say `none busy'

The closest I can get is with `mount`, so refer to that instead.

    # mount none -t proc /proc
    mount: /proc: none already mounted or mount point busy.
    # umount /proc
    umount: /proc: target is busy.
    # (cd /root; umount proc)
    umount: /proc: target is busy.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
7 years agolscpu: Decode ARM CPUs
Riku Voipio [Thu, 18 Jan 2018 14:57:51 +0000 (16:57 +0200)] 
lscpu: Decode ARM CPUs

Since the kernel developers have refused to make /proc/cpuinfo user
understandable, implement mapping in userspace. lscpu is available for
most users via util-linux, so store the information here.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
7 years agomount(8): point people to the proc(5) page for mount options
Mike Frysinger [Fri, 19 Jan 2018 02:22:46 +0000 (21:22 -0500)] 
mount(8): point people to the proc(5) page for mount options

This page is out of date wrt proc mount options, so point it to the
proc(5) page which is kept up to date.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 years agosfdisk: add hint about udev and flock to the man page
Karel Zak [Wed, 17 Jan 2018 15:30:06 +0000 (16:30 +0100)] 
sfdisk: add hint about udev and flock to the man page

Addresses: https://github.com/karelzak/util-linux/issues/563
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: mark fincore/count as KNOWN_FAIL
Karel Zak [Wed, 17 Jan 2018 13:41:56 +0000 (14:41 +0100)] 
tests: mark fincore/count as KNOWN_FAIL

The test (or our expectations about Direct-IO) seems not robust
enough. I guess this is not fincore problem.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: add ISC licence
Carlos Santos [Sun, 14 Jan 2018 18:39:31 +0000 (16:39 -0200)] 
docs: add ISC licence

Save the top 21 lines of sys-utils/rfkill.c as COPYING.ISC. This is
useful for Linux distributions an integration tools like Buildroot,
to collect detailed legal information for each package.

[kzak@redhat.com: - remove C-comments and rfkill header]

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoinclude/debug: introduce __UL_INIT_DEBUG_FROM_STRING()
Karel Zak [Wed, 17 Jan 2018 12:58:29 +0000 (13:58 +0100)] 
include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()

Let's make it possible to use debug.h without environment variables.

Suggested-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agohwclock: rename --debug option to --verbose
J William Piggott [Sun, 24 Dec 2017 20:37:36 +0000 (15:37 -0500)] 
hwclock: rename --debug option to --verbose

Warn on --debug; do not fallthrough because
the message is lost in the verbose output.

Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agocal: update man page
J William Piggott [Tue, 16 Jan 2018 18:08:31 +0000 (13:08 -0500)] 
cal: update man page

Update cal.1 with the new options --reform and --iso.

Also add information about the calendar systems used and
the difference between the --julian option and the Julian
calendar system.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agocal: add option to set Gregorian reform date
J William Piggott [Tue, 16 Jan 2018 11:19:00 +0000 (06:19 -0500)] 
cal: add option to set Gregorian reform date

Create the new option: --reform <1752|gregorian|iso|julian>

This adds the capability to display either the proleptic Gregorian or
the Julian calendar systems exclusively.

Also create the option --iso as alias of --reform=gregorian.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agocal: move REFORMATION_YEAR to control struct
J William Piggott [Mon, 15 Jan 2018 16:06:36 +0000 (11:06 -0500)] 
cal: move REFORMATION_YEAR to control struct

Signed-off-by: J William Piggott <elseifthen@gmx.com>
7 years agoinclude/debug: improve debug message
Karel Zak [Fri, 12 Jan 2018 12:46:49 +0000 (13:46 +0100)] 
include/debug: improve debug message

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoinclude/debug: print info when addresses suppressed
Karel Zak [Fri, 12 Jan 2018 12:37:05 +0000 (13:37 +0100)] 
include/debug: print info when addresses suppressed

Suggested-by: Peter Cordes <peter@cordes.ca>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosfdisk: cleanup shortcuts in man page too
Karel Zak [Fri, 12 Jan 2018 11:38:58 +0000 (12:38 +0100)] 
sfdisk: cleanup shortcuts in man page too

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: (script) be consistent in code with types
Karel Zak [Fri, 12 Jan 2018 11:04:16 +0000 (12:04 +0100)] 
libfdisk: (script) be consistent in code with types

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoMerge branch 'mbsencode' of https://github.com/yontalcar/util-linux
Karel Zak [Fri, 12 Jan 2018 10:59:22 +0000 (11:59 +0100)] 
Merge branch 'mbsencode' of https://github.com/yontalcar/util-linux

* 'mbsencode' of https://github.com/yontalcar/util-linux:
  tests: mark mbsencode as KNOWN_FAIL
  tests: mbsencode - test for HAVE_WIDECHAR
  lib/mbsalign: Fix escaping nonprintable multibyte characters
  tests: mbsencode - removed emoji, added control unicode character
  tests: add tests for encode functions from lib/mbsalign.c
  lib/mbsalign: escape "\x" when HAVE_WIDECHAR not defined

7 years agoinclude/debug: don't print pointer address for SUID programs
Karel Zak [Fri, 12 Jan 2018 10:01:26 +0000 (11:01 +0100)] 
include/debug: don't print pointer address for SUID programs

* introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing

* use __UL_DEBUG_FL_NOADDR when SUID

* move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK
  to provide access to the current mask from ul_debugobj(). It's better
  than modify all ul_debugobj() calls and use the global mask as
  argument.

* remove never used UL_DEBUG_DEFINE_FLAG

Reported-by: halfdog <me@halfdog.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: allow to start freespace for zero
Karel Zak [Thu, 11 Jan 2018 14:18:00 +0000 (15:18 +0100)] 
libfdisk: allow to start freespace for zero

This is necessary for disk labels like SUN where whole disk is possible
to address by partitions.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: (sun) fix n-1 bug and whole-disk
Karel Zak [Thu, 11 Jan 2018 13:23:57 +0000 (14:23 +0100)] 
libfdisk: (sun) fix n-1 bug and whole-disk

* set whole_disk variable if SUN_TAG_WHOLEDISK specified
* fix N-1 bug in add new partition according to template (script)

Addresses: https://github.com/karelzak/util-linux/issues/555
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: mark mbsencode as KNOWN_FAIL
Vaclav Dolezal [Thu, 11 Jan 2018 13:19:23 +0000 (14:19 +0100)] 
tests: mark mbsencode as KNOWN_FAIL

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agotests: mbsencode - test for HAVE_WIDECHAR
Vaclav Dolezal [Thu, 11 Jan 2018 10:11:31 +0000 (11:11 +0100)] 
tests: mbsencode - test for HAVE_WIDECHAR

Test only safe-ascii as it should behave in the same way.

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agolib/mbsalign: Fix escaping nonprintable multibyte characters
Vaclav Dolezal [Thu, 11 Jan 2018 09:42:22 +0000 (10:42 +0100)] 
lib/mbsalign: Fix escaping nonprintable multibyte characters

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
7 years agotests: mbsencode - removed emoji, added control unicode character
Vaclav Dolezal [Thu, 11 Jan 2018 09:38:43 +0000 (10:38 +0100)] 
tests: mbsencode - removed emoji, added control unicode character

Emojis are apparently too recent to be reliably recognised as printable
on test machines.

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>