]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 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>
10 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>
10 years agoMerge branch 'fix-last' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 7 Apr 2015 13:22:22 +0000 (15:22 +0200)] 
Merge branch 'fix-last' of https://github.com/rudimeier/util-linux

* 'fix-last' of https://github.com/rudimeier/util-linux:
  last, fix race when comparing time stamps
  last: fix first (current) runlevel line

10 years agocal: add -Y and -n <num>
Max Klinger [Tue, 7 Apr 2015 11:05:39 +0000 (13:05 +0200)] 
cal: add -Y and -n <num>

[kzak@redhat.com: - add month_in_row to avoid extra meaning of num_month=-3,
                  - add header_year
                  - add long option for -Y
                  - define conflicts between -Y, -y and -n
                  - remove ctl.yflag]

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoMerge branch 'test-fixes' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 7 Apr 2015 10:42:56 +0000 (12:42 +0200)] 
Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux

* 'test-fixes' of https://github.com/rudimeier/util-linux:
  tests: mount/rlimit tries to restore mtab
  tests: fix, don't call ts_die from subshell
  tests: ts_scsi_debug_init() sleeps a bit earlier
  tests: fix cramfs/mkfs for BE and different pagesizes

10 years agoMerge branch 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 7 Apr 2015 10:31:55 +0000 (12:31 +0200)] 
Merge branch 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux

* 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux:
  build-sys: typo -ltinfo

10 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>
10 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>
10 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>
10 years agowall: do not use a temporary file.
Karel Zak [Fri, 3 Apr 2015 09:44:24 +0000 (11:44 +0200)] 
wall: do not use a temporary file.

The issue with using a temporary file in wall is that wall runs as setgid.
This means that an unprivileged user who runs wall can modify wall's
temporary files, even if those are mode 0600, so the unprivileged user can
edit and effectively suppress the banner. The fix is to simply not use
temporary files.

[kzak@redhat.com: - rewrite growing string functions
                  - use struct buffer
                  - add buf_print() function]

Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Jann Horn <jann@thejh.net>

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agocfdisk: cleanup extra partitions info for slang
Karel Zak [Tue, 31 Mar 2015 11:10:17 +0000 (13:10 +0200)] 
cfdisk: cleanup extra partitions info for slang

The patch removes problem with getch() on slang, now the code is based
on subwin() and extra info window is persistent.

A new problem is that slang does not keep sub-window border
persistent. I'm going to ignore this slang problem... use ncurses
dude!

Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 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>
10 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>
10 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>
10 years agobuild-sys: typo -ltinfo
Ruediger Meier [Sat, 28 Mar 2015 10:23:53 +0000 (11:23 +0100)] 
build-sys: typo -ltinfo

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agosfdisk: cleanup prompt usage
Karel Zak [Fri, 27 Mar 2015 14:04:58 +0000 (15:04 +0100)] 
sfdisk: cleanup prompt usage

Let's use fgets-like callback only when compiled with readline,
otherwise (and also for non-tty) print prompt by printf().

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agocfdisk: provide extra partinfo with "x"
Ondrej Oprala [Fri, 20 Feb 2015 08:41:19 +0000 (09:41 +0100)] 
cfdisk: provide extra partinfo with "x"

The new 'extra' info provides:

 * filesystem information from libblkid (TYPE, UUID, LABEL)

   This feature is based on libblkid ability to probe specified area
   on the device. It allows to probe for filesystems although the
   partition devices (e.g. /dev/sda2) does not exist. For example from
   disk image:

    # cfdisk /home/archive/fs-images/disk.img

 * additional information from libfdisk (partition UUID, Name, ...)

 * mount information from libmount (from fstab or mountinfo)

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Karel Zak <kzak@redhat.com>

10 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>
10 years agobuild-sys: add HAVE_LIBMOUNT
Karel Zak [Fri, 27 Mar 2015 12:46:15 +0000 (13:46 +0100)] 
build-sys: add HAVE_LIBMOUNT

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: add TINFO_LIBS_STATIC
Karel Zak [Fri, 27 Mar 2015 09:32:24 +0000 (10:32 +0100)] 
build-sys: add TINFO_LIBS_STATIC

and use this variable for $READLINE_LIBS_STATIC.

Note the patch also moves READLINE checks after TINFO check.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: fix READLINE_LIBS_STATIC usage for fdisk
Karel Zak [Thu, 26 Mar 2015 18:05:11 +0000 (19:05 +0100)] 
build-sys: fix READLINE_LIBS_STATIC usage for fdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 years agodocs: document --exclude for tests
Karel Zak [Thu, 26 Mar 2015 12:00:24 +0000 (13:00 +0100)] 
docs: document --exclude for tests

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add documentation about environment variables
Ruediger Meier [Wed, 25 Mar 2015 11:09:36 +0000 (12:09 +0100)] 
tests: add documentation about environment variables

