Commit Graph

11291 Commits

Author SHA1 Message Date
Karel Zak 14cd0a67a3 libsmartcols: fix relative width interpretation
The non-defined width hint (=0) should not be interpreted as relative width.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak f691831481 libsmartcols: column width reduction refactoring
The current implementation is unreadable... Let's write it again with
more obvious semantic.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak 48645e7bbb libsmartcols: add scols_line_move_cells()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak 7bdefc7fc0 libsmartcols: add scols_table_move_column()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak 52f35f1ecc libfdisk: (gpt) fix ents zeroize
The gpt->ents is "unsigned char" buffer now. We need to use bytes, no
number of entries...

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-06 13:39:44 +02:00
Karel Zak bbb574a293 libfdisk: (gpt) update nparts_max
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-06 13:04:09 +02:00
Karel Zak 452089fa2f fincore: use size_t everywhere
It seems better to avoid "int" at all from sizes calculations to make
the code more robust for future changes.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-06 12:40:01 +02:00
Ruediger Meier 137fae2282 tests: fincore/count, skip unsupported FS
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-04-06 12:30:11 +02:00
Ruediger Meier b9d3db99e1 tests: handle dd errors in fincore/count
On dd error the test will fail earlier and the test diff will be
more useful.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-04-06 12:30:10 +02:00
Ruediger Meier 379c1a52a2 fincore: fix multiplication overflow
This failed on ppc64 with page size 64k.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-04-06 12:30:09 +02:00
Ruediger Meier 4a4a617d03 tests: fix fincore/count for PAGE_SIZE != 4096
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-04-06 12:30:09 +02:00
Ruediger Meier 0614fe48bc tests: remove fincore SMALLER_THAN_PAGESIZE tests
These tests failed for example on ext4 with a non-default
blocksize 1024. In this case it seems that the kernel only
caches a full page if we read at least PAGE_SIZE -BLOCK_SIZE +1.

Both tests also failed on NFS allthough block size seems to be
1M there.

We still keep the test for PAGE_SIZE-1 which seems to work more
reliable.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-04-06 12:30:08 +02:00
Karel Zak a8294f401f libfdisk: (gpt) care about SSIZE_MAX for read(2)
read(2) behavior is undefined if you want to read more  than SSIZE_MAX
bytes. Let's be paranoid and check for this...

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-06 12:13:46 +02:00
Karel Zak 9e320545bb libfdisk: (gpt) make entries array size calculation more robust
* use the same function everywhere
* keep calculation based on size_t

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-05 18:40:56 +02:00
Karel Zak b683c08108 libfdisk: (gpt) use size_t and gpt_get_nentries()
If possible use size_t for number of entries (partitions). It
makes code more readable and without unnecessary casts.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-05 14:55:32 +02:00
Karel Zak b28df75eec libfdisk: (gpt) don't access entries array directly
We blindly assume that our sizeof(struct gpt_entry) is the same
on-disk stored header->sizeof_partition_entry.

It seems more correct would be to use sizeof specified by header to
access the entries array items. This patch introduces gpt_get_entry()
to avoid direct access to gpt->ents[].

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-05 14:19:13 +02:00
Karel Zak 4739b6fd3e agetty: fix login-options desc in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-05 10:59:53 +02:00
Karel Zak 31fbf70bc1 docs: update Documentation/deprecated.txt
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-04 14:56:12 +02:00
Karel Zak c9700fc156 Merge branch 'hwclock-date7-3' of github.com:jwpi/util-linux
* 'hwclock-date7-3' of github.com:jwpi/util-linux:
  hwclock: remove unused 'silent' arg
  hwclock: remove dead cmos code
  hwclock: improve cmos message strings
  hwclock: remove unused atomic arg in cmos
  hwclock: remove unused cmos ctl structs
  hwclock: remove alpha cmos
2017-04-04 14:41:50 +02:00
Karel Zak c8ce2f4cb3 Merge branch 'tailf-removal' of https://github.com/kerolasa/lelux-utiliteetit
* 'tailf-removal' of https://github.com/kerolasa/lelux-utiliteetit:
  tailf: remove deprecated utility
2017-04-04 14:25:37 +02:00
Karel Zak d1e27bf190 Merge branch '2017wk13' of https://github.com/kerolasa/lelux-utiliteetit
* '2017wk13' of https://github.com/kerolasa/lelux-utiliteetit:
  docs: improve agetty.8 manual page
  agetty: make --remote to forward --nohostname as -H to login
  lib/cpuset: stop changing variable that is not read
  agetty: remove variable that is set but not read
2017-04-04 14:20:25 +02:00
Karel Zak d134feab07 Merge branch 'fix-ipcs-shmall-overflow' of https://github.com/rudimeier/util-linux
* 'fix-ipcs-shmall-overflow' of https://github.com/rudimeier/util-linux:
  ipcs: make shmall overflow a bit less worse
2017-04-04 14:04:08 +02:00
Frederick Grose ec3624aa75 losetup.8: Reorder options documentation
Reorder options to match onboard help and group functionally.
Include some missing optional arguments.

[kzak@redhat.com: - don't include available columns in man page,
                  - add comments to the usage()
		  - fix order in usage()
		  - fix typo in usage()]

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-04 12:52:06 +02:00
Karel Zak 1253b2a31f zramctl: be more specific about default output
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-04 12:08:05 +02:00
Sami Kerola c9151874b6
docs: improve agetty.8 manual page
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-03 22:17:52 +01:00
Sami Kerola 343cc27559
agetty: make --remote to forward --nohostname as -H to login
Without this change an attempt to remove hostname printing required following
rather clumsy agetty invocation.

  /sbin/agetty --nohostname --login-options '/bin/login -H -- \u'

