]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
8 years agobuild-sys: release++ (v2.26.2) stable/v2.26 v2.26.2
Karel Zak [Thu, 30 Apr 2015 09:55:48 +0000 (11:55 +0200)] 
build-sys: release++ (v2.26.2)

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: add v2.26.2-ReleaseNotes
Karel Zak [Thu, 30 Apr 2015 09:54:30 +0000 (11:54 +0200)] 
docs: add v2.26.2-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update AUTHORS file
Karel Zak [Thu, 30 Apr 2015 09:51:11 +0000 (11:51 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: merge changes
Karel Zak [Thu, 30 Apr 2015 09:48:58 +0000 (11:48 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Thu, 30 Apr 2015 09:41:29 +0000 (11:41 +0200)] 
po: update ja.po (from translationproject.org)

8 years agopo: update da.po (from translationproject.org)
Joe Hansen [Thu, 30 Apr 2015 09:41:07 +0000 (11:41 +0200)] 
po: update da.po (from translationproject.org)

9 years agohwclock: flush stdout in hwclock -c
Alexey Galakhov [Thu, 16 Apr 2015 15:26:27 +0000 (17:26 +0200)] 
hwclock: flush stdout in hwclock -c

This allows using hwclock -c in automated test scripts that parse
its output line-by-line. The standard output is flushed before
each 10 second delay.

Signed-off-by: Alexey Galakhov <agalakhov@gmail.com>
9 years agohwclock: Remove TZUTC
J William Piggott [Thu, 23 Apr 2015 23:53:58 +0000 (19:53 -0400)] 
hwclock: Remove TZUTC

commit d53f8ecfbf036eddb2aef737dc0973a613d80ced
introduced the TZUTC environment variable to
facilitate use of the zoneinfo 'right' database.
This was incorrect. Either the TZDIR environment
variable should be used or a system-wide
configuration for the 'right' database should be
used.

See hwclock(8) POSIX vs 'RIGHT' for more details.

TZUTC was undocumented and should be safe to remove.

The commit also caused a regression when using
musl libc, because when TZUTC is unset getenv()
returns a NULL pointer.
Reported-by: Isaac Dunham <ibid.ag@gmail.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
9 years agotests: fix sfdisk GPT test
Karel Zak [Thu, 23 Apr 2015 13:08:26 +0000 (15:08 +0200)] 
tests: fix sfdisk GPT test

The test uses too large last partition, libfdisk checks this problem
now.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (gpt) add extra check for First/Last LBA
Karel Zak [Thu, 23 Apr 2015 10:32:36 +0000 (12:32 +0200)] 
libfdisk: (gpt) add extra check for First/Last LBA

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add sfdisk resize tests for GPT
Karel Zak [Thu, 23 Apr 2015 09:37:00 +0000 (11:37 +0200)] 
tests: add sfdisk resize tests for GPT

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (gpt) fix end sector calculation on resize
Karel Zak [Thu, 23 Apr 2015 09:34:05 +0000 (11:34 +0200)] 
libfdisk: (gpt) fix end sector calculation on resize

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add sfdisk resize regression tests for MBR
Karel Zak [Wed, 22 Apr 2015 15:15:39 +0000 (17:15 +0200)] 
tests: add sfdisk resize regression tests for MBR

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: fix scriptk parser to support alone signs
Karel Zak [Wed, 22 Apr 2015 15:14:28 +0000 (17:14 +0200)] 
libfdisk: fix scriptk parser to support alone signs

for example echo "- - - *" | sfdisk /dev/sda1 -N1

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: allow to move start to first usable LBA
Karel Zak [Wed, 22 Apr 2015 15:13:48 +0000 (17:13 +0200)] 
libfdisk: allow to move start to first usable LBA

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: add warning to resize function
Karel Zak [Tue, 21 Apr 2015 13:51:45 +0000 (15:51 +0200)] 
libfdisk: add warning to resize function

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: support resize operation in fdisk_set_partition()
Karel Zak [Tue, 21 Apr 2015 12:36:24 +0000 (14:36 +0200)] 
libfdisk: support resize operation in fdisk_set_partition()

Note that the resize is not exported by API yet, the only way to use
it is sfdisk-like scripts.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: add fdisk_table_get_partition_by_partno()
Karel Zak [Tue, 21 Apr 2015 12:35:18 +0000 (14:35 +0200)] 
libfdisk: add fdisk_table_get_partition_by_partno()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: fix script parser to support resize operations
Karel Zak [Tue, 21 Apr 2015 12:32:31 +0000 (14:32 +0200)] 
libfdisk: fix script parser to support resize operations

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: don't resize in label drivers
Karel Zak [Tue, 21 Apr 2015 12:30:11 +0000 (14:30 +0200)] 
libfdisk: don't resize in label drivers

The resize operation has to be implemented on upper layer.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (gpt) fix LE usage
Karel Zak [Wed, 22 Apr 2015 09:52:24 +0000 (11:52 +0200)] 
libfdisk: (gpt) fix LE usage

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolib/strutils: fix string_add_to_idarray() int vs. size_t
Karel Zak [Wed, 22 Apr 2015 09:08:05 +0000 (11:08 +0200)] 
lib/strutils: fix string_add_to_idarray() int vs. size_t

The function uses "int" as argument, but for array size (and index) is better
to use unsigned type (size_t). If we mix "size_t" in util (e.g. fdisk)
and "int" in lib/strutils.c then result is unexpected behavior on
ppc64.

# sfdisk --list -o DEVICE,START,SIZE /dev/sdb
Disk /dev/sdb: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 32768 bytes
Disklabel type: gpt
Disk identifier: 3B8559DB-33AF-43E9-BEFC-C331D829B539
lt-sfdisk: libfdisk/src/label.c:178: fdisk_label_get_field: Assertion `id > 0' failed.

The patch cleanup all code to use size_t everywhere.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofdisk, sfdisk: fix -o <list> backend
Karel Zak [Wed, 22 Apr 2015 08:20:31 +0000 (10:20 +0200)] 
fdisk, sfdisk: fix -o <list> backend

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: config.h lives in build directory
Ruediger Meier [Wed, 22 Apr 2015 06:05:47 +0000 (08:05 +0200)] 
tests: config.h lives in build directory

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agohwclock: regression fix
J William Piggott [Tue, 21 Apr 2015 20:43:41 +0000 (16:43 -0400)] 
hwclock: regression fix

Commit ab8f402952301106ad0bd5c5a51dc8646d1bff64 regression
where synchronize_to_clock_tick_rtc() only returns the correct
value for a select() time out if using debug mode. This caused
hwclock to have invalid output when select() timed out in
normal mode.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
9 years agotests: never use -o pipefail
Ruediger Meier [Tue, 21 Apr 2015 08:41:01 +0000 (10:41 +0200)] 
tests: never use -o pipefail

It was hard to find out that pipefail was the reason why our
test-suite could have random failures for aribtrary tests,
for example the ones which are using ts_device_has_uuid() or
ts_mount().

Bash's pipefall option is evil! It may return error for such a
simple line like this one
$ echo -e "xxx\nyyy" | grep -q "xxx"
because the left echo command will get SIGPIPE when grep exits after
the first match. So the command line above could return an error
eventhough it does exactly what we want.

This patch removes any pipefail from our tests. The funny thing is
that I couldn't find any case where we relied on this feature anyway.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agosfdisk: don't use BLKRRPART to check loopdev usage
Karel Zak [Fri, 17 Apr 2015 08:32:48 +0000 (10:32 +0200)] 
sfdisk: don't use BLKRRPART to check loopdev usage

It seesm that kernel always returns EINVAL for BLKRRPART on loop
devices, we call the ioctl to check if nobody else uses the device.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add old dump for sfdisk
Karel Zak [Thu, 16 Apr 2015 16:01:32 +0000 (18:01 +0200)] 
tests: add old dump for sfdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agosfdisk: accept empty partitions from dump
Karel Zak [Thu, 16 Apr 2015 15:40:28 +0000 (17:40 +0200)] 
sfdisk: accept empty partitions from dump

Old sfdisk uses:
  dev/sdc2 : start=        0, size=        0, Id= 0

for undefined MBR partitions. Let's follow this behaviour.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: fix logger device pathname too long
Ruediger Meier [Tue, 14 Apr 2015 12:54:52 +0000 (14:54 +0200)] 
tests: fix logger device pathname too long

$TS_OUTDIR may be too long for sockaddr_un.sun_path. Noticed on travis
in distcheck.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: loop tests, don't call ts_die() with DEVICE parameter
Ruediger Meier [Tue, 31 Mar 2015 12:35:07 +0000 (14:35 +0200)] 
tests: loop tests, don't call ts_die() with DEVICE parameter

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: scsi_debug tests, don't call ts_die() with DEVICE parameter
Ruediger Meier [Tue, 31 Mar 2015 12:23:30 +0000 (14:23 +0200)] 
tests: scsi_debug tests, don't call ts_die() with DEVICE parameter

This was almost useless anyway.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: introduce TS_LOOP_DEVS for cleanup
Ruediger Meier [Tue, 31 Mar 2015 12:19:40 +0000 (14:19 +0200)] 
tests: introduce TS_LOOP_DEVS for cleanup

We are maintaining an array TS_LOOP_DEVS to de-initialize devices
always on exit. Until now there was no cleanup in ts_skip().

The downside is that we can't execute ts_device_init() in a subshell
anymore. The device is returned via global variable TS_LODEV, similar
like we do already in ts_scsi_debug_init().

Tests which don't use ts_device_init() to create loop devices may use
ts_register_loop_device() to get them cleaned up later.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: introduce ts_cleanup_on_exit()
Ruediger Meier [Tue, 31 Mar 2015 08:54:56 +0000 (10:54 +0200)] 
tests: introduce ts_cleanup_on_exit()

ts_cleanup_on_exit() is always called on exit, e.g. after ts_skip,
ts_die, ts_finalize ...

A first usage example is the cleanup of TS_SUID_PROGS which is now also done
on ts_skip. Later we want to fix some left loop devices.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agolib/sysfs.c: use fcntl(..F_DUPFD_CLOEXEC) instead of dup(2)
Cristian Rodríguez [Fri, 10 Apr 2015 18:57:58 +0000 (15:57 -0300)] 
lib/sysfs.c: use fcntl(..F_DUPFD_CLOEXEC) instead of dup(2)

"The two descriptors do not share file descriptor flags (the
close-on-exec flag).  The close-on-exec flag  for the duplicate descriptor is off"

9 years agotests: make libmount python context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO
Karel Zak [Tue, 14 Apr 2015 09:26:54 +0000 (11:26 +0200)] 
tests: make libmount python context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: make libmount context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO
Karel Zak [Tue, 14 Apr 2015 09:26:54 +0000 (11:26 +0200)] 
tests: make libmount context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotravis: install socat >= 1.7.2
Ruediger Meier [Mon, 13 Apr 2015 11:29:26 +0000 (13:29 +0200)] 
travis: install socat >= 1.7.2

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: add subtests for invalid logger devive
Ruediger Meier [Fri, 10 Apr 2015 06:28:26 +0000 (08:28 +0200)] 
tests: add subtests for invalid logger devive

Note --journald should not complain about invalid sockets.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: logger/errors does not use --no-act
Ruediger Meier [Thu, 9 Apr 2015 18:14:51 +0000 (20:14 +0200)] 
tests: logger/errors does not use --no-act

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agosfdisk: enable bootbits protection
Karel Zak [Mon, 13 Apr 2015 11:41:10 +0000 (13:41 +0200)] 
sfdisk: enable bootbits protection

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210428
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: support bootbits protection from (p)MBR
Karel Zak [Mon, 13 Apr 2015 11:40:25 +0000 (13:40 +0200)] 
libfdisk: support bootbits protection from (p)MBR

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: logger, validate written socket data
Ruediger Meier [Thu, 9 Apr 2015 18:14:50 +0000 (20:14 +0200)] 
tests: logger, validate written socket data

Actually there should be no data written to the socket because
we are always using --no-act.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: logger with socat device
Ruediger Meier [Thu, 9 Apr 2015 15:12:34 +0000 (17:12 +0200)] 
tests: logger with socat device

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agosfdisk: improve -N warnings
Karel Zak [Mon, 13 Apr 2015 10:08:50 +0000 (12:08 +0200)] 
sfdisk: improve -N warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add sfdisk resize tests
Karel Zak [Mon, 13 Apr 2015 08:56:03 +0000 (10:56 +0200)] 
tests: add sfdisk resize tests

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: require wipefs for sfdisk/gpt
Karel Zak [Mon, 13 Apr 2015 08:35:51 +0000 (10:35 +0200)] 
tests: require wipefs for sfdisk/gpt

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (dos) retain existing boot flag when resizing a partition
Karel Zak [Mon, 13 Apr 2015 08:29:00 +0000 (10:29 +0200)] 
libfdisk: (dos)  retain existing boot flag when resizing a partition

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210912
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author:  awilliam@redhat.com

9 years agotests: simplify common logger options
Ruediger Meier [Thu, 9 Apr 2015 15:00:26 +0000 (17:00 +0200)] 
tests: simplify common logger options

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agologger: --stderr and --no-act turn "auto-errors" on
Ruediger Meier [Thu, 26 Mar 2015 13:20:29 +0000 (14:20 +0100)] 
logger: --stderr and --no-act turn "auto-errors" on

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agolibfdisk: recognize FAT32 partitions hidden by Acronis software
Jörg Jenderek [Wed, 8 Apr 2015 08:24:26 +0000 (10:24 +0200)] 
libfdisk: recognize FAT32 partitions hidden by Acronis software

References: http://www.acronis.de/products/trueimage
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Jörg Jenderek <joerg.jen.der.ek@gmx.net>
9 years agowhereis: trivial spelling and grammar fix
Mike Place [Tue, 7 Apr 2015 08:44:50 +0000 (10:44 +0200)] 
whereis: trivial spelling and grammar fix

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: fix memory leaks
Sami Kerola [Tue, 7 Apr 2015 07:58:19 +0000 (08:58 +0100)] 
logger: fix memory leaks

Reported-by: Patrick Plagwitz <patrick.plagwitz@fau.de>
Signed-off-by: Sami Kerola <sami.kerola@lastminute.com>
9 years agologger: generate header when reading message from stdin
Patrick Plagwitz [Mon, 6 Apr 2015 21:50:46 +0000 (22:50 +0100)] 
logger: generate header when reading message from stdin

This change fixes crashing error, that ought not to be simply avoided.

$ echo foo | logger -n localhost
Segmentation fault (core dumped)

If the ctl->hdr is just checked not to be NULL syslog message will not
have valid header, so generating such is not optional when reading
message from stdin and writing it to remote destination.

Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Patrick Plagwitz <patrick.plagwitz@fau.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agolibmount: add note about flock() to docs
Karel Zak [Thu, 2 Apr 2015 10:30:26 +0000 (12:30 +0200)] 
libmount: add note about flock() to docs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: mount/rlimit tries to restore mtab
Ruediger Meier [Thu, 2 Apr 2015 09:35:29 +0000 (11:35 +0200)] 
tests: mount/rlimit tries to restore mtab

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: fix, don't call ts_die from subshell
Ruediger Meier [Tue, 31 Mar 2015 14:07:37 +0000 (16:07 +0200)] 
tests: fix, don't call ts_die from subshell

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: ts_scsi_debug_init() sleeps a bit earlier
Ruediger Meier [Sat, 28 Mar 2015 14:32:30 +0000 (15:32 +0100)] 
tests: ts_scsi_debug_init() sleeps a bit earlier

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: fix cramfs/mkfs for BE and different pagesizes
Ruediger Meier [Sat, 28 Mar 2015 11:34:43 +0000 (12:34 +0100)] 
tests: fix cramfs/mkfs for BE and different pagesizes

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agolsblk: don't ignore dependences for partitioned devies
Karel Zak [Wed, 1 Apr 2015 10:23:23 +0000 (12:23 +0200)] 
lsblk: don't ignore dependences for partitioned devies

The code only lists partitions, but ignore another dependencies
on whole-disk device:

$ lsblk /dev/sdb
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0 298.1G  0 disk
└─sdb1   8:17   0 298.1G  0 part

$ ls /sys/block/sdb/holders/
dm-0

fixed version:

$ lsblk /dev/sdb
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdb           8:16   0 298.1G  0 disk
├─sdb1        8:17   0 298.1G  0 part
└─mpatha    253:0    0 298.1G  0 mpath
  └─mpatha1 253:1    0 298.1G  0 part

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsblk: follow kernel for inverse tree
Karel Zak [Wed, 1 Apr 2015 10:06:41 +0000 (12:06 +0200)] 
lsblk: follow kernel for inverse tree

For multi-path devices kernel defines dependence between the device
and whole-list:

$ ls /sys/block/dm-0/slaves/
sdb

but lsblk inserts partition into the tree:

$ lsblk -s -oNAME,KNAME /dev/dm-1
mpatha1   dm-1
└─mpatha  dm-0
  └─sdb1  sdb1     <--- !
    └─sdb sdb

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsblk: add debug support
Karel Zak [Wed, 1 Apr 2015 10:06:15 +0000 (12:06 +0200)] 
lsblk: add debug support

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: define cfdisk dependence on open_memstream
Karel Zak [Mon, 30 Mar 2015 11:54:08 +0000 (13:54 +0200)] 
build-sys: define cfdisk dependence on open_memstream

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomount: fix lazytime docs
Karel Zak [Mon, 30 Mar 2015 10:52:22 +0000 (12:52 +0200)] 
mount: fix lazytime docs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: add support for MS_LAZYTIME
Karel Zak [Mon, 30 Mar 2015 10:43:45 +0000 (12:43 +0200)] 
libmount: add support for MS_LAZYTIME

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agosetarch: fix regression for sparc builds
Waldemar Brodkorb [Sun, 29 Mar 2015 13:00:30 +0000 (15:00 +0200)] 
setarch: fix regression for sparc builds

With following commit:
5edb0ea6bbd57dd916417737f98c9109dc1ecb5b

Sparc cross-compile fails.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
9 years agolibfdisk: don't return empty strings from fdisk_partition_to_string()
Karel Zak [Fri, 27 Mar 2015 12:47:13 +0000 (13:47 +0100)] 
libfdisk: don't return empty strings from fdisk_partition_to_string()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agosfdisk: fix -a vs. -A bug
Karel Zak [Thu, 26 Mar 2015 17:21:53 +0000 (18:21 +0100)] 
sfdisk: fix -a vs. -A bug

The -A has been originally used for --activate, since v2.26 it's used
for --append. This is stupid mistake. This patch reverts the change to:

 -A, --activate
 -a, --append

Note that --append is a new command line option in v2.26.

Addresses: https://bugs.archlinux.org/task/44349
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: verify logger return value
Ruediger Meier [Tue, 24 Mar 2015 18:37:01 +0000 (19:37 +0100)] 
tests: verify logger return value

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: avoid &>> for bash compatibility
Ruediger Meier [Tue, 24 Mar 2015 08:47:49 +0000 (09:47 +0100)] 
tests: avoid &>> for bash compatibility

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: fix getopt for old glibc
Ruediger Meier [Tue, 24 Mar 2015 08:37:30 +0000 (09:37 +0100)] 
tests: fix getopt for old glibc

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agobuild-sys: python is optional, don't fail when missing
Karel Zak [Thu, 26 Mar 2015 11:09:50 +0000 (12:09 +0100)] 
build-sys: python is optional, don't fail when missing

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: ncurses is optional, don't fail when missing
Karel Zak [Thu, 26 Mar 2015 10:50:15 +0000 (11:50 +0100)] 
build-sys: ncurses is optional, don't fail when missing

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: more(1) depends on terminal, force to TERM=linux
Karel Zak [Wed, 25 Mar 2015 16:36:28 +0000 (17:36 +0100)] 
tests: more(1) depends on terminal, force to TERM=linux

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: fix symbols versioning script
Karel Zak [Wed, 25 Mar 2015 10:08:22 +0000 (11:08 +0100)] 
libfdisk: fix symbols versioning script

Really stupid copy & past mistake. The libfdisk symbols should not be
prefixed by MOUNT_ suffix.

This change makes binaries linked with libfdisk 2.26 incompatible with
new libfdisk. Fortunately, 2.26 has been the first release and very
probably the library has been used for util-linux fdisks only.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolast, fix race when comparing time stamps
Ruediger Meier [Tue, 24 Mar 2015 11:22:13 +0000 (12:22 +0100)] 
last, fix race when comparing time stamps

It is just luck if two time() calls happen within the same
second. Introduced in 31d28e09.

Actually I don't like adding another global variable but this
way we avoid bigger refactoring. IMO it's questionable why
lastdate, lastdown, etc. are initialized with current time() at
all. It looks unsafe to print "still running" always when
logout_time = now.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agolast: fix first (current) runlevel line
Ruediger Meier [Tue, 24 Mar 2015 13:38:09 +0000 (14:38 +0100)] 
last: fix first (current) runlevel line

Since 744c7fec lastrch was not set to current time anymore, but we need it.

 # broken:
 $ ./last -x | grep -m 2 runlevel
 runlevel (to lvl 5)   3.11.10-25-deskt Wed Feb 18 13:11 - 01:00 (-16484+-12:-11)
 runlevel (to lvl 5)   3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21)

 # fixed:
 $ ./last -x | grep -m 2 runlevel
 runlevel (to lvl 5)   3.11.10-25-deskt Wed Feb 18 13:11   still running
 runlevel (to lvl 5)   3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agofsck: fix fsck -C {fd} parsing
Stanislav Brabec [Tue, 24 Mar 2015 20:01:10 +0000 (21:01 +0100)] 
fsck: fix fsck -C {fd} parsing

Both fsck(8) and fsck --help documents progress bar redirection as
-C {fd}

This did not work, and only -C{fd} and "-C {fd}" worked.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (gpt) check header size before verify CRC
Karel Zak [Mon, 23 Mar 2015 11:03:30 +0000 (12:03 +0100)] 
libfdisk: (gpt) check header size before verify CRC

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780834
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: fix LOGGER_TEST_TIMEOFDAY check
Karel Zak [Mon, 23 Mar 2015 10:40:45 +0000 (11:40 +0100)] 
logger: fix LOGGER_TEST_TIMEOFDAY check

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodmesg: fix shadow declaration
Sami Kerola [Sun, 22 Mar 2015 23:05:26 +0000 (23:05 +0000)] 
dmesg: fix shadow declaration

sys-utils/dmesg.c:650:9: warning: declaration of 's' shadows a previous local [-Wshadow]
sys-utils/dmesg.c:619:12: warning: shadowed declaration is here [-Wshadow]

And since the code had to be touched deprecate loop printing one character
at a time, in favour of printf and instruction to repeat spaces the number
required.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomount: don't remount read-only on --bind
Karel Zak [Fri, 20 Mar 2015 11:42:33 +0000 (12:42 +0100)] 
mount: don't remount read-only on --bind

mount(8) tries to mount read-only when the previous attempt ends with
EROFS or EACCES. This is bad idea for bind mounts as "ro,bind" has
a special semantic.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: start script/race test only when --force specified
Karel Zak [Thu, 19 Mar 2015 11:06:35 +0000 (12:06 +0100)] 
tests: start script/race test only when --force specified

The test generates 1000 processes and it seems too invasive for
test/build machines and containers.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotravis: add MAKE_CHECK_OPTS
Karel Zak [Tue, 17 Mar 2015 11:03:28 +0000 (12:03 +0100)] 
travis: add MAKE_CHECK_OPTS

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add --skip-loopdevs
Karel Zak [Tue, 17 Mar 2015 10:34:22 +0000 (11:34 +0100)] 
tests: add --skip-loopdevs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: use ts_skip for logger/journald
Karel Zak [Tue, 17 Mar 2015 10:21:39 +0000 (11:21 +0100)] 
tests: use ts_skip for logger/journald

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoblockdev: fix whole-disk start sector usage
Karel Zak [Tue, 17 Mar 2015 10:10:20 +0000 (11:10 +0100)] 
blockdev: fix whole-disk start sector usage

Since 569d1dac7bc64457aac11163b6a91ce9b41a6715 we read device start
sector from the /sys/block/.../start file. The file exists only for
partitions, for wholedisk is the start of the device always zero.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1202443
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: add new compiler warnings
Karel Zak [Tue, 17 Mar 2015 09:15:50 +0000 (10:15 +0100)] 
build-sys: add new compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: fix compiler warnings
Sami Kerola [Mon, 16 Mar 2015 00:03:49 +0000 (00:03 +0000)] 
libblkid: fix compiler warnings

warning: extra ';' outside of a function [-Wextra-semi]

warning: embedding a directive within macro arguments has undefined
behavior [-Wembedded-directive]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotests: add logger(1) journald test
Sami Kerola [Mon, 16 Mar 2015 23:42:57 +0000 (23:42 +0000)] 
tests: add logger(1) journald test

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotests: add logger(1) error condition tests
Sami Kerola [Sun, 15 Mar 2015 12:46:30 +0000 (12:46 +0000)] 
tests: add logger(1) error condition tests

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotests: add logger(1) message format tests
Sami Kerola [Sun, 15 Mar 2015 12:00:57 +0000 (12:00 +0000)] 
tests: add logger(1) message format tests

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotests: optionally skip tests where loop support is needed
Ruediger Meier [Mon, 16 Mar 2015 11:22:53 +0000 (12:22 +0100)] 
tests: optionally skip tests where loop support is needed

It can be hard to check for loop support (e.g. on LXC containers). Let
the user skip it manually by env:

TS_OPT_FEAT_SKIP_LOOP="yes"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotravis: whitelist travis* branches
Ruediger Meier [Mon, 16 Mar 2015 11:20:53 +0000 (12:20 +0100)] 
travis: whitelist travis* branches

Sometimes we may want to test non-master branches.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotravis: move install script to .travis-functions.sh
Ruediger Meier [Mon, 16 Mar 2015 10:21:49 +0000 (11:21 +0100)] 
travis: move install script to .travis-functions.sh

Now this snippet can be re-used by non-travis systems. For example
on drone.io we can use this simple build script:
......
MAKE_CHECK="root"
source ./.travis-functions.sh
travis_install_script || exit
travis_before_script || exit
ret=0
travis_script || ret=$?
travis_after_script
exit $ret
......

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: use --no-act for logger tests
Karel Zak [Mon, 16 Mar 2015 13:17:49 +0000 (14:17 +0100)] 
tests: use --no-act for logger tests

and also use --stderr on one place only.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add logger(1) command line options tests
Sami Kerola [Sun, 15 Mar 2015 12:54:50 +0000 (12:54 +0000)] 
tests: add logger(1) command line options tests

[kzak@redhat.com: - use LOGGER_TEST_* env]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: add -DTEST_LOGGER
Karel Zak [Mon, 16 Mar 2015 12:26:52 +0000 (13:26 +0100)] 
logger: add -DTEST_LOGGER

"make test_logger" now compiles logger(1) test program
to overwrite system datetime stuff, hostname and PID, for example:

   export TZ=GMT
   export LOGGER_TEST_TIMEOFDAY=1234567890.123456
   export LOGGER_TEST_HOSTNAME=foo
   export LOGGER_TEST_GETPID=123

   ./test_logger --rfc5424 --no-act --stderr -i --tag MyTag mesg
   <13>1 2009-02-13T23:31:30.123456+00:00 foo MyTag 123 - [timeQuality tzKnown="1" isSynced="0"] mesg

if the LOGGER_TEST_* variables are not specified then default to
standard logger(1) behavior.

Note that it would be possible to use for example "unshare --utc" to
make hostname stable and portable, but LOGGER_TEST_* variables allow
to keep the tests less complex.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: add --no-act for testing
Karel Zak [Mon, 16 Mar 2015 11:38:46 +0000 (12:38 +0100)] 
logger: add --no-act for testing

* force --journal mode to also output to stderr when the option
  --stderr specified on command line

* add --no-act to avoid all write() operations to make it possible to
  write tests without "spam" system logs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: fix rfc5424 format crash
Karel Zak [Mon, 16 Mar 2015 10:51:05 +0000 (11:51 +0100)] 
logger: fix rfc5424 format crash

$ logger --rfc5424=notq message
Segmentation fault (core dumped)

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>