Introduced in 8e3ac29e, now advertised :)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agotests: add --exclude=<list> for run.sh
Karel Zak [Wed, 25 Mar 2015 18:32:22 +0000 (19:32 +0100)] 
tests: add --exclude=<list> for run.sh

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: support static build with readline
Karel Zak [Wed, 25 Mar 2015 16:55:22 +0000 (17:55 +0100)] 
build-sys: support static build with readline

Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 years agodocs: remove obsolete things from TODO
Karel Zak [Wed, 25 Mar 2015 15:09:32 +0000 (16:09 +0100)] 
docs: remove obsolete things from TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add readline support
Karel Zak [Wed, 25 Mar 2015 15:06:39 +0000 (16:06 +0100)] 
sfdisk: add readline support

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: fix readline wrapper
Karel Zak [Wed, 25 Mar 2015 15:06:26 +0000 (16:06 +0100)] 
fdisk: fix readline wrapper

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add fgets() callback for scripts
Karel Zak [Wed, 25 Mar 2015 15:05:14 +0000 (16:05 +0100)] 
libfdisk: add fgets() callback for scripts

Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 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>
10 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>
10 years agofdisk: add GNU Readline support to fdisk
Karel Zak [Wed, 25 Mar 2015 09:31:37 +0000 (10:31 +0100)] 
fdisk: add GNU Readline support to fdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: add --with-readline
Ondrej Oprala [Mon, 2 Feb 2015 17:11:40 +0000 (18:11 +0100)] 
build-sys: add --with-readline

[kzak@redhat.com: - define READLINE_LIBS]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 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>
10 years agodmesg: use GMT in tests, add DMESG_TEST_BOOTIME
Karel Zak [Mon, 23 Mar 2015 10:40:59 +0000 (11:40 +0100)] 
dmesg: use GMT in tests, add DMESG_TEST_BOOTIME

We don't want to hardcode anything to the test, just use
env.variable DMESG_TEST_BOOTIME.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 years agotests: check dmesg message coloring
Sami Kerola [Sun, 22 Mar 2015 23:05:30 +0000 (23:05 +0000)] 
tests: check dmesg message coloring

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotests: check timestamp formats
Sami Kerola [Sun, 22 Mar 2015 23:05:29 +0000 (23:05 +0000)] 
tests: check timestamp formats

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotests: add test_dmesg that has fixed boot time
Sami Kerola [Sun, 22 Mar 2015 23:05:28 +0000 (23:05 +0000)] 
tests: add test_dmesg that has fixed boot time

This allows testing time stamp formats.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotests: add dmesg multiline message check
Sami Kerola [Sun, 22 Mar 2015 23:05:27 +0000 (23:05 +0000)] 
tests: add dmesg multiline message check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 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>
10 years agounshare: add --propagation, use MS_PRIVATE by default
Karel Zak [Wed, 18 Mar 2015 14:13:15 +0000 (15:13 +0100)] 
unshare: add --propagation, use MS_PRIVATE by default

After "unshare --mount" users assume that mount operations within the
new namespaces are unshared (invisible for the rest of the system).

Unfortunately, this is not true and the behavior depends on the
current mount propagation setting. The kernel default is "private",
but for example systemd based distros use "shared". The solution is to
use (for example) "mount --make-private" after unshare(1).

I have been requested many times to provide less fragile and more
unified unshared mount setting *by default* to make things user
friendly.

The patch forces unshare(1) to explicitly use MS_REC|MS_PRIVATE for all
tree by default.

We can use something less (e.g MS_SLAVE), but "private" is the kernel
default, so for many users this change (feature) will be invisible.

This feature is possible to disable by "--propagation unchanged" or it's
possible to specify another propagation flag, supported are:

<slave|shared|private|unchanged>

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agonsenter: add -Z to set selinux context
Karel Zak [Fri, 20 Mar 2015 14:26:58 +0000 (15:26 +0100)] 
nsenter: add -Z to set selinux context

The new context is copied from --target <PID>. This solution allows to
keep SELinux happy when you enter container by nsenter(1).

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1116100
Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 years agotests: remove private2 dir from mount/move
Karel Zak [Fri, 20 Mar 2015 10:05:42 +0000 (11:05 +0100)] 
tests: remove private2 dir from mount/move

