]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
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>
11 years agoinclude/c: do not gettextize a wordless string
Benno Schulenberg [Mon, 28 Apr 2014 16:15:00 +0000 (18:15 +0200)] 
include/c: do not gettextize a wordless string

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agolib/colors: change an include to a local one
Benno Schulenberg [Mon, 28 Apr 2014 16:10:38 +0000 (18:10 +0200)] 
lib/colors: change an include to a local one

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agoinclude/carefulputc: remove a duplicate include
Benno Schulenberg [Mon, 28 Apr 2014 16:08:42 +0000 (18:08 +0200)] 
include/carefulputc: remove a duplicate include

Also tweak a comment.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agoinclude/c: remove a duplicate include
Benno Schulenberg [Mon, 28 Apr 2014 15:52:42 +0000 (17:52 +0200)] 
include/c: remove a duplicate include

Also tweak some comments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agolsblk: add -O option to show all available columns
Masatake YAMATO [Sun, 27 Apr 2014 05:18:41 +0000 (14:18 +0900)] 
lsblk: add -O option to show all available columns

Simple command line for gathering information as many as possible is
useful when understanding a system, especially when trouble shooting.

This patch introduces -O option which enables all available columns.

[kzak@redhat.com: - define collisions between options,
                  - define columns when parse argv[]]

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodmesg: add missing include
Karel Zak [Tue, 6 May 2014 08:28:26 +0000 (10:28 +0200)] 
dmesg: add missing include

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibsmartcols: check recount_widths() return value
Karel Zak [Tue, 6 May 2014 08:21:24 +0000 (10:21 +0200)] 
libsmartcols: check recount_widths() return value

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/pager: use names when referring to standard file descriptors
Sami Kerola [Sat, 26 Apr 2014 17:30:06 +0000 (18:30 +0100)] 
lib/pager: use names when referring to standard file descriptors

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolib/timeutils: fix memory leak
Sami Kerola [Sat, 26 Apr 2014 16:50:46 +0000 (17:50 +0100)] 
lib/timeutils: fix memory leak

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoswapon, swapheader, mkswap: move swap signature to header
Sami Kerola [Fri, 25 Apr 2014 23:50:30 +0000 (00:50 +0100)] 
swapon, swapheader, mkswap: move swap signature to header

Both swapon and mkswap need to know what is valid device signature, so
share the value.

[kzak@redhat.com: - use SWAP_SIGNATURE_SZ properly in write_signature()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoswapon: swaps with legacy version label are not supported
Sami Kerola [Fri, 25 Apr 2014 23:40:28 +0000 (00:40 +0100)] 
swapon: swaps with legacy version label are not supported

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoinclude/swapheader.h: ensure type sizes
Sami Kerola [Fri, 25 Apr 2014 21:08:23 +0000 (22:08 +0100)] 
include/swapheader.h: ensure type sizes

Use consistently the same type sizes as in libblkid and kernel.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agomkswap: remove legacy swap structure
Sami Kerola [Fri, 25 Apr 2014 21:05:33 +0000 (22:05 +0100)] 
mkswap: remove legacy swap structure

If software archeolgists want to know how the old, and unused, swap
header looked they can dig it from the revision history.

[kzak@redhat.com: - use sizeof() for SWAP_HEADER_SIZE]

Reference: 4c85aa3a4c26f2a2c33bf16960b548d5bbd5b4bf
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomkswap, swaplabel: move version number to header
Sami Kerola [Fri, 25 Apr 2014 20:37:58 +0000 (21:37 +0100)] 
mkswap, swaplabel: move version number to header

Corrently only the swap version 1 is supported, which is a magic value so
move it to header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoinclude/c.h: add macro to print definitions as string
Sami Kerola [Fri, 25 Apr 2014 20:36:58 +0000 (21:36 +0100)] 
include/c.h: add macro to print definitions as string

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolast: fix is_phantom() detection
Sami Kerola [Wed, 23 Apr 2014 22:32:11 +0000 (23:32 +0100)] 
last: fix is_phantom() detection

The /proc/<pid>/loginuid is not always available, and when so a running
session should not be determined to be gone.  This is a regression from
commit mentioned in reference.

Sessions that have started before previous system boot, and did not log
out meanwhile, will be marked as gone.  It is fair to say that these
sessions are most likely result of a wtmp corruption.

Reference: 404fa3f93c00c7e130f5a0ec963b2dc6a3743986
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodmesg: move get_boot_time() to lib/timeutils
Sami Kerola [Wed, 23 Apr 2014 21:59:29 +0000 (22:59 +0100)] 
dmesg: move get_boot_time() to lib/timeutils

In future the last(1) will use get_boot_time() as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agouuidd: remove timeout from systemd service file
Karel Zak [Tue, 29 Apr 2014 08:37:26 +0000 (10:37 +0200)] 
uuidd: remove timeout from systemd service file

It seems that SAP does not like the timeout, for performance is
better to keep the daemon permanently running. This is no problem
because uuidd is used only on systems with very unusual requirements
to UUID.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1092039
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: add kill_functions.sh to avoid duplicate code
Karel Zak [Mon, 28 Apr 2014 10:01:37 +0000 (12:01 +0200)] 
tests: add kill_functions.sh to avoid duplicate code

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 28 Apr 2014 09:10:40 +0000 (11:10 +0200)] 
Merge branch 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit

