]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
11 years agotests: ts_mount knows which fs is expected
Ruediger Meier [Thu, 15 May 2014 14:56:18 +0000 (16:56 +0200)] 
tests: ts_mount knows which fs is expected

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ts_mount validates error message
Ruediger Meier [Thu, 15 May 2014 14:27:28 +0000 (16:27 +0200)] 
tests: ts_mount validates error message

Skip only if mount reports a non-empty fs which is not available
in /proc/filesystems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests, add function ts_mount
Ruediger Meier [Thu, 15 May 2014 11:20:31 +0000 (13:20 +0200)] 
tests, add function ts_mount

We want to generalize mounts similar to how we do it already in
minix/mkfs. Currently most of our other checks just fail if
"fs not supported".

Note that the new function checks a bit stronger than before in
minix/mkfs. It respects mount's return value and stderr goes
to $TS_OUTPUT too.

It's a bit ugly that we write to $TS_OUTPUT from inside of the
function. But if the caller would do it then we couldn't
ts_skip and the whole function would be pointless.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoMerge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux
Karel Zak [Wed, 14 May 2014 12:15:58 +0000 (14:15 +0200)] 
Merge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux

* 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux:
  travis-ci: enable root checks
  travis-ci: minor cleanup and speedup
  tests: introduce TS_CMD_UUIDGEN (never use installed one)
  tests, don't write TS_DEVICE to stdout anymore
  tests: ts_scsi_debug_init must not run in a subshell
  tests: cleanup ts_scsi_debug_init
  tests: some more tests need loop support
  tests: ts_device_init requires loop support
  tests: use ts_check_losetup in losetup test
  tests: add function ts_check_losetup
  tests: ts_device_init remove useless error handling

11 years agotests: add .BE hexdump test results (from s390)
Karel Zak [Wed, 14 May 2014 12:05:54 +0000 (14:05 +0200)] 
tests: add .BE hexdump test results (from s390)

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'tests-known' of https://github.com/rudimeier/util-linux
Karel Zak [Wed, 14 May 2014 11:19:37 +0000 (13:19 +0200)] 
Merge branch 'tests-known' of https://github.com/rudimeier/util-linux

* 'tests-known' of https://github.com/rudimeier/util-linux:
  tests, script/race is known to fail
  tests: script/race would work with variable loop count
  tests: ipcs/limits2 is known to fail
  tests: fix hexdump for big endian
  tests, add missing output for hexdump
  tests: fix hexdump, add ts_finalize
  tests: fix "KNOWN FAILED" for subtests

11 years agolosetup: fix -f on systems without /dev/loop-control
Karel Zak [Wed, 14 May 2014 10:53:24 +0000 (12:53 +0200)] 
losetup: fix -f on systems without /dev/loop-control

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests, script/race is known to fail
Ruediger Meier [Tue, 13 May 2014 13:19:35 +0000 (15:19 +0200)] 
tests, script/race is known to fail

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: script/race would work with variable loop count
Ruediger Meier [Tue, 13 May 2014 13:13:12 +0000 (15:13 +0200)] 
tests: script/race would work with variable loop count

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ipcs/limits2 is known to fail
Ruediger Meier [Tue, 13 May 2014 10:10:17 +0000 (12:10 +0200)] 
tests: ipcs/limits2 is known to fail

See github issue #51, comment 2
https://github.com/karelzak/util-linux/issues/51

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix hexdump for big endian
Ruediger Meier [Tue, 13 May 2014 11:19:22 +0000 (13:19 +0200)] 
tests: fix hexdump for big endian

For now endianess dependent subtests have undefined output on
BE systems until sombody re-checks this and provides expected
output files with .BE suffix.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotravis-ci: enable root checks
Ruediger Meier [Mon, 12 May 2014 11:50:25 +0000 (13:50 +0200)] 
travis-ci: enable root checks

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotravis-ci: minor cleanup and speedup
Ruediger Meier [Sun, 11 May 2014 04:49:02 +0000 (06:49 +0200)] 
travis-ci: minor cleanup and speedup

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: introduce TS_CMD_UUIDGEN (never use installed one)
Ruediger Meier [Sun, 11 May 2014 21:58:53 +0000 (23:58 +0200)] 
tests: introduce TS_CMD_UUIDGEN (never use installed one)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests, don't write TS_DEVICE to stdout anymore
Ruediger Meier [Tue, 13 May 2014 15:17:24 +0000 (17:17 +0200)] 
tests, don't write TS_DEVICE to stdout anymore

