]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 years agocal: ncurses cleanup
Karel Zak [Tue, 30 May 2017 15:10:40 +0000 (17:10 +0200)] 
cal: ncurses cleanup

* use proper paths to term.h
* keep ncurses support optional
* link with TINFO_LIBS (-ltinfo), or fallback to NCURSES_LIBS (-ltinfo -lncurses)
* don't include unnecessary ncurses.h (term.h is enough)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/colors: ncurses cleanup
Karel Zak [Tue, 30 May 2017 15:10:40 +0000 (17:10 +0200)] 
lib/colors: ncurses cleanup

* use proper paths to term.h
* keep ncurses support optional
* link with TINFO_LIBS (-ltinfo), or fallback to NCURSES_LIBS (-ltinfo -lncurses)
* don't include unnecessary ncurses.h (term.h is enough)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: make ncurses detection more robust
Karel Zak [Tue, 30 May 2017 15:01:00 +0000 (17:01 +0200)] 
build-sys: make ncurses detection more robust

It seems Debina 8 is a little bit incompatible with us:

* ncurses-config is packaged in ncurses-bin where is *no* any
  development files! It means the script returns paths to not installed
  files (IMHO packaging bug)

  Fixed, we need to check for header files too.

* term.h is "everywhere" on Fedora:

<term.h>
<ncurses/term.h>
<ncursesw/term.h>

  Debian is more strict and uses <ncurses[w]/term.h> only.

  Fixed, we need #ifdef storm to use the correct path

 * libtinfo-dev does not contains any header files

 Fixed, we have to always require installed ncurses devel stuff to compile,
 but we can link with -ltinfo only (cal, ul, more, ...)

 * we don't use termcap for more(1)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: check for ps --ppid
Karel Zak [Tue, 30 May 2017 08:47:06 +0000 (10:47 +0200)] 
tests: check for ps --ppid

Reported-by: Assaf Gordon <assafgordon@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: make /proc optional
Karel Zak [Tue, 30 May 2017 08:47:06 +0000 (10:47 +0200)] 
tests: make /proc optional

Reported-by: Assaf Gordon <assafgordon@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/loopdev: remove unnecessary header
Karel Zak [Tue, 30 May 2017 08:47:06 +0000 (10:47 +0200)] 
lib/loopdev: remove unnecessary header

Reported-by: Assaf Gordon <assafgordon@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotest_uuidd: don't use error.h
Karel Zak [Tue, 30 May 2017 08:26:17 +0000 (10:26 +0200)] 
test_uuidd: don't use error.h

The header file is not provided by musl-libc.

Reported-by: Assaf Gordon <assafgordon@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agowall: make sure with not referencing a null pointer
Karel Zak [Mon, 29 May 2017 11:25:36 +0000 (13:25 +0200)] 
wall: make sure with not referencing a null pointer

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: fix variable shadowing
Sami Kerola [Sat, 27 May 2017 09:03:55 +0000 (10:03 +0100)] 
libfdisk: fix variable shadowing

libfdisk/src/context.c: In function 'fdisk_assign_device':
libfdisk/src/context.c:549:7: warning: declaration of 'rc' shadows a previous local [-Wshadow]
libfdisk/src/context.c:542:10: note: shadowed declaration is here

[kzak@redhat.com: - add rc to debug message]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/colors: Fix bug where help text was not being translated.
Sebastian Rasmussen [Sat, 27 May 2017 20:50:57 +0000 (04:50 +0800)] 
lib/colors: Fix bug where help text was not being translated.

This affected cfdisk, fdisk, sfdisk, cal, dmesg and hexdump.

