Commit Graph

11255 Commits

Author SHA1 Message Date
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
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
Karel Zak 958ff57c86 tests: redirect unwanted dd(1) advices to /dev/null
It seems that dd(1) on travis writes unwanted messages to stdout

  dd: you probably want conv=notrunc with oflag=append

and we do not want conv=

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-24 12:23:59 +01:00
Karel Zak 071147ab89 blkid: fix compiler warning [-Wdiscarded-qualifiers]
Let's also hide the show[] array in has_item().

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-24 12:07:17 +01:00
Karel Zak 3006dd7352 Merge branch '2017wk11' of git://github.com/kerolasa/lelux-utiliteetit
* '2017wk11' of git://github.com/kerolasa/lelux-utiliteetit:
  blkid: add control struct
  blkid: simplify version option handling
  tests: add static keyword where needed [smatch scan]
  tests: do not use plain 0 as NULL [smatch scan]
  libsmartcols: fix test variable shadowing
2017-03-24 11:59:57 +01:00
Sami Kerola 69dee227f2 bash-completion: update fincore to have latest options
Also include --output smartcols fields.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-24 11:51:55 +01:00
Karel Zak 2ee3b6b735 Merge branch 'hwclock-date7-1' of github.com:jwpi/util-linux
* 'hwclock-date7-1' of github.com:jwpi/util-linux:
  hwclock-rtc.c: try the 'new' rtc class first
2017-03-24 11:51:06 +01:00
Karel Zak 044d6e5565 libblkid: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-24 11:46:33 +01:00
J William Piggott 1811900a91 hwclock-rtc.c: try the 'new' rtc class first
* sys-utils/hwclock-rtc.c: try to open the 'new' rtc class driver first.
* sys-utils/hwclock.8.in: document this.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2017-03-23 16:14:01 -04:00
Karel Zak 24d746f705 build-sys: add missing header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 15:59:58 +01:00
Tobias Stoeckmann 62ab1ebb12 libblkid: prevent OOB access while probing HFS+
It is possible to perform out of boundary read accesses due to
insufficient boundary checks in probe_hfsplus.

The first issue occurs if the leaf count in a B-node is too
small. The second happens while parsing a unicode description which
is longer than 255 UTF-8 characters. The length is stored in a 16 bit
integer, but the array in the struct is limited to 255 * 2, which is
in sync with Apple's Open Source HFS+ implementation (HFSUniStr255).

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-03-23 15:46:36 +01:00
Karel Zak eef0a92d31 tests: refresh fincore test
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 15:28:39 +01:00
Karel Zak cff1c113fe fincore: fix error on open()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 15:28:05 +01:00
Karel Zak 9b48766fb3 fincore: add --raw and --json
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 14:34:12 +01:00
Karel Zak c5cb541299 fincore: add --output
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 14:27:42 +01:00
Karel Zak 3f91dd88ca fincore: add --bytes and --noheadings
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 14:17:46 +01:00
Karel Zak 3e37d7b773 fincore: use libsmartcols
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 14:09:20 +01:00
Karel Zak b57fe43cd4 fincore: cleanup return codes
Don't use EXIT_* macros as functions return code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 13:07:06 +01:00
Masatake YAMATO 483baa35ab bash-completion: add a function for fincore command
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2017-03-23 12:46:41 +01:00
Masatake YAMATO c1cc045d12 tests: add cases for testing fincore command
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2017-03-23 12:46:40 +01:00
Masatake YAMATO ffbfa7fbaf man: add a page for fincore command
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2017-03-23 12:46:38 +01:00
Masatake YAMATO a921a7dea9 fincore: new command for counting pages of file contents in core
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-23 12:46:09 +01:00
Karel Zak 7e26832d70 Merge remote-tracking branch 'jwpi/hwclock-date7'
* jwpi/hwclock-date7:
  lib: add parse-date documentation
  hwclock: use parse_date function
  build-sys: add parse-date.y
  lib: add parse-date.y
2017-03-23 12:36:47 +01:00
Karel Zak b607e5faca Fix menu spelling in cfdisk debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-22 10:43:55 +01:00
Sami Kerola 59b94cc0c5
blkid: add control struct
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-17 21:22:26 +00:00
Sami Kerola 93bdbe1993
blkid: simplify version option handling
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-17 21:22:26 +00:00
Sami Kerola 41427f97d9
tests: add static keyword where needed [smatch scan]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-17 21:22:26 +00:00
Sami Kerola 71f08e9706
tests: do not use plain 0 as NULL [smatch scan]
Likewise commit 8791804065.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-17 21:22:26 +00:00
Sami Kerola 4ff3d13b43
libsmartcols: fix test variable shadowing
libsmartcols/samples/fromfile.c:57:16: warning: declaration of 'flags'
shadows a global declaration [-Wshadow]
libsmartcols/samples/fromfile.c:29:33: note: shadowed declaration is here
libsmartcols/samples/fromfile.c:101:8: warning: declaration of 'flags'
shadows a global declaration [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-17 21:22:26 +00:00
Karel Zak bb6762035a libfdisk: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-16 10:01:54 +01:00
Karel Zak 999448d866 tests: refresh lscpu tests
.. due to libsmartcols use for the default output. The output does not
contain extra unnecessary blank space anymore.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-15 11:49:22 +01:00
Karel Zak 19a5510b96 lscpu: add --json
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-14 15:32:53 +01:00
Karel Zak c82b12a0a2 lscpu: use libsmartcols to print summary too
Addresses: https://github.com/karelzak/util-linux/issues/419
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-14 15:19:12 +01:00
Sami Kerola 57ebfde291 fdisk, sfdisk: avoid non-ANSI function declarations [smatch scan]
Adding _FUNCTION_DEF definition will exclude compatibility type definitions
that do include void key word in empty argument list.

/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function
declaration of function 'Function'

These functions has been replaced by set of new ones in readline 4.2 (April
2001), and removed in 6.3 (February 2014).

Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES
Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-14 14:01:14 +01:00
Sami Kerola f5a2b07e8c blkid: add messages to translations
Without obvious reason blkid has managed to be part of this project for
pretty long time without getting translations.  Lets change that.  In same
go use the usual error printing facilities instead of fprintf(stderr, ...);

[kzak@redhat.com: - use errtryh(),
                  - cleanup "unsupported output format"]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-13 15:34:18 +01:00
Sami Kerola 126d8cf35b blkid: add curly braces to do-while statement
Some say people read do-while statements are easily as while statements and
get wrong impression.  This happens because do-whiles are not common.
Adding braces should make it easier to read the code.

Reference: http://www.spinics.net/lists/linux-kernel-janitors/msg02018.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-13 15:24:57 +01:00
Karel Zak b2b5292541 libfdisk: fix potentially NULL pointer usage
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-13 15:20:56 +01:00
Sami Kerola 6cb55736cb docs: improve boilerplate.c options example
Make usage() translations to contain complete option help in single
translation unit.  And make -z option example complete.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-13 14:48:16 +01:00