11 years agotests: ts_scsi_debug_init must not run in a subshell
Ruediger Meier [Sun, 11 May 2014 06:50:28 +0000 (08:50 +0200)] 
tests: ts_scsi_debug_init must not run in a subshell

ts_skip and ts_die won't work from subshell. Now we simply use
TS_DEVICE which is globally set in that function.

I've made sure that we never change TS_DEVICE variable after
we've got it. So we could use it again for cleanup on exit in
ts_{finalize,die,skip} functions.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: cleanup ts_scsi_debug_init
Ruediger Meier [Sun, 11 May 2014 20:48:16 +0000 (22:48 +0200)] 
tests: cleanup ts_scsi_debug_init

Sort out global and local vars. Now we set TS_DEVICE globally
to be use later.
Skip really quiet if modprobe fails.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: some more tests need loop support
Ruediger Meier [Sun, 11 May 2014 20:47:22 +0000 (22:47 +0200)] 
tests: some more tests need loop support

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ts_device_init requires loop support
Ruediger Meier [Mon, 12 May 2014 10:45:03 +0000 (12:45 +0200)] 
tests: ts_device_init requires loop support

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: use ts_check_losetup in losetup test
Ruediger Meier [Mon, 12 May 2014 10:42:07 +0000 (12:42 +0200)] 
tests: use ts_check_losetup in losetup test

In losetup test we have to handle the special case that ts_check_losetup
requires a working losetup binary.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add function ts_check_losetup
Ruediger Meier [Mon, 12 May 2014 00:45:10 +0000 (02:45 +0200)] 
tests: add function ts_check_losetup

Unfortunately losetup -f does not return an error nowadays.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests, add missing output for hexdump
Ruediger Meier [Tue, 13 May 2014 11:36:08 +0000 (13:36 +0200)] 
tests, add missing output for hexdump

One file was missing and one was too much.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix hexdump, add ts_finalize
Ruediger Meier [Mon, 12 May 2014 21:16:25 +0000 (23:16 +0200)] 
tests: fix hexdump, add ts_finalize

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix "KNOWN FAILED" for subtests
Ruediger Meier [Mon, 12 May 2014 20:56:57 +0000 (22:56 +0200)] 
tests: fix "KNOWN FAILED" for subtests

It didn't worked for tests with subtests.

Here we consolidate both cases which fixes the issue by the way. This
is basically a rewrite of 7641ccec.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoagetty: use the "best" interface for \4 and \6
Karel Zak [Tue, 13 May 2014 13:07:08 +0000 (15:07 +0200)] 
agetty: use the "best" interface for \4 and \6

The issue file escape sequences \4 and \6 prints the host IP when no
interface is specified. That's useless on some virtual machines where
gethostname()+getaddrinfo() returns 127.0.0.1.

The seems better to print IP of the "best" interface (UP, RUNNING, non-LOOPBACK)
and use gethostname() as painful fallback only.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1090935
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: add to the man page hint about $HOME stuff
Karel Zak [Tue, 13 May 2014 11:26:50 +0000 (13:26 +0200)] 
lib/colors: add to the man page hint about $HOME stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoagetty: fix odd check for chardev/tty
Karel Zak [Tue, 13 May 2014 10:28:48 +0000 (12:28 +0200)] 
agetty: fix odd check for chardev/tty