* 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit:
  lib/procutils: notice setuid() process ownership changes
  lib/procutils: reset errno before strtol() call
  kill: add --verbose option to display what is killed
  tests: check kill all user processes
  tests: check kill print pid option
  tests: check various ways to specify kill signal
  tests: check kill is converting signals names correctly
  tests: add signal receiver program
  kill: remove unnecessary indirection
  kill: make options --pid and --queue mutually exclusive

11 years agolib/procutils: notice setuid() process ownership changes
Sami Kerola [Sun, 20 Apr 2014 09:36:05 +0000 (10:36 +0100)] 
lib/procutils: notice setuid() process ownership changes

Earlier the owner of a process was determined by owner of the
/proc/<pid>/stat file.  When changes user ID privileges with setuid() the
stat file ownership is not updated, that resulted kill(1) to consider
such processes where running using same uid as the present process.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolib/procutils: reset errno before strtol() call
Sami Kerola [Tue, 15 Apr 2014 10:54:21 +0000 (11:54 +0100)] 
lib/procutils: reset errno before strtol() call

When going through /proc the last entry made readdir() to alter errno,
which made the strtol() to think something went wrong, resulting kill(1)
tests to fail when running in --parallel mode.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agokill: add --verbose option to display what is killed
Sami Kerola [Tue, 15 Apr 2014 10:40:33 +0000 (11:40 +0100)] 
kill: add --verbose option to display what is killed

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: check kill all user processes
Sami Kerola [Fri, 11 Apr 2014 23:59:31 +0000 (00:59 +0100)] 
tests: check kill all user processes

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: check kill print pid option
Sami Kerola [Fri, 11 Apr 2014 23:33:55 +0000 (00:33 +0100)] 
tests: check kill print pid option

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: check various ways to specify kill signal
Sami Kerola [Wed, 9 Apr 2014 20:43:56 +0000 (21:43 +0100)] 
tests: check various ways to specify kill signal

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: check kill is converting signals names correctly
Sami Kerola [Wed, 9 Apr 2014 20:13:51 +0000 (21:13 +0100)] 
tests: check kill is converting signals names correctly

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: add signal receiver program
Sami Kerola [Tue, 8 Apr 2014 21:36:30 +0000 (22:36 +0100)] 
tests: add signal receiver program

Target to kill with a check that will be written later.

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agokill: remove unnecessary indirection
Sami Kerola [Mon, 7 Apr 2014 21:41:00 +0000 (22:41 +0100)] 
kill: remove unnecessary indirection

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agokill: make options --pid and --queue mutually exclusive
Sami Kerola [Mon, 7 Apr 2014 21:32:44 +0000 (22:32 +0100)] 
kill: make options --pid and --queue mutually exclusive

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agomount: note that -c unused for mount.<type> in man page
Karel Zak [Fri, 25 Apr 2014 08:07:24 +0000 (10:07 +0200)] 
mount: note that -c unused for mount.<type> in man page

Addresses: https://github.com/karelzak/util-linux/issues/70
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agowipefs: don't erase nested partition tables by default
Karel Zak [Thu, 24 Apr 2014 11:42:54 +0000 (13:42 +0200)] 
wipefs: don't erase nested partition tables by default

It's possible the partition contains a partition table (BSD, or hybrid
boot images). It could be unexpected for users that the lost all (or
another) partitions when work with non-whole disk device. Let's
require --force.

For example:

 # wipefs --all /dev/sdb