7 years agolibblkid: (docs) add missing 'since' tags
Karel Zak [Tue, 23 May 2017 12:27:06 +0000 (14:27 +0200)] 
libblkid: (docs) add missing 'since' tags

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: update docs
Karel Zak [Tue, 23 May 2017 12:22:04 +0000 (14:22 +0200)] 
libfdisk: update docs

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: (docs) add missing 'since' tags
Karel Zak [Tue, 23 May 2017 12:02:14 +0000 (14:02 +0200)] 
libfdisk: (docs) add missing 'since' tags

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: (docs) add missing 'since' tags
Karel Zak [Tue, 23 May 2017 11:32:45 +0000 (13:32 +0200)] 
libmount: (docs) add missing 'since' tags

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibsmartcols: (docs) add missing 'since' tags
Karel Zak [Tue, 23 May 2017 11:27:29 +0000 (13:27 +0200)] 
libsmartcols: (docs) add missing 'since' tags

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: release++ (v2.30-rc2) v2.30-rc2
Karel Zak [Tue, 23 May 2017 10:20:27 +0000 (12:20 +0200)] 
build-sys: release++ (v2.30-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update v2.30-ReleaseNotes
Karel Zak [Tue, 23 May 2017 10:19:21 +0000 (12:19 +0200)] 
docs: update v2.30-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: check for TS_HELPER_SYSINFO in fincore test
Karel Zak [Tue, 23 May 2017 10:10:15 +0000 (12:10 +0200)] 
tests: check for TS_HELPER_SYSINFO in fincore test

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update AUTHORS file
Karel Zak [Tue, 23 May 2017 09:47:17 +0000 (11:47 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agopo: merge changes
Karel Zak [Tue, 23 May 2017 09:45:07 +0000 (11:45 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: update build-sys due to readline
Karel Zak [Tue, 23 May 2017 09:39:58 +0000 (11:39 +0200)] 
tests: update build-sys due to readline

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosfdisk: disambiguate units of --show-size
Chris Morin [Fri, 19 May 2017 00:07:19 +0000 (20:07 -0400)] 
sfdisk: disambiguate units of --show-size

[kzak@redhat.com: - use optutils.h]

Signed-off-by: Chris Morin <chris.morin2@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agochfn: disable tab completion
Sami Kerola [Thu, 18 May 2017 21:19:35 +0000 (22:19 +0100)] 
chfn: disable tab completion

The default readline tab completion that offers file listing from current
directory does not make any sense in this context.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agorename: make --no-act to imply --verbose
Sami Kerola [Thu, 18 May 2017 21:19:34 +0000 (22:19 +0100)] 
rename: make --no-act to imply --verbose

It is reasonable to assume use of --no-act means one wants to always see
what would have happen if rename is done.  To say same slightly differently,
if there is sn use case for silent rename --no-act run I cannot think one.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agodocs: update source-code-management.txt
Karel Zak [Thu, 18 May 2017 19:55:36 +0000 (21:55 +0200)] 
docs: update source-code-management.txt

Reported-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolslocks: remove dead code
Karel Zak [Thu, 18 May 2017 13:10:51 +0000 (15:10 +0200)] 
lslocks: remove dead code

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agozramctl: add mising line terminator
Karel Zak [Thu, 18 May 2017 13:10:04 +0000 (15:10 +0200)] 
zramctl: add mising line terminator

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agomisc: consolidate smartcols error messages
Karel Zak [Thu, 18 May 2017 09:39:34 +0000 (11:39 +0200)] 
misc: consolidate smartcols error messages

... just to keep translators happy

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: Fix UDF test output after changing UUID algorithm
Pali Rohár [Wed, 17 May 2017 18:36:51 +0000 (20:36 +0200)] 
tests: Fix UDF test output after changing UUID algorithm

7 years agolibblkid: udf: Change algorithm for reporting UUID
Pali Rohár [Wed, 17 May 2017 18:36:40 +0000 (20:36 +0200)] 
libblkid: udf: Change algorithm for reporting UUID

Ensure that reported UUID always contains only lowercase hexadecimal digits
and is always 16 characters length, padded with zero digits.

Volume Set Identifier is converted to UTF-8 before generating UUID from it.
As it could potentially contain any Unicode character. So correctly handle
both 8bit and 16bit OSTA Compressed Unicode encodings.

Disks which have only lowercase hexadecimal digits in Volume Set Identifier
would have same UUID as before this patch.

7 years agofincore: check rc from smartcols stuff [coverity scan]
Karel Zak [Wed, 17 May 2017 11:08:33 +0000 (13:08 +0200)] 
fincore: check rc from smartcols stuff [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agonologin: don't call fstat() after failed open() [coverity scan]
Karel Zak [Wed, 17 May 2017 10:59:33 +0000 (12:59 +0200)] 
nologin: don't call fstat() after failed open() [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibsmartcols: check scols_table_set_default_symbols() return code [coverity scan]
Karel Zak [Wed, 17 May 2017 10:50:36 +0000 (12:50 +0200)] 
libsmartcols: check scols_table_set_default_symbols() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: don't pass -1 to close() [coverity scan]
Karel Zak [Wed, 17 May 2017 10:45:30 +0000 (12:45 +0200)] 
libmount: don't pass -1 to close() [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: don't use errno after close()
Karel Zak [Wed, 17 May 2017 10:43:48 +0000 (12:43 +0200)] 
libfdisk: don't use errno after close()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: fix memory leak [coverity scan]
Karel Zak [Wed, 17 May 2017 10:38:16 +0000 (12:38 +0200)] 
libmount: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: use memcpy() for non-terminated string [coverity scan]
Karel Zak [Wed, 17 May 2017 10:29:50 +0000 (12:29 +0200)] 
libfdisk: use memcpy() for non-terminated string [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: initialize partno variable [coverity scan]
Karel Zak [Wed, 17 May 2017 10:24:07 +0000 (12:24 +0200)] 
libfdisk: initialize partno variable [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibmount: check fstat() return code [coverity scan]
Karel Zak [Wed, 17 May 2017 10:20:18 +0000 (12:20 +0200)] 
libmount: check fstat() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: don't print uninitialized variable [coverity scan]
Karel Zak [Wed, 17 May 2017 10:15:38 +0000 (12:15 +0200)] 
libfdisk: don't print uninitialized variable [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosfdisk: add hints for scanners [coverity scan]
Karel Zak [Wed, 17 May 2017 09:57:44 +0000 (11:57 +0200)] 
sfdisk: add hints for scanners [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agomkswap: use memcpy() for non-terminated string [coverity scan]
Karel Zak [Wed, 17 May 2017 09:48:36 +0000 (11:48 +0200)] 
mkswap: use memcpy() for non-terminated string [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofsck.minix: add hint for scanners [coverity scan]
Karel Zak [Wed, 17 May 2017 09:38:54 +0000 (11:38 +0200)] 
fsck.minix: add hint for scanners [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofdisk: check scols_line_refer_data() return code [coverity scan]
Karel Zak [Wed, 17 May 2017 09:32:50 +0000 (11:32 +0200)] 
fdisk: check scols_line_refer_data() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: (libmount) parse version from command line
Karel Zak [Wed, 17 May 2017 09:28:19 +0000 (11:28 +0200)] 
tests: (libmount) parse version from command line

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocfdisk: add hints for scanners [coverity scan]
Karel Zak [Wed, 17 May 2017 09:26:54 +0000 (11:26 +0200)] 
cfdisk: add hints for scanners [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: Fix UDF test output for 8bit OSTA Compressed Unicode
Pali Rohár [Tue, 16 May 2017 21:52:39 +0000 (23:52 +0200)] 
tests: Fix UDF test output for 8bit OSTA Compressed Unicode

7 years agotests: Add UDF hdd image with non ASCII 8bit label created by Linux mkudffs 1.3
Pali Rohár [Tue, 16 May 2017 21:52:24 +0000 (23:52 +0200)] 
tests: Add UDF hdd image with non ASCII 8bit label created by Linux mkudffs 1.3

$ dd if=/dev/zero of=udf-hdd-mkudffs-1.3-3.img bs=1M count=10
$ mkudffs -l 'ÿ' -b 2048 /tmp/udf-hdd-mkudffs-1.3-3.img

7 years agolibblkid: udf: Correctly handle UDF strings encoded in 8bit OSTA Compressed Unicode
Pali Rohár [Tue, 16 May 2017 21:52:05 +0000 (23:52 +0200)] 
libblkid: udf: Correctly handle UDF strings encoded in 8bit OSTA Compressed Unicode

String encoded in 8bit OSTA Compressed Unicode contains one Unicode
codepoint per 8bits. Maximal Unicode codepoint is U+FF. Which effectively
means that it is equivalent to Latin1 encoding.

Before this patch libblkid copied raw 8bit OSTA Compressed Unicode from
disk and treated it as UTF-8. It worked fine just for UTF-8 invariants,
other characters were incorrectly encoded. This patch fixes this problem.

Note that processing UUID is not fixed in this patch.

7 years agolibblkid: Add support for Latin1 encoding in blkid_encode_to_utf8()
Pali Rohár [Tue, 16 May 2017 21:51:50 +0000 (23:51 +0200)] 
libblkid: Add support for Latin1 encoding in blkid_encode_to_utf8()

7 years agosu: remove duplicate const declaration
Sami Kerola [Tue, 16 May 2017 08:25:57 +0000 (09:25 +0100)] 
su: remove duplicate const declaration

login-utils/su-common.c:619:14: warning: duplicate 'const' declaration
specifier [-Wduplicate-decl-specifier]
   const char const **args = xcalloc (n_args, sizeof *args);

Regression-from: 71f207a5f598623a539ba825b97a503072c4a1b4
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agogetops: make --a-long option work again
Sami Kerola [Tue, 16 May 2017 07:37:41 +0000 (08:37 +0100)] 
getops: make --a-long option work again

Add back a character lost in earlier change.

Regression-from: d27f5fe770025e456fbd33b87a96968f34c455ed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agofsck.minix: fix crash
Sami Kerola [Mon, 15 May 2017 10:54:43 +0000 (11:54 +0100)] 
fsck.minix: fix crash

disk-utils/fsck.minix.c:421:30: runtime error: index 513 out of bounds for
type 'unsigned short [512]'

Addresses: https://github.com/karelzak/util-linux/issues/373
Reported-by: Hanno Bock <hanno@gentoo.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agodocs: update TODO, add mount(8) noauto,auto
Karel Zak [Tue, 16 May 2017 11:15:11 +0000 (13:15 +0200)] 
docs: update TODO, add mount(8) noauto,auto

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update v2.30-ReleaseNotes
J William Piggott [Mon, 15 May 2017 09:44:02 +0000 (11:44 +0200)] 
docs: update v2.30-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: release++ (v2.30-rc1) v2.30-rc1
Karel Zak [Fri, 12 May 2017 11:02:05 +0000 (13:02 +0200)] 
build-sys: release++ (v2.30-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: add chmem and tailf to ReleaseNotes
Karel Zak [Fri, 12 May 2017 11:32:14 +0000 (13:32 +0200)] 
docs: add chmem and tailf to ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update v2.30-ReleaseNotes
Karel Zak [Fri, 12 May 2017 11:00:36 +0000 (13:00 +0200)] 
docs: update v2.30-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: update AUTHORS file
Karel Zak [Fri, 12 May 2017 09:32:06 +0000 (11:32 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agopo: merge changes
Karel Zak [Fri, 12 May 2017 09:27:52 +0000 (11:27 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agopo: update zh_CN.po (from translationproject.org)
Wylmer Wang [Fri, 12 May 2017 09:21:06 +0000 (11:21 +0200)] 
po: update zh_CN.po (from translationproject.org)

7 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Fri, 12 May 2017 09:21:06 +0000 (11:21 +0200)] 
po: update pt_BR.po (from translationproject.org)

7 years agopo: update fr.po (from translationproject.org)
Stéphane Aulery [Fri, 12 May 2017 09:21:06 +0000 (11:21 +0200)] 
po: update fr.po (from translationproject.org)

7 years agopo: update da.po (from translationproject.org)
Joe Hansen [Fri, 12 May 2017 09:21:06 +0000 (11:21 +0200)] 
po: update da.po (from translationproject.org)

7 years agolib/parse-date: don't use xalloc in lib-like code
Karel Zak [Fri, 12 May 2017 09:15:34 +0000 (11:15 +0200)] 
lib/parse-date: don't use xalloc in lib-like code

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: remove duplicate includes
Karel Zak [Fri, 12 May 2017 09:08:37 +0000 (11:08 +0200)] 
build-sys: remove duplicate includes

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: add AC_STRUCT_TIMEZONE
Karel Zak [Fri, 12 May 2017 09:05:12 +0000 (11:05 +0200)] 
build-sys: add AC_STRUCT_TIMEZONE

new datetime parsing code assumes macros:

lib/parse-date.c : HAVE_STRUCT_TM_TM_ZONE
lib/parse-date.c : HAVE_TZNAME

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agowipefs: add note about no-act to the man page
Karel Zak [Thu, 11 May 2017 13:54:30 +0000 (15:54 +0200)] 
wipefs: add note about no-act to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofdisk: fix type dialog
Karel Zak [Thu, 11 May 2017 13:53:07 +0000 (15:53 +0200)] 
fdisk: fix type dialog

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoMerge branch 'master' of https://github.com/pali/util-linux
Karel Zak [Thu, 11 May 2017 08:59:14 +0000 (10:59 +0200)] 
Merge branch 'master' of https://github.com/pali/util-linux

* 'master' of https://github.com/pali/util-linux:
  tests: Add UDF CD-ROM hybrid image (ISO+Joliet+UDF) created by Nero 6
  tests: Fix test output for low-probe-udf to contain UDF data
  Revert "libblkid: Probe UDF volumes for ISO9660 info as well"

7 years agotests: update wipe-partition
Karel Zak [Wed, 10 May 2017 09:26:51 +0000 (11:26 +0200)] 
tests: update wipe-partition

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agodocs: make column.1 example to use ascii output
Sami Kerola [Tue, 9 May 2017 18:10:52 +0000 (19:10 +0100)] 
docs: make column.1 example to use ascii output

In same go ease reading by having data and arguments in same order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agoswitch_root: use getopt_long() to parse options
Sami Kerola [Tue, 9 May 2017 18:10:51 +0000 (19:10 +0100)] 
switch_root: use getopt_long() to parse options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agovipw: use getopt_long() to parse options
Sami Kerola [Tue, 9 May 2017 18:10:50 +0000 (19:10 +0100)] 
vipw: use getopt_long() to parse options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agocol: avoid extra newline if no input
Sami Kerola [Tue, 9 May 2017 18:10:49 +0000 (19:10 +0100)] 
col: avoid extra newline if no input

BSD fix missed for 22 years, and all util-linux releases so far.

Backported-from: https://github.com/dspinellis/unix-history-repo/commit/2a15260a2a3230e02f57c096fb4c5e1f797bf4f3
Addresses: https://github.com/karelzak/util-linux/issues/422
Reported-by: Pavel Raiskup <praiskup@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agolib/mbsedit: fix typo in comment
Sami Kerola [Tue, 9 May 2017 18:10:48 +0000 (19:10 +0100)] 
lib/mbsedit: fix typo in comment

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
7 years agofdisk: inform on 'p' about wiped partitions
Karel Zak [Tue, 9 May 2017 12:30:36 +0000 (14:30 +0200)] 
fdisk: inform on 'p' about wiped partitions

The wipe operation is potentially dangerous. Let's inform about it
always by 'p' (list) command to make sure user knowns about it.

Command (m for help): p
...
Device     Boot Start    End Sectors Size Id Type
/dev/sdc1        2048 204799  202752  99M 83 Linux

Filesystem/RAID signature on partition 1 will be wiped.

Addresses: https://github.com/karelzak/util-linux/issues/437
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibfdisk: add fdisk_partition_has_wipe()
Karel Zak [Tue, 9 May 2017 12:30:02 +0000 (14:30 +0200)] 
libfdisk: add fdisk_partition_has_wipe()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agofdisk: add to the man page missing option
Karel Zak [Tue, 9 May 2017 11:05:26 +0000 (13:05 +0200)] 
fdisk: add to the man page missing option

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolscpu: reuse the same buffer
Karel Zak [Tue, 9 May 2017 10:31:52 +0000 (12:31 +0200)] 
lscpu: reuse the same buffer

Now we use libsmartcols for the default output and all is allocated in
the smartcols table. So, we can reuse the same buffer for all
sprintf/scanf calls.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolscpu: make cpu_{max,min}_mhz() usage more elegant
Karel Zak [Tue, 9 May 2017 10:29:24 +0000 (12:29 +0200)] 
lscpu: make cpu_{max,min}_mhz() usage more elegant

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolscpu: Read available CPUs max and min frequencies
Mamatha Inamdar [Thu, 27 Apr 2017 10:22:59 +0000 (15:52 +0530)] 
lscpu: Read available CPUs max and min frequencies

Problem:"lscpu frequency-info" command was always reading CPU0
max and min frequencies. If CPU0 is guarded or offline then it used to
display max and min frequencies as NULL.

This patch will read overall CPU max and min frequencies.

Test Results:

Before Patch:

    #lscpu (CPU0 is guarded/offline)
    Architecture:          ppc64le
    Byte Order:            Little Endian
    CPU(s):                120
    On-line CPU(s) list:   8-127
    Thread(s) per core:    8
    Core(s) per socket:    3
    Socket(s):             4
    NUMA node(s):          4
    Model:                 2.1 (pvr 004b 0201)
    Model name:            POWER8E (raw), altivec supported
    CPU max MHz:           (null)
    CPU min MHz:           (null)
    L1d cache:             64K
    L1i cache:             32K
    L2 cache:              512K
    L3 cache:              8192K
    NUMA node0 CPU(s):     8-31
    NUMA node1 CPU(s):     32-63
    NUMA node16 CPU(s):    64-95
    NUMA node17 CPU(s):    96-127

With Patch:

    # ./lscpu
    Architecture:          ppc64le
    Byte Order:            Little Endian
    CPU(s):                120
    On-line CPU(s) list:   8-127
    Thread(s) per core:    8
    Core(s) per socket:    3
    Socket(s):             4
    NUMA node(s):          4
    Model:                 2.1 (pvr 004b 0201)
    Model name:            POWER8E (raw), altivec supported
    CPU max MHz:           4322.0000
    CPU min MHz:           2061.0000
    L1d cache:             64K
    L1i cache:             32K
    L2 cache:              512K
    L3 cache:              8192K
    NUMA node0 CPU(s):     8-31
    NUMA node1 CPU(s):     32-63
    NUMA node16 CPU(s):    64-95
    NUMA node17 CPU(s):    96-127

[kzak@redhat.com: - cpu_{max,min}_mhz() refactoring]

Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agosulogin: add missing type
Karel Zak [Tue, 9 May 2017 09:59:53 +0000 (11:59 +0200)] 
sulogin: add missing type

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoMerge branch '2017wk16' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 9 May 2017 09:58:23 +0000 (11:58 +0200)] 
Merge branch '2017wk16' of git://github.com/kerolasa/lelux-utiliteetit

* '2017wk16' of git://github.com/kerolasa/lelux-utiliteetit:
  chfn, chsh: use readline(3) to receive user input
  findfs: use getopt_long() to parse options
  logger: make month names, login name, and tag read-only objects
  sulogin: reduce vulnerability surface
  partx: add --list-types option
  libblkid: add blkid_partitions_get_name()
  docs: try to convince open(2) O_DIRECT rather than using raw device
  blkid: add long options
  lsipc: fix options parsing and sync with man page

7 years agotests: Add UDF CD-ROM hybrid image (ISO+Joliet+UDF) created by Nero 6
Pali Rohár [Mon, 1 May 2017 11:03:55 +0000 (13:03 +0200)] 
tests: Add UDF CD-ROM hybrid image (ISO+Joliet+UDF) created by Nero 6

This image was created by Nero Burning ROM version 6 via option CD-ROM
(UDF/ISO) with UDF version 2.01 and enabled ISO Joliet extension. Moreover
for testing purposes it has set custom Disc label (and also every other
identifier) which is different for ISO, Joiliet and UDF part. It contains
ISO/Joliet/UDF string prefix to distinguish between them.

So reading this image as basic ISO would produce different label as when
reading it as ISO with Joliet image and also different as UDF image.

Windows detects its label as "UDF Label".

Before commit ccfb5b0a1d318c1ac96884c70c7b5090331849fc blkid show label for
this image as "Joliet Label" and after as "UDF Label".

Note that it is not common to have such images with different label stored
in Joliet part and in UDF part. Moreover it is very hard to generate them.

7 years agotests: Fix test output for low-probe-udf to contain UDF data
Pali Rohár [Mon, 1 May 2017 10:57:53 +0000 (12:57 +0200)] 
tests: Fix test output for low-probe-udf to contain UDF data

Label was really not changed because of fix by commit
2f2730bc77c972d613cfec421468c84f15749708.

UUID is different due to fact that ISO image does not have UUID and
libblkid generate one from compilation date. Plus "Joliet Extension" in UDF
context does not make sense.

7 years agoRevert "libblkid: Probe UDF volumes for ISO9660 info as well"
Pali Rohár [Mon, 1 May 2017 09:19:02 +0000 (11:19 +0200)] 
Revert "libblkid: Probe UDF volumes for ISO9660 info as well"

This reverts commit 8053b51c7601c4a7e5f2eca45610b8228f53d408.

Reporting meaningless ID_FS_LABEL=UDF_Volume written in that commit was
caused by reading wrong value for UDF label and it was fixed in commit
2f2730bc77c972d613cfec421468c84f15749708.

So after this revert blkid reports for UDF filesystems label of UDF
filesystem and not label of ISO (if present) like other systems. In most
cases UDF and ISO labels are same (sometimes just one is upper case).

Commit 8053b51c7601c4a7e5f2eca45610b8228f53d408 just fixed result, not
reason why blkid reported different UDF Label as Windows. Real reason was
fixed in 2f2730bc77c972d613cfec421468c84f15749708.

7 years agocolumn: be robust on empty table
Karel Zak [Fri, 5 May 2017 11:56:40 +0000 (13:56 +0200)] 
column: be robust on empty table

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocolumn: require column names for JSON
Karel Zak [Fri, 5 May 2017 10:49:51 +0000 (12:49 +0200)] 
column: require column names for JSON

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agoblkid: fix return code when display the version
Alexey Gladkov [Thu, 4 May 2017 13:53:13 +0000 (15:53 +0200)] 
blkid: fix return code when display the version

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
7 years agocolumn: use libsmartcols to avoid circular dependences
Karel Zak [Fri, 5 May 2017 10:13:15 +0000 (12:13 +0200)] 
column: use libsmartcols to avoid circular dependences

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agolibsmartcols: add scols_line_is_ancestor()
Karel Zak [Fri, 5 May 2017 10:12:43 +0000 (12:12 +0200)] 
libsmartcols: add scols_line_is_ancestor()

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocolumn: add note that circular dependencies are ignored
Karel Zak [Fri, 5 May 2017 09:52:04 +0000 (11:52 +0200)] 
column: add note that circular dependencies are ignored

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocolumn: add --tree to the man page
Karel Zak [Fri, 5 May 2017 09:47:46 +0000 (11:47 +0200)] 
column: add --tree to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agocolumn: fix --tree id-parent loop crash
Karel Zak [Fri, 5 May 2017 09:31:47 +0000 (11:31 +0200)] 
column: fix --tree id-parent loop crash

The loop is silently ignored.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotests: add new build-sys tests
Karel Zak [Wed, 3 May 2017 12:33:04 +0000 (14:33 +0200)] 
tests: add new build-sys tests

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agotestsL update build-sys tests
Karel Zak [Wed, 3 May 2017 11:36:20 +0000 (13:36 +0200)] 
testsL update build-sys tests

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: fix lsmem dependence
Karel Zak [Wed, 3 May 2017 10:00:20 +0000 (12:00 +0200)] 
build-sys: fix lsmem dependence

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agobuild-sys: remove column-old.c
Karel Zak [Wed, 3 May 2017 08:40:46 +0000 (10:40 +0200)] 
build-sys: remove column-old.c

Signed-off-by: Karel Zak <kzak@redhat.com>
7 years agochfn, chsh: use readline(3) to receive user input
Sami Kerola [Sun, 23 Apr 2017 17:51:51 +0000 (18:51 +0100)] 
chfn, chsh: use readline(3) to receive user input

The readline offers editing capabilities while the user is entering the
line, unlike fgets(3) and getline(3) that were used earlier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>