References: https://bugzilla.redhat.com/show_bug.cgi?id=1069902
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocfdisk: update man page COLORS section
Karel Zak [Mon, 12 May 2014 08:27:53 +0000 (10:27 +0200)] 
cfdisk: update man page COLORS section

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: support colors customization
Karel Zak [Mon, 12 May 2014 08:22:09 +0000 (10:22 +0200)] 
fdisk: support colors customization

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: add --color to the man page
Karel Zak [Mon, 12 May 2014 08:03:41 +0000 (10:03 +0200)] 
hexdump: add --color to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodmesg: support colors customization
Karel Zak [Mon, 12 May 2014 07:53:39 +0000 (09:53 +0200)] 
dmesg: support colors customization

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: update man page
Karel Zak [Mon, 12 May 2014 07:51:01 +0000 (09:51 +0200)] 
lib/colors: update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: use new colors API
Karel Zak [Mon, 5 May 2014 14:32:58 +0000 (16:32 +0200)] 
hexdump: use new colors API

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibsmartcols: use new colors API
Karel Zak [Mon, 5 May 2014 14:32:14 +0000 (16:32 +0200)] 
libsmartcols: use new colors API

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: support schemes customization
Karel Zak [Mon, 5 May 2014 14:22:43 +0000 (16:22 +0200)] 
lib/colors: support schemes customization

 * parse terminal-colors.d/*.scheme files, expected format is

    <name> <color-sequence>

 * supported color sequences:

     - color name (e.g. "red")
     - dir_colors compatible xx;yy (e.g. 01;31) where the sequence may
       contains control chars like \e \a  ..etc.

 * scheme is parsed on demand

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: allow to temporary disable colors
Karel Zak [Wed, 30 Apr 2014 12:51:46 +0000 (14:51 +0200)] 
lib/colors: allow to temporary disable colors

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: add support for @term and /home/kzak
Karel Zak [Wed, 30 Apr 2014 10:59:28 +0000 (12:59 +0200)] 
lib/colors: add support for @term and /home/kzak

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolosetup: return EXIT_FAILURE on unsuccessful -f
Karel Zak [Tue, 13 May 2014 09:34:30 +0000 (11:34 +0200)] 
losetup: return EXIT_FAILURE on unsuccessful -f

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoagetty: beside virtual consoles support xvc and hvc device lines as well
Werner Fink [Thu, 8 May 2014 10:09:25 +0000 (12:09 +0200)] 
agetty: beside virtual consoles support xvc and hvc device lines as well

For this approach do not use the ioctl TIOCMGET anymore as this
is for real serial lines only. But switch over to use the ioctl
KDGKBMODE as this is unique to the virtual console lines only.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agoagetty: better support of the special system consoles on S390
Werner Fink [Thu, 8 May 2014 10:09:24 +0000 (12:09 +0200)] 
agetty: better support of the special system consoles on S390

That is that there are several consoles, the /dev/ttyS0 which
is type of ibm3215 and a dumb terminal, then there is the device
/dev/3270/tty1 which can handle ANSI color escape sequences and is
a ibm327x terminal, and the /dev/ttyS1 which is a vt220 terminal.

The macro is_speed() in agetty.c allows to distinguish between the
terminal line (/dev)3270/tty1 and the speed options on the command
line used in

/run/systemd/generator/getty.target.wants/serial-getty@3270-tty1.service

which is a symbolic link to /usr/lib/systemd/system/serial-getty@.service

Signed-off-by: Werner Fink <werner@suse.de>
11 years agosulogin: find a suitable console device
Werner Fink [Thu, 8 May 2014 10:09:23 +0000 (12:09 +0200)] 
sulogin: find a suitable console device

Enable sulogin to find a suitable console device even if the first line
in /proc/consoles does not have any major and minor number.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agoagetty: avoid that agetty nor sulogin are fooled by a running plymouth
Werner Fink [Thu, 8 May 2014 10:09:22 +0000 (12:09 +0200)] 
agetty: avoid that agetty nor sulogin are fooled by a running plymouth

The nowadays used plymouth locks the devices used for the system
console which causes that agetty as well as sulogin can not modify
the termios settings of e.g. the serial devices of the systenm console.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agocfdisk: fix compiler warning [-Wsign-compare]
Karel Zak [Tue, 13 May 2014 07:58:58 +0000 (09:58 +0200)] 
cfdisk: fix compiler warning [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoRevert "blkid: remove unused variable"
Karel Zak [Tue, 13 May 2014 07:55:10 +0000 (09:55 +0200)] 
Revert "blkid: remove unused variable"

This reverts commit 0fd4b8132587a264f1e0df46eec7c12bba68c752.

11 years agolibfdisk: fix %ju -> %zu
Karel Zak [Tue, 13 May 2014 07:52:42 +0000 (09:52 +0200)] 
libfdisk: fix %ju -> %zu

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: ts_device_init remove useless error handling
Ruediger Meier [Sun, 11 May 2014 23:43:03 +0000 (01:43 +0200)] 
tests: ts_device_init remove useless error handling

Don't know why we should deinit the empty string.
This patch prepares further refactoring or error handling.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agosetterm: convert remaining magic values to symbolic references
Sami Kerola [Sun, 11 May 2014 19:26:49 +0000 (20:26 +0100)] 
setterm: convert remaining magic values to symbolic references

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosetterm: convert various constant number definitions to enums
Sami Kerola [Sun, 11 May 2014 19:26:48 +0000 (20:26 +0100)] 
setterm: convert various constant number definitions to enums

The enum strings are visible when using debugger.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agosetterm: cleanup printf() usage
Karel Zak [Mon, 12 May 2014 11:53:10 +0000 (13:53 +0200)] 
setterm: cleanup printf() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosetterm: remove unused code
Sami Kerola [Sun, 11 May 2014 19:26:46 +0000 (20:26 +0100)] 
setterm: remove unused code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agowall: replace magic number by named value
Sami Kerola [Sun, 11 May 2014 19:26:45 +0000 (20:26 +0100)] 
wall: replace magic number by named value

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoterm-utils: avoid error message string length couting errors
Sami Kerola [Sun, 11 May 2014 19:26:44 +0000 (20:26 +0100)] 
term-utils: avoid error message string length couting errors

Remove various magic numbers with either a string lenght count, or a
symbolic variable that is recognized by gdb.

[kzak@redhat.com: - use snprintf() everywhere,
                  - check snprintf() return code rather than mess up
                    the code with strlens]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: remove unnecessary void casts
Sami Kerola [Sun, 11 May 2014 19:26:43 +0000 (20:26 +0100)] 
build-sys: remove unnecessary void casts

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: check numeric priority and facility input values
Sami Kerola [Sun, 11 May 2014 19:26:42 +0000 (20:26 +0100)] 
logger: check numeric priority and facility input values

Earlier use of unknown facility or priority number was accepted, and
resulted in unexpected result.  For example when looking journalctl
--priority=7.8 was converted to priotity 0 and facility 1.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: fail when io vector number exceeds maximum
Sami Kerola [Sun, 11 May 2014 19:26:41 +0000 (20:26 +0100)] 
logger: fail when io vector number exceeds maximum

Earlier version silently failed without logging anything.

$ logger --journald=/etc/services ; echo $?
1

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoblkid: remove unused variable
Sami Kerola [Sun, 11 May 2014 19:26:40 +0000 (20:26 +0100)] 
blkid: remove unused variable

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocytune: remove from util-linux
Sami Kerola [Sun, 11 May 2014 19:26:39 +0000 (20:26 +0100)] 
cytune: remove from util-linux

Assumption is there are not many who need this tool.  Whom ever they
might be the recommendation is to use the command from old util-linux
release.  Second reason to removal is difficulty to test hardware
specific command when none of the active project members does not seem to
have such.  Basically the command has reached dead end what comes to
maintainability of it.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: check /proc availability, and go-around if it is incomplete
Sami Kerola [Sun, 11 May 2014 19:26:38 +0000 (20:26 +0100)] 
tests: check /proc availability, and go-around if it is incomplete

Unavailability of /proc is fatal for kill, and continuing with the test
in that case does not make sense as it will only mean false positive
errors.

Where /proc/<pid>/status file(s) does not exist the check will perform
opportunistic sleep with assumption the test_sigreceive will be ready to
be killed if it has some time to init.

[kzak@redhat.com: - remove dependence on gawk, just use shell
                  - fix typo in "test /proc"]

CC: Ruediger Meier <sweet_f_a@gmx.de>
Reference: https://travis-ci.org/rudimeier/util-linux/jobs/24561058
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'tests-features' of https://github.com/rudimeier/util-linux
Karel Zak [Mon, 12 May 2014 10:32:33 +0000 (12:32 +0200)] 
Merge branch 'tests-features' of https://github.com/rudimeier/util-linux

* 'tests-features' of https://github.com/rudimeier/util-linux:
  tests: style Makefile and make output
  tests: allow to add or override test suite options
  tests: add exit case "KNOWN FAILED"
  tests: fix var names
  tests: allow test options to be overridden by env
  tests: call ts_init_env as early as possible

11 years agotests: style Makefile and make output
Ruediger Meier [Sat, 10 May 2014 15:23:22 +0000 (17:23 +0200)] 
tests: style Makefile and make output

We break long lines and make output sill looks nice with and without
V=1.

As a side effect we can now run
  make TS_COMMAND="true"
to do nothing but building all check_PROGRAMS.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: allow to add or override test suite options
Ruediger Meier [Sat, 10 May 2014 15:14:45 +0000 (17:14 +0200)] 
tests: allow to add or override test suite options

Now we can do something like this
  make check TS_OPTS="--fake --parallel=32"

Note we still always set --parallel but the last one wins.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add exit case "KNOWN FAILED"
Ruediger Meier [Sat, 10 May 2014 01:57:26 +0000 (03:57 +0200)] 
tests: add exit case "KNOWN FAILED"

Now we can mark tests as known to be broken without bothering
users with exit failure. In the build log this "KNOWN FAILED"
may be interpreted as TODO ;)

The main advantage of "known-fail" instead of just skipping
is that we will still find the test diff.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: avoid leading "-" before "no logout"
Ruediger Meier [Thu, 8 May 2014 17:01:03 +0000 (19:01 +0200)] 
last: avoid leading "-" before "no logout"

This affects option --time-format=notime.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix var names
Ruediger Meier [Sat, 10 May 2014 05:04:11 +0000 (07:04 +0200)] 
tests: fix var names

Translate "." and "-" to "_". We assume that nobody will add
completely stupid test file names.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: allow test options to be overridden by env
Ruediger Meier [Sat, 10 May 2014 00:00:53 +0000 (02:00 +0200)] 
tests: allow test options to be overridden by env

Specially for automated builds the user may want to have some
fine granulated influence like

export TS_OPT_libmount_verbose="yes"
export TS_OPT_ipcs_fake="yes"
export TS_OPT_ipcs_limits2_fake="no"
if <big endian> then
  export TS_OPT_hexdump_fake="yes"
fi
make check

Even for interactive developers this could be useful for example to
debug just one particuar test while having a regular run with stress:

TS_OPT_script_verbose="yes" \
TS_OPT_script_memcheck="yes" \
../tests/run.sh --parallel=256 --srcdir=.. --builddir=. --nonroot

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: call ts_init_env as early as possible
Ruediger Meier [Sat, 10 May 2014 02:51:22 +0000 (04:51 +0200)] 
tests: call ts_init_env as early as possible

Soon we want to use some env vars within ts_has_option(). That's
why we move some lines to make this possible.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: minor cleanup if statements
Ruediger Meier [Thu, 8 May 2014 16:48:21 +0000 (18:48 +0200)] 
last: minor cleanup if statements

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add test case for last -time-format=full
Ruediger Meier [Thu, 8 May 2014 15:58:37 +0000 (17:58 +0200)] 
tests: add test case for last -time-format=full

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: --time-format=full should do the same like -F
Ruediger Meier [Thu, 8 May 2014 15:45:31 +0000 (17:45 +0200)] 
last: --time-format=full should do the same like -F

For no reason "full" did something else than "iso" or -F as you
see here:
$ ./last  -f ../tests/ts/last/wtmp.LE  --time-format=full  | grep -A2 "no logout"
torvalds linux        hobby            Mon Aug 26 02:57:08 1991    gone                    - no logout
reboot   system boot  system-name      Wed Aug 28 20:00:00 2013   still                    running
reboot   system boot  system-name      Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013  (01:00)
$ ./last  -f ../tests/ts/last/wtmp.LE  --time-format=iso  | grep -A2 "no logout"
torvalds linux        hobby            1991-08-26T02:57:08+0200   gone - no logout
reboot   system boot  system-name      2013-08-28T20:00:00+0200   still running
reboot   system boot  system-name      2013-08-28T18:00:00+0200 - 2013-08-28T19:00:00+0200  (01:00)
$ ./last  -f ../tests/ts/last/wtmp.LE  -F  | grep -A2 "no logout"
torvalds linux        hobby            Mon Aug 26 02:57:08 1991   gone - no logout
reboot   system boot  system-name      Wed Aug 28 20:00:00 2013   still running
reboot   system boot  system-name      Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013  (01:00)

Also note the useless leading space before "gone"

The only thing which matters is fmt->out width when printing these
strings like "still running". Now ctl->fulltime flag is unsused and
removed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: fix uninitialized length
Ruediger Meier [Wed, 7 May 2014 12:40:05 +0000 (14:40 +0200)] 
last: fix uninitialized length

length was unset when using "last --time-format=iso"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolibsmartcols: (docs) reorder functions in version section
Karel Zak [Wed, 7 May 2014 09:48:53 +0000 (11:48 +0200)] 
libsmartcols: (docs) reorder functions in version section

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocolumn: inform user when multibyte conversion error occurs
Sami Kerola [Sun, 4 May 2014 15:39:38 +0000 (16:39 +0100)] 
column: inform user when multibyte conversion error occurs

The column(1) read input until conversion error, and used incomplete
input when outputing, that made at least me to wonder where the rest
disappeared without explanation.  IMHO it is better to fail immediately
rather than do only half of the task.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoMerge branch 'kill-tests' of https://github.com/rudimeier/util-linux
Karel Zak [Wed, 7 May 2014 07:21:52 +0000 (09:21 +0200)] 
Merge branch 'kill-tests' of https://github.com/rudimeier/util-linux

11 years agolib/boottime: add a new file
Karel Zak [Tue, 6 May 2014 18:27:10 +0000 (20:27 +0200)] 
lib/boottime: add a new file

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: fix kill problems
Ruediger Meier [Tue, 6 May 2014 17:16:53 +0000 (19:16 +0200)] 
tests: fix kill problems

There were several failures (missing tmp files, missing pids) on travis
build farm which I couldn't track down completely. Here we fix some
possible issues:
 - mktemp -u is unsafe, maybe even in practice if there is a bad random
   generator
 - make sure that mktemp does not give us pure integer filnames which
   would not work for "kill by-name"
 - avoid using trap, could be that it removed tmp files on wrong signals

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: kill_functions.sh needs gawk (skip if sourced)
Ruediger Meier [Tue, 6 May 2014 16:48:35 +0000 (18:48 +0200)] 
tests: kill_functions.sh needs gawk (skip if sourced)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoinclude/boottime: add a new file
Karel Zak [Tue, 6 May 2014 14:38:53 +0000 (16:38 +0200)] 
include/boottime: add a new file

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/timeutils: remove get_boot_time from libcommon
Karel Zak [Tue, 6 May 2014 11:16:05 +0000 (13:16 +0200)] 
lib/timeutils: remove get_boot_time from libcommon

clock_gettime() needs -lrt, so let's keep this stuff
outside libcommon.la

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohwclock: fix typo
Karel Zak [Tue, 6 May 2014 10:51:42 +0000 (12:51 +0200)] 
hwclock: fix typo

Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohwclock: Check drift value in /etc/adjtime
Stanislav Brabec [Mon, 5 May 2014 18:49:49 +0000 (20:49 +0200)] 
hwclock: Check drift value in /etc/adjtime

Due to bug in older versions of hwclock, /etc/adjtime can contain
excessive drift value (up to many years per day). Prevent it
from applying.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
11 years agohwclock: Prevent excessive drift values
Stanislav Brabec [Mon, 5 May 2014 18:49:29 +0000 (20:49 +0200)] 
hwclock: Prevent excessive drift values

Failure of CMOS battery can cause writing of excessive drift
values (up to many years per day).

This causes excessive hwclock adjustment next time, which may lead
to overflow in calculate_adjustment() (and hang before 4a44a54b).

Prevent this situation, check drift for limits and reset drift to zero
instead.

Steps to reproduce:

mv /etc/adjtime /etc/adjtime.backup

rm /etc/adjtime
hwclock --set --date 2001-01-01\ 01:00:00

changing of /etc/adjtime.
mv /etc/adjtime /etc/adjtime.saved
hwclock --set --date 2001-01-02\ 01:00:01
mv /etc/adjtime.saved /etc/adjtime

echo "======= The /etc/adjtime has a \"correct\" look:"
cat /etc/adjtime

hwclock --debug --systohc --utc
echo "======= The /etc/adjtime now has deeply failed drift value:"
cat /etc/adjtime

mv /etc/adjtime /etc/adjtime.saved
hwclock --set --date 2015-01-01\ 01:00:00
mv /etc/adjtime.saved /etc/adjtime

hwclock --debug --adjust
echo "======= And the last /etc/adjtime:"
cat /etc/adjtime

mv /etc/adjtime.backup /etc/adjtime
hwclock --systohc --utc

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
11 years agochsh: Improve the typesetting of the manual
Bjarni Ingi Gislason [Sat, 3 May 2014 02:32:36 +0000 (02:32 +0000)] 
chsh: Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

  Change '-' to '\-', if it indicates an option

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agochfn: Improve the typesetting of the manual
Bjarni Ingi Gislason [Sat, 3 May 2014 02:32:35 +0000 (02:32 +0000)] 
chfn: Improve the typesetting of the manual

  Change comma (,) to a period (.) as it is the control character

  Use macro RB instead of the reverse one (BR)

  Add missing [ in front of  an (optional) option

  Protect a full stop (.), that begins or ends a string, with \&

  Change '-' to '\-', if it indicates an option

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:41 +0000 (02:37 +0000)] 
libuuid: (uuid.3) Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_unparse.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:40 +0000 (02:37 +0000)] 
libuuid: (uuid_unparse.3) Improve the typesetting of the manual

  Change '\-' (minus) to '-' (code "hyphen-minus", rendered with the
glyph 'hyphen' in troff), if it is a part of a compound word.

  Use \e to print the escape character, instead of \\, as \e is not
interpreted in copy mode

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (man/uuid_time.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:39 +0000 (02:37 +0000)] 
libuuid: (man/uuid_time.3) Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_parse.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:38 +0000 (02:37 +0000)] 
libuuid: (uuid_parse.3) Improve the typesetting of the manual

  Use \e for the printable escape character instead of \\

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_is_null.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:37 +0000 (02:37 +0000)] 
libuuid: (uuid_is_null.3) Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_generate) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:36 +0000 (02:37 +0000)] 
libuuid: (uuid_generate) Improve the typesetting of the manual

  Change '-' to '\-', if it means a minus

  Protect a full stop (.), that begins or ends a string, with \&

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_copy.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:35 +0000 (02:37 +0000)] 
libuuid: (uuid_copy.3) Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_compare.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:34 +0000 (02:37 +0000)] 
libuuid: (uuid_compare.3) Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibuuid: (uuid_clear.3) Improve the typesetting of the manual
Bjarni Ingi Gislason [Fri, 2 May 2014 02:37:33 +0000 (02:37 +0000)] 
libuuid: (uuid_clear.3) Improve the typesetting of the manual

  Protect a full stop (.), that begins or ends a string, with \&

  Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolib/terminal-colors.d.5: Improve the typesetting of the manual
Bjarni Ingi Gislason [Wed, 30 Apr 2014 02:05:00 +0000 (02:05 +0000)] 
lib/terminal-colors.d.5: Improve the typesetting of the manual

  Remove '\&' in front of a full stop (.), when it does not start or
end a string

  Adjust space between sentences to two space characters (or begin each
sentence on a new line).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agolibblkid/libblkid.3: Improve the typsetting of the manual
Bjarni Ingi Gislason [Wed, 30 Apr 2014 02:04:59 +0000 (02:04 +0000)] 
libblkid/libblkid.3: Improve the typsetting of the manual

   Correct space between sentences to two space characters
 (or begin each sentence on a new line).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agosetpriv: Fix --selinux-label
Andy Lutomirski [Thu, 1 May 2014 05:10:13 +0000 (22:10 -0700)] 
setpriv: Fix --selinux-label

This commit:

    commit 05cef8eafbf169a8da1d2831f5ed3d5b1b81aaad
    Author: Sami Kerola <kerolasa@iki.fi>
    Date:   Sat Apr 13 20:54:59 2013 +0100

        setpriv: check writing to a file descriptor was successful

broke --selinux-label.  It checks whether fsyncing /proc/self/attr/exec
succeeds, and it doesn't, because fsync isn't supported on that file.

I have stealthily improved the error message as part of this fix.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
11 years agotextual: remove square brackets from around three dots
Benno Schulenberg [Wed, 30 Apr 2014 08:38:12 +0000 (10:38 +0200)] 
textual: remove square brackets from around three dots

Also improve some option descriptions here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: grammarize the usage howto
Benno Schulenberg [Tue, 29 Apr 2014 15:33:04 +0000 (17:33 +0200)] 
docs: grammarize the usage howto

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agotextual: slice up and standardize the usage text of ionice
Benno Schulenberg [Tue, 29 Apr 2014 13:42:23 +0000 (15:42 +0200)] 
textual: slice up and standardize the usage text of ionice

Done for ease of translation and maintenance.  Also improve the
clarity of some of the descriptions, and of one error message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agoionice: add a missing error message
Benno Schulenberg [Tue, 29 Apr 2014 09:36:22 +0000 (11:36 +0200)] 
ionice: add a missing error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agoipcs: do not gettextize wordless strings
Benno Schulenberg [Mon, 28 Apr 2014 21:12:41 +0000 (23:12 +0200)] 
ipcs: do not gettextize wordless strings

Also tweak a few parts of the usage message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>