The directory is unnecessary, all we need is to create from "private"
directory a mount point (so "--bind $DIR_PRIVATE $DIR_PRIVATE").

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: some more mount error handling
Ruediger Meier [Thu, 19 Mar 2015 16:12:15 +0000 (17:12 +0100)] 
tests: some more mount error handling

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: more error handling in mount/move (refactor)
Ruediger Meier [Thu, 19 Mar 2015 16:12:00 +0000 (17:12 +0100)] 
tests: more error handling in mount/move (refactor)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: mount/move also tests findmnt vs. mountpoint
Ruediger Meier [Thu, 19 Mar 2015 16:11:43 +0000 (17:11 +0100)] 
tests: mount/move also tests findmnt vs. mountpoint

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agofindmnt: add --mountpoint command line option
Karel Zak [Thu, 19 Mar 2015 11:08:30 +0000 (12:08 +0100)] 
findmnt: add --mountpoint command line option

The current --target <path> implementation check the <path> elements in
reverse order to get the mountpoint. The feature may be inwanted in
some cases when we really want to check for mountpoint specified by
the <path>. The new option "--mountpoint <path>" allows to be strict.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 years agohwclock: non-root access in test mode
J William Piggott [Sun, 15 Mar 2015 20:44:05 +0000 (16:44 -0400)] 
hwclock: non-root access in test mode

Allow a non-root user to call all hwclock
functions when the --test option is used.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: increase debug output precision
J William Piggott [Sun, 15 Mar 2015 18:17:13 +0000 (14:17 -0400)] 
hwclock: increase debug output precision

Increased the precision in debug output showing
the clock drift and the time lapsed.

Showing a clock drift of 0.0 while giving a value that the
drift factor was adjusted by makes no sense.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 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>
10 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>
10 years agoMerge branch 'drone-ci' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 17 Mar 2015 10:25:57 +0000 (11:25 +0100)] 
Merge branch 'drone-ci' of https://github.com/rudimeier/util-linux

10 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>
10 years agoSince 569d1dac7bc64457aac11163b6a91ce9b41a6715 we read device start
Karel Zak [Tue, 17 Mar 2015 10:10:20 +0000 (11:10 +0100)] 
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>
10 years agohwclock: cosmetic changes to man page
Karel Zak [Tue, 17 Mar 2015 09:55:46 +0000 (10:55 +0100)] 
hwclock: cosmetic changes to man page

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoMerge branch 'hwman312' of https://github.com/jwpi/util-linux
Karel Zak [Tue, 17 Mar 2015 09:37:13 +0000 (10:37 +0100)] 
Merge branch 'hwman312' of https://github.com/jwpi/util-linux

10 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>
10 years agoMerge branch 'tests_logger' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 17 Mar 2015 09:01:35 +0000 (10:01 +0100)] 
Merge branch 'tests_logger' of https://github.com/kerolasa/lelux-utiliteetit

10 years agotests: remove warning from test output
Ruediger Meier [Mon, 16 Mar 2015 14:15:35 +0000 (15:15 +0100)] 
tests: remove warning from test output

This was added in 3f8478a7 but it's only printed in --help.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agotests: disarm tailf test
Ruediger Meier [Fri, 13 Mar 2015 15:09:37 +0000 (16:09 +0100)] 
tests: disarm tailf test

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotailf: deprecated
Ruediger Meier [Fri, 13 Mar 2015 15:09:36 +0000 (16:09 +0100)] 
tailf: deprecated

We want to remove it in 2 years, March 2017.

See discussion "tailf, really needed?"
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/10967

[kzak@redhat.com: - move warning to usage()]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agologger: use errx() when checking user input
Sami Kerola [Sun, 15 Mar 2015 12:54:53 +0000 (12:54 +0000)] 
logger: use errx() when checking user input

Additionally inform in usage() the --msgid requires an argument.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agologger: check xgethostname() return value
Sami Kerola [Sun, 15 Mar 2015 12:54:48 +0000 (12:54 +0000)] 
logger: check xgethostname() return value

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agologger: tidy few indentation issues
Sami Kerola [Sun, 15 Mar 2015 12:54:47 +0000 (12:54 +0000)] 
logger: tidy few indentation issues

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agologger: Fix use of errno after strtol() without zeroing first
Stef Walter [Sun, 15 Mar 2015 13:23:32 +0000 (14:23 +0100)] 
logger: Fix use of errno after strtol() without zeroing first

References: https://bugzilla.redhat.com/show_bug.cgi?id=1202104
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agohwclock: man-page errata
J William Piggott [Fri, 13 Mar 2015 18:40:59 +0000 (14:40 -0400)] 
hwclock: man-page errata

The information I wrote regarding clock crystals was not
only incomplete, it was wrong. The characteristics of
quartz crystals is beyond the scope of this man-page. It
was misguided to attempt to include it. This commit
removes said information.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: add '11 minute mode' information
J William Piggott [Fri, 13 Mar 2015 18:37:22 +0000 (14:37 -0400)] 
hwclock: add '11 minute mode' information

Add that '11 minute mode' is a kernel compile time
option. Add details regarding its activation and
how to check its status.

Signed-off-by: J William Piggott <elseifthen@gmx.com>