After the change --nohostname behaves similar way with --host option, that
is when combined with --remote the effect is passed to login(1).

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-03 19:55:15 +01:00
Karel Zak cab84ea39c lib/strutils: fix typos in huge size suffixes
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-03 12:52:53 +02:00
Ruediger Meier 61e29ab44f ipcs: make shmall overflow a bit less worse
Still no large integer support but on overflow we print now
the largest possible value, maybe even the largest one which
makes sense at all.

So on x86_64 systems we'll see now:
$ echo "4503599627370496" > /proc/sys/kernel/shmall
$ ipcs -m -l | grep "max total"
max total shared memory (kbytes) = 18014398509481980

rather than this:
$ ipcs -m -l | grep "max total"
max total shared memory (kbytes) = 0

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-04-03 09:34:38 +02:00
Sami Kerola 70ca1a7772
tailf: remove deprecated utility
March 2017 is gone, it is time to remove this utility as scheduled in
earlier commit, and promised in manual page.

Reference: 3f8478a71c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-02 16:51:00 +01:00
Sami Kerola 4783f2005d
lib/cpuset: stop changing variable that is not read
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-01 09:24:37 +01:00
Sami Kerola 650e6df62c
agetty: remove variable that is set but not read
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-01 09:24:30 +01:00
J William Piggott af68bd014a hwclock: remove unused 'silent' arg
The 'silent' argument for get_epoch_rtc() was used
to silence error messages when querying the rtc
driver for an alpha epoch while using cmos direct
access. Alpha cmos has since been removed so
'silent' is no longer used.

* sys-utils/hwclock.h: remove 'silent' argument
* sys-utils/hwclock.c: same
* sys-utils/hwclock-rtc.c: same

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 10:04:53 -04:00
J William Piggott e216a772b1 hwclock: remove dead cmos code
* hwclock-cmos.c: remove unused 'century' code.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 10:04:53 -04:00
J William Piggott 859b0b1acb hwclock: improve cmos message strings
* sys-utils/hwclock-cmos.c: improve message strings

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 10:04:53 -04:00
J William Piggott 51d94caa8d hwclock: remove unused atomic arg in cmos
* sys-utils/hwclock-cmos.c: remove unused arg for atomic()

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 10:04:53 -04:00
J William Piggott f252169c56 hwclock: remove unused cmos ctl structs
The hwclock-cmos.c ctl structs were only used for
the since removed alpha code.

* sys-utils/hwclock-cmos.c: remove unused ctl structs

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 10:04:53 -04:00
J William Piggott c47a61894b hwclock: remove alpha cmos
Remove alpha direct I/O access, use RTC instead:
http://marc.info/?l=util-linux-ng&m=141682406902804

Resolves the alpha 2020 issue for util-linux:
http://marc.info/?l=util-linux-ng&m=148387021519787

Now it is only the kernel's RTC problem.

* sys-utils/hwclock.c: remove alpha cmos
* sys-utils/hwclock-cmos.c: same
* sys-utils/hwclock.h: same
* sys-utils/hwclock.8.in: same

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 10:04:53 -04:00
Karel Zak eff2c9a426 tests: add --mountpoint to findmnt calls
... if necessary to make things more robust.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-31 14:00:24 +02:00
Sami Kerola 34a9766b0e utmpdump: remove unnecessary variable
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-31 12:58:13 +02:00
J William Piggott f6374e1fb3 hwclock: remove 1994 Award BIOS workaround
Remove the 1994 Award BIOS bug workaround as
previously discussed more than two years ago:
http://marc.info/?l=util-linux-ng&m=141682406902804&w=2

* sys-utils/hwclock.c: remove badyear option
* sys-utils/hwclock.h: same
* sys-utils/hwclock.8.in: same

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-31 12:56:03 +02:00
Ruediger Meier a837b3bdf3 test: fix mountpoint device check in libmount/loop
This test could fail if the build directory is somehow exoticly
mounted (shared bind mounts, symlinks).

CC: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-03-31 12:55:23 +02:00
Karel Zak c6f6afc164 lscpu: fix mem leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-31 11:05:26 +02:00
Karel Zak bf1eab0731 lscpu: check return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-31 10:58:50 +02:00
Karel Zak 2546d54bd8 zramctl: make mm_stat parser more robust
Let's fallback to attribute files if mm_stat file is incomplete. It
should not happen, but I have seen RHEL7 kernel where is no
num_migrated/pages_compacted attribute...

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-30 12:10:01 +02:00
Karel Zak 9ff67eb9c8 agetty: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-27 18:02:54 +02:00
Karel Zak 9877680cae tests: define columns for fincore test
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-27 15:13:17 +02:00
Karel Zak 790119b885 agetty: fix characters reorder in login prompt
The current agetty uses TIOCSTI ioctl to return already read chars
from login name back to the terminal (without read() before
tcsetattr() we will lost data already written by user). The ioctl
based solution is fragile due to race -- we can return chars when
terminal already contains another new chars. The result is reordered
chars in login name.

The solution is to use extra buffer for already read data.

Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-27 14:54:39 +02:00
Karel Zak ca5389757e unshare: add note about persisten PID namespaces
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-27 13:25:31 +02:00
Karel Zak e4e8b57be2 fincore: add column RES
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-27 13:08:40 +02:00
Karel Zak 8ea213781d tests: remove status=none dd(1) from fincore
seems dd(1) sucks on travis more than expected:

 dd: invalid status flag: `none'
 Try `dd --help' for more information.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-24 13:13:28 +01:00