erases all including partition table, but on hybrid disk where the
first partition starts at first sector (so partition table is within
the first partition):

 # wipefs --all /dev/sdb1
 /dev/sdb1: ignore nested "dos" partition table on non-whole disk device
 wipefs: Use the --force option to force erase.

asks for --force.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1077310
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: update TODO
Karel Zak [Wed, 23 Apr 2014 13:28:09 +0000 (15:28 +0200)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: update Py parse mountinfo test
Karel Zak [Wed, 23 Apr 2014 10:34:48 +0000 (12:34 +0200)] 
tests: update Py parse mountinfo test

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: rely on ts_init_py only
Karel Zak [Wed, 23 Apr 2014 10:34:24 +0000 (12:34 +0200)] 
tests: rely on ts_init_py only

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: update fdisk sun test
Karel Zak [Wed, 23 Apr 2014 10:21:29 +0000 (12:21 +0200)] 
tests: update fdisk sun test

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoRevert "dmesg: don't use brow/yellow in output"
Karel Zak [Wed, 23 Apr 2014 09:09:44 +0000 (11:09 +0200)] 
Revert "dmesg: don't use brow/yellow in output"

It will be better to support colors customization than use
ugly blue color. BTW, for example git-log uses brow/yellow too
by default.

This reverts commit 0b6fbc25990d9498956e06bfcf699fca094e24a9.

11 years agotests: add fdisk 'f' command MBR test
Karel Zak [Wed, 23 Apr 2014 07:27:13 +0000 (09:27 +0200)] 
tests: add fdisk 'f' command MBR test

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (dos) improve logical partition reorder command
Karel Zak [Tue, 22 Apr 2014 19:11:03 +0000 (21:11 +0200)] 
libfdisk: (dos) improve logical partition reorder command

 - use qsort to sort by EBR offsets
 - sort by EBR data partition start sectors

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (mbr) fix logical chain termination
Karel Zak [Tue, 22 Apr 2014 12:54:44 +0000 (14:54 +0200)] 
libfdisk: (mbr) fix logical chain termination

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'test-fdisk' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 22 Apr 2014 11:11:23 +0000 (13:11 +0200)] 
Merge branch 'test-fdisk' of https://github.com/rudimeier/util-linux

11 years agoswaplabel: Improve the typesetting of the manual
Bjarni Ingi Gislason [Mon, 21 Apr 2014 00:30:27 +0000 (00:30 +0000)] 
swaplabel: Improve the typesetting of the manual

  Change macro 'IR' to 'I' if it has only one (italic) argument

  Remove space at end of lines

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agosfdisk: Improve the typesetting of the manual
Bjarni Ingi Gislason [Mon, 21 Apr 2014 00:30:26 +0000 (00:30 +0000)] 
sfdisk: Improve the typesetting of the manual

  FIXME
  Units KB, MB, GB, etc. are ambiguous (not necessarily used here)
  Prefixes kilo, mega, giga, etc. are ambiguous with the unit byte (ditto)

  Change ' \- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

  Change ' - ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

  Change '\-' to '-' (code "hyphen-minus", rendered with the glyph
hyphen in troff), if it is a part of a compound name.
  A minus is not used in words.  People using UTF-8 and copy-and-paste
can(?) (may?) use "info", "man --ascii" or the command "man" should
have an option to display the '-' ("hyphen-minus") in names of options
with the code (character name) "hyphen-minus" (u002D) instead of
"u2010" (code (character) name "hyphen").

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

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

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

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

  Add \~ (no-break space) around '|' (means "or")

  Change ' -- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agoraw: Improve the typesetting of the manual
Bjarni Ingi Gislason [Mon, 21 Apr 2014 00:30:25 +0000 (00:30 +0000)] 
raw: Improve the typesetting of the manual

  Remove space at end of lines

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

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agopartx: Improve the typesetting of the manual
Bjarni Ingi Gislason [Mon, 21 Apr 2014 00:30:24 +0000 (00:30 +0000)] 
partx: Improve the typesetting of the manual

  Add a space character around '|' (means "or")

  Add "(hyphen-minus)" after "\-" to show character name for input

  Change '\-\-' to '\en', when it is used as a dash (pause, separation)

  Add a comma before "or" in a series of words (3 or more)

  Change '-' to '\(en' (an en-dash), if it means a range

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

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

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

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

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
11 years agotests: fdisk added a partitions order message (8b60872e)
Ruediger Meier [Fri, 18 Apr 2014 16:01:26 +0000 (18:01 +0200)] 
tests: fdisk added a partitions order message (8b60872e)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>