]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
11 years agologger: add hostname to rfc3164 message
Sami Kerola [Sun, 27 Jul 2014 17:33:22 +0000 (18:33 +0100)] 
logger: add hostname to rfc3164 message

This makes the obsolete protocol a little bit more compliant with the
internet standard, but few should care now when we have rfc5424 support,
and rfc3164 feels broken.  For example it requires hostname to be not
fully qualified, which is hard to understand, and should make users to
prefer the new protocol.

Reported-by: Frank Thilo <thilo@unix-ag.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705217
CC: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: warn when --file and command line message are combined
Sami Kerola [Sun, 27 Jul 2014 17:01:09 +0000 (18:01 +0100)] 
logger: warn when --file and command line message are combined

When --file is combined with command line arguments the later has
silently been ignored.  This commit makes user to be aware the logger
will not use command line arguments when --file is specified.

Reported-by: "Daniel 'DaB.' Baur" <debian@daniel.baur4.info>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467244
CC: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: improve readablity of pencode() function
Sami Kerola [Sat, 26 Jul 2014 14:19:26 +0000 (15:19 +0100)] 
logger: improve readablity of pencode() function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: make --stderr print remote server messages
Sami Kerola [Sat, 28 Jun 2014 22:49:06 +0000 (23:49 +0100)] 
logger: make --stderr print remote server messages

Users wish to see the message should include also remote messages, not
only the one sent to locally via libc function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: add process --id=parent optional argument
Sami Kerola [Sat, 28 Jun 2014 15:08:28 +0000 (16:08 +0100)] 
logger: add process --id=parent optional argument

When scripts send several messages they will be easier to group together
when parent process id is printed rather than id of the each logger
process.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: add logger protocol notes to manual page
Sami Kerola [Sat, 28 Jun 2014 14:37:39 +0000 (15:37 +0100)] 
docs: add logger protocol notes to manual page

Inform about rfc5424 support, how to control what it includes to
submission, and that it is the new default when sending syslog messages
to remote server without specifying protocol.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: add rfc5424 support
Sami Kerola [Thu, 26 Jun 2014 15:13:55 +0000 (16:13 +0100)] 
logger: add rfc5424 support

Add support the more recent syslog protocol and make it default.  The
older BSD syslog protocol can still be used with option --rfc3164.
Protocols are meaningful only when messages are sent to remote syslog
server.

Requested-by: Kodiak Firesmith <ksf@sei.cmu.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: tidy up main() by adding small functions and ctl data
Sami Kerola [Sat, 26 Jul 2014 12:10:25 +0000 (13:10 +0100)] 
logger: tidy up main() by adding small functions and ctl data

Add logger_open(), logger_command_line(), logger_stdin(), and
logger_close() functions, and move all remaining option argument
assignments to control structure.

Proposed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: add function pointer to choose how logging is done
Sami Kerola [Thu, 26 Jun 2014 20:48:25 +0000 (21:48 +0100)] 
logger: add function pointer to choose how logging is done

This change paves way to adding support for both RFC 3164 and RFC 5424
syslog protocols.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: make logger.1 facilities and levels easier to read
Sami Kerola [Mon, 23 Jun 2014 20:26:02 +0000 (21:26 +0100)] 
docs: make logger.1 facilities and levels easier to read

Most people read vertical list a lot quicker than horizontal.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: refactor long if clause
Sami Kerola [Sun, 22 Jun 2014 22:43:09 +0000 (23:43 +0100)] 
logger: refactor long if clause

When if clause that continues throughout whole function it usually can be
shorten to immediate action, e.g., in this case return on the spot not at
end of the function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: do not rely only getlogin(3) telling who ran the command
Sami Kerola [Sun, 22 Jun 2014 22:29:36 +0000 (23:29 +0100)] 
logger: do not rely only getlogin(3) telling who ran the command

The getlogin(3) is known not to always work, and when that happens it is
reasonable to try determine user of name by looking process owner and
passwd information.

Reference: http://man7.org/linux/man-pages/man3/getlogin.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: fix indentation issues
Sami Kerola [Sun, 22 Jun 2014 22:02:43 +0000 (23:02 +0100)] 
logger: fix indentation issues

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: ensure program writes everything to syslog file descriptor
Sami Kerola [Sun, 22 Jun 2014 21:59:57 +0000 (22:59 +0100)] 
logger: ensure program writes everything to syslog file descriptor

It is fair assumption messages an user is asking to be wrote will be
attempted to be wrote as hard as possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoagetty: Reprompt and reprint /etc/issue when asked
Stef Walter [Thu, 3 Jul 2014 15:44:41 +0000 (17:44 +0200)] 
agetty: Reprompt and reprint /etc/issue when asked

Add an 'agetty --reload' command which asks all running agetty
commands to display their prompts again.

Several of the /etc/issue escape codes such as \4 and \S depend on
variable data which can change after the agetty prompt is displayed.
This can cause stale data to be displayed when a user looks at a VT,
especially in cases of DHCP racing with system start up.

We never want this to occur once the user has started typing a
user name. So we detect when the user starts typing, after which
no further reprompting occurs after that point.

[kzak@redhat.com: - add #ifdefs to make it usable on non-inotify systems,
                  - use futimens() with NULL timespec
                  - add --reaload to usage()]

Signed-off-by: Stef Walter <stefw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoswaplabel: move swapon-common to include directory
Sami Kerola [Sat, 26 Jul 2014 10:53:06 +0000 (11:53 +0100)] 
swaplabel: move swapon-common to include directory

This fixes the following compiler warning.

disk-utils/swaplabel.c:175:2: warning: implicit declaration of function
'get_swap_prober' [-Wimplicit-function-declaration]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add -Wimplicit-function-declaration to compiler warnings
Karel Zak [Mon, 28 Jul 2014 10:26:17 +0000 (12:26 +0200)] 
build-sys: add -Wimplicit-function-declaration to compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: fix -l [<device>]
Karel Zak [Mon, 28 Jul 2014 09:57:10 +0000 (11:57 +0200)] 
fdisk: fix -l [<device>]

 * don't use err(), but warn(), so don't stop after the first error

 * display all errors when "-l <device> ..." specified

 * display only EACCES errors when list whole disks from
   /proc/partitions ("fdisk -l" )

Reported-by: Boian Bonev <bbonev@ipacct.com>
Addresses: https://github.com/karelzak/util-linux/pull/106
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohwclock: use pluralized translations.
Lauri Nurmi [Sat, 26 Jul 2014 09:35:54 +0000 (12:35 +0300)] 
hwclock: use pluralized translations.

11 years agomore: replace ad-hoc support for plurals with gettext plurals.
Lauri Nurmi [Sat, 26 Jul 2014 09:43:42 +0000 (12:43 +0300)] 
more: replace ad-hoc support for plurals with gettext plurals.

11 years agosfdisk: use pluralized translation.
Lauri Nurmi [Fri, 11 Jul 2014 18:51:03 +0000 (21:51 +0300)] 
sfdisk: use pluralized translation.

11 years agovarious: erase all traces of the long-obsolete ext filesystem
Benno Schulenberg [Fri, 25 Jul 2014 12:55:04 +0000 (14:55 +0200)] 
various: erase all traces of the long-obsolete ext filesystem

The same argument as for xiafs: dead for over ten years.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agovarious: erase all traces of the long-obsolete xiafs
Benno Schulenberg [Fri, 25 Jul 2014 12:55:03 +0000 (14:55 +0200)] 
various: erase all traces of the long-obsolete xiafs

The xiafs filesystem was removed from the kernel fifteen years ago,
and any kernel that contained it reached end of life ten years ago.
It's time to stop mentioning it in the mount man page and elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: improve some wordings in the man page of mount
Benno Schulenberg [Fri, 25 Jul 2014 12:55:02 +0000 (14:55 +0200)] 
docs: improve some wordings in the man page of mount

Also sort the command-line options alphabetically
(with the customary exception of -V and -h).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: fix some things that were overlooked during the first pass
Benno Schulenberg [Fri, 25 Jul 2014 12:55:01 +0000 (14:55 +0200)] 
docs: fix some things that were overlooked during the first pass

Mainly more option sorting, some formatting adjustments, and the adding
of a missing --version here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agocfdisk: reenable cursor when quitting
Andreas Henriksson [Fri, 25 Jul 2014 12:22:01 +0000 (14:22 +0200)] 
cfdisk: reenable cursor when quitting

After quitting cfdisk (built with slang) the cursor would be
missing at the command prompt.

Reported-by: Martin Steigerwald <Martin@Lichtvoll.de>
Addresses-Debian-Bug: #755991
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
11 years agotests: Fall back on host/getent in ts_resolve_host
Andreas Henriksson [Thu, 24 Jul 2014 19:28:44 +0000 (21:28 +0200)] 
tests: Fall back on host/getent in ts_resolve_host

Neither dig or nslookup would be my first option for resolving,
so add the host utility of ISC/bind fame and the (slow) getent
utility shipped with libc.

This extends the conditions introduced in ...

  commit a98de9696e1a898f925c9154e5693e73aec0779d
  Author: Ruediger Meier <ruediger.meier@ga-group.nl>
  Date:   Wed Jun 11 19:28:20 2014 +0200

      tests: skip some last tests if no dns support

... and should help us not skip certain tests when we have
network connection but none of dig or nslookup available.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
11 years agomcookie: avoid format warning
Bernhard Voelker [Thu, 24 Jul 2014 13:30:54 +0000 (15:30 +0200)] 
mcookie: avoid format warning

"gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]"
issued the following warning:

  warning: format ‘%zu’ expects argument of type ‘size_t’, \
  but argument 3 has type ‘int’ [-Wformat=]

* misc-utils/mcookie.c (main): Change format from %zu to %d.
RAND_BYTES is an enum, thus of type int.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
11 years agomount: clean up -t info in mount.8 and fstab.5
Karel Zak [Fri, 25 Jul 2014 11:08:41 +0000 (13:08 +0200)] 
mount: clean up -t info in mount.8 and fstab.5

 * remove the huge and unmaintained list of filesystems, just keep
   only very basic FS types in the man pages

 * add info about command delimited lists to fstab.5

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: add mount -t test
Karel Zak [Fri, 25 Jul 2014 10:40:16 +0000 (12:40 +0200)] 
tests: add mount -t test

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: don't use /{proc,ext}/filesystems when more fs types specified
Karel Zak [Fri, 25 Jul 2014 10:28:34 +0000 (12:28 +0200)] 
libmount: don't use /{proc,ext}/filesystems when more fs types specified

 # mkfs.ext4 /dev/sda1
 # mount -t foo,bar /dev/sda1 /mnt

successfully mount the device, this is unexpected as extN is no
between wanted (by -t specified) filesystems.

Summary about -t:

 * "mount -t foo"        mount(2) with "foo" type

 * "mount -t foo,bar"    try mount(2) with "foo" or "bar"

 * "mount -t foo,auto"   try mount(2) with "foo" or ask libblkid for
                         the type

 * "mount -t nofoo,bar"  try types from /{etc,proc}/filesystems, but
                         exclude "foo" and "bar"

Note that more filesystems may be specified in fstab (as comma
delimited list). The stuff from fstab is always interpreted as list
and never as a pattern ("no" prefix makes no sense in fstab).

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: fix switch_root/pivot_root cut-n-paste error in configure.ac
Andreas Henriksson [Wed, 23 Jul 2014 17:39:02 +0000 (19:39 +0200)] 
build-sys: fix switch_root/pivot_root cut-n-paste error in configure.ac

The "linux only" check for pivot_root seems to suffer from
a cut-n-paste problem from the earlier switch_root part.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
11 years agotextual: fix some typos and inconsistencies in various messages
Benno Schulenberg [Tue, 22 Jul 2014 20:56:27 +0000 (22:56 +0200)] 
textual: fix some typos and inconsistencies in various messages

Fixing plain typos, miswordings, inconsistent periods, some missing
angular brackets, and a proper pluralization (even when it involves
a constant, because for some languages the precise value matters).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agoswapon: don't print errors as data in smartcols table
Karel Zak [Tue, 22 Jul 2014 10:29:38 +0000 (12:29 +0200)] 
swapon: don't print errors as data in smartcols table

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoswapon: don't use empty strings for smartcols output
Karel Zak [Tue, 22 Jul 2014 10:24:56 +0000 (12:24 +0200)] 
swapon: don't use empty strings for smartcols output

The libsmartcols is smart enough to accept NULL for empty fields
rather than empty strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoswapon: share get_swap_prober() with swaplabel to print uuid and label
Sami Kerola [Tue, 1 Jul 2014 20:40:04 +0000 (21:40 +0100)] 
swapon: share get_swap_prober() with swaplabel to print uuid and label

The swapon(8) listing was almost complete, apart from label and uuid.
This change moves the code from swaplabel(8) to shared scope to be used
for printouts in other swap commands, such as swapon.

Adding this feature to lsblk(8) was a consideration, but lsblk is not
interested of swapfiles, so the swapon seems like a better option to add
this information.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoMerge branch 'rename' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 22 Jul 2014 10:12:52 +0000 (12:12 +0200)] 
Merge branch 'rename' of git://github.com/kerolasa/lelux-utiliteetit

* 'rename' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: add rename(1) return value check
  rename: use function pointer to select file or symlink operation
  rename: continue despite something failed
  tests: add rename(1) checks
  tests: use ts_cd everywhere to change direcrory
  tests: add function to change directory reliable way
  rename: allow renaming in subdirectories

11 years agoMerge branch 'master' of https://github.com/yurchor/util-linux
Karel Zak [Tue, 22 Jul 2014 10:01:50 +0000 (12:01 +0200)] 
Merge branch 'master' of https://github.com/yurchor/util-linux

* 'master' of https://github.com/yurchor/util-linux:
  Fix typos in user visible messages

11 years agoMerge branch 'ioclt' of https://github.com/lanurmi/util-linux
Karel Zak [Tue, 22 Jul 2014 09:58:21 +0000 (11:58 +0200)] 
Merge branch 'ioclt' of https://github.com/lanurmi/util-linux

11 years agobuild-sys: release++ (v2.25) v2.25
Karel Zak [Tue, 22 Jul 2014 09:12:05 +0000 (11:12 +0200)] 
build-sys: release++ (v2.25)

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: update v2.25-ReleaseNotes
Karel Zak [Tue, 22 Jul 2014 09:11:01 +0000 (11:11 +0200)] 
docs: update v2.25-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: bring one more man page closer to standard formatting
Benno Schulenberg [Mon, 21 Jul 2014 21:56:02 +0000 (23:56 +0200)] 
docs: bring one more man page closer to standard formatting

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: update AUTHORS file
Karel Zak [Tue, 22 Jul 2014 08:42:32 +0000 (10:42 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agopo: merge changes
Karel Zak [Tue, 22 Jul 2014 08:39:11 +0000 (10:39 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agopo: update zh_CN.po (from translationproject.org)
Wylmer Wang [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update zh_CN.po (from translationproject.org)

11 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update vi.po (from translationproject.org)

11 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update uk.po (from translationproject.org)

11 years agopo: update pt_BR.po (from translationproject.org)
Rafael Ferreira [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update pt_BR.po (from translationproject.org)

11 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update pl.po (from translationproject.org)

11 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update nl.po (from translationproject.org)

11 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update ja.po (from translationproject.org)

11 years agopo: update fr.po (from translationproject.org)
David Prévot [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update fr.po (from translationproject.org)

11 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update fi.po (from translationproject.org)

11 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update es.po (from translationproject.org)

11 years agopo: update de.po (from translationproject.org)
Mario Blättermann [Tue, 22 Jul 2014 08:33:18 +0000 (10:33 +0200)] 
po: update de.po (from translationproject.org)

11 years agopo: update da.po (from translationproject.org)
Joe Hansen [Tue, 22 Jul 2014 08:33:17 +0000 (10:33 +0200)] 
po: update da.po (from translationproject.org)

11 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 22 Jul 2014 08:33:17 +0000 (10:33 +0200)] 
po: update cs.po (from translationproject.org)

11 years agoprlimit: remove repeating words from man page
Karel Zak [Mon, 21 Jul 2014 14:09:38 +0000 (16:09 +0200)] 
prlimit: remove repeating words from man page

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocfdisk: actually translate the partition types in the menu
Benno Schulenberg [Mon, 21 Jul 2014 11:37:11 +0000 (13:37 +0200)] 
cfdisk: actually translate the partition types in the menu

[kzak@redhat.com: - translate also GPT types]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: bring eight more man pages closer to standard formatting
Benno Schulenberg [Sun, 20 Jul 2014 21:15:47 +0000 (23:15 +0200)] 
docs: bring eight more man pages closer to standard formatting

Also, for chcpu, the options -c, -d, -e and -g are mutually exclusive,
and for the mode argument the option -p is not optional.  For ldattach,
use the standard options separator ", " instead of the unusual " | ".
And add the missing --version to several of the pages.  Besides, improve
the wording and the consistency of the spacing.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: bring five more man pages closer to standard formatting
Benno Schulenberg [Sun, 20 Jul 2014 21:15:46 +0000 (23:15 +0200)] 
docs: bring five more man pages closer to standard formatting

Also, for renice, adapt the descriptions to the behaviour: the -g,
-p and -u options do not actually need to be followed by any ID.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agomount: update info about mtab in mount.8
Karel Zak [Mon, 21 Jul 2014 08:27:25 +0000 (10:27 +0200)] 
mount: update info about mtab in mount.8

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: add rename(1) return value check
Sami Kerola [Sat, 28 Jun 2014 18:11:30 +0000 (19:11 +0100)] 
tests: add rename(1) return value check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agorename: use function pointer to select file or symlink operation
Sami Kerola [Sun, 25 May 2014 23:41:06 +0000 (00:41 +0100)] 
rename: use function pointer to select file or symlink operation

Add separate functions to different functionality, and add a function for
the stuff that is in common for both.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agorename: continue despite something failed
Sami Kerola [Sat, 28 Jun 2014 17:42:49 +0000 (18:42 +0100)] 
rename: continue despite something failed

Try to do all file operations even when one or some of them fail, and
use exit value to inform what happen.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: add rename(1) checks
Sami Kerola [Sun, 25 May 2014 21:52:24 +0000 (22:52 +0100)] 
tests: add rename(1) checks

Check basic file moves, symlink relinking, and both file moves and
symlinks when operations are have directory in destination path.

Reviewed-by: Ruediger Meier <sweet_f_a@gmx.de>
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: use ts_cd everywhere to change direcrory
Sami Kerola [Sun, 22 Jun 2014 09:43:00 +0000 (10:43 +0100)] 
tests: use ts_cd everywhere to change direcrory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: add function to change directory reliable way
Sami Kerola [Sun, 22 Jun 2014 09:20:54 +0000 (10:20 +0100)] 
tests: add function to change directory reliable way

Without arguments bash cd will move to $HOME. Ensure also that when
directory is assumed to be changed the current directory and intented
destination are the same location.

Reference: http://www.spinics.net/lists/util-linux-ng/msg09509.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agorename: allow renaming in subdirectories
Sami Kerola [Sun, 25 May 2014 21:17:25 +0000 (22:17 +0100)] 
rename: allow renaming in subdirectories

Earlier the rename(1) considered path as possible string to be renamed,
could lead to an issue with none existing destination.  See below for
demonstration of this issue.  After this change all directory elements
are ignored when the match finding happens.

$ cd $(mktemp -d)
$ mkdir aa ab
$ touch a{a,b}/aa
$ rename -v a x */aa
rename: aa/aa: rename to xa/aa failed: No such file or directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoprlimit: clean up columns[] usage
Karel Zak [Fri, 18 Jul 2014 11:22:52 +0000 (13:22 +0200)] 
prlimit: clean up columns[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoswapon: clean up columns[] usage
Karel Zak [Fri, 18 Jul 2014 11:22:52 +0000 (13:22 +0200)] 
swapon: clean up columns[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolosetup: clean up columns[] usage
Karel Zak [Fri, 18 Jul 2014 11:22:52 +0000 (13:22 +0200)] 
losetup: clean up columns[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: more robust usage of columns[]
Karel Zak [Fri, 18 Jul 2014 11:17:48 +0000 (13:17 +0200)] 
lslogins: more robust usage of columns[]

For more details see commit dcc8dbdc8137cb3da5100158639b565565b89875.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agowdctl: clean up columns[] usage
Karel Zak [Fri, 18 Jul 2014 11:22:52 +0000 (13:22 +0200)] 
wdctl: clean up columns[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofindmnt: more robust usage of columns[]
Karel Zak [Fri, 18 Jul 2014 11:17:48 +0000 (13:17 +0200)] 
findmnt: more robust usage of columns[]

For more details see commit dcc8dbdc8137cb3da5100158639b565565b89875.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslocks: clean up columns[] usage
Karel Zak [Fri, 18 Jul 2014 11:08:45 +0000 (13:08 +0200)] 
lslocks: clean up columns[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolsblk: check number of used columns
Karel Zak [Thu, 17 Jul 2014 15:17:46 +0000 (17:17 +0200)] 
lsblk: check number of used columns

The current code does not check size of the columns[] array when add
the next on command line specified column. We check the array size for
"-o <columns>" but not for another options.

Old version:

   $ for x in $(seq 0 100); do echo "-t"; done | xargs lsblk
   xargs: lsblk: terminated by signal 11

new version:

  $ for x in $(seq 0 100); do echo "-t"; done | xargs lsblk
  lsblk: too many columns specified, the limit is 83 columns.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolsblk: differentiate between infos[] and columns[]
Karel Zak [Thu, 17 Jul 2014 13:35:52 +0000 (15:35 +0200)] 
lsblk: differentiate between infos[] and columns[]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'patch-1' of https://github.com/bneijt/util-linux
Karel Zak [Fri, 18 Jul 2014 10:59:46 +0000 (12:59 +0200)] 
Merge branch 'patch-1' of https://github.com/bneijt/util-linux

11 years agocfdisk: use /dev/sda by default
Karel Zak [Fri, 18 Jul 2014 10:54:40 +0000 (12:54 +0200)] 
cfdisk: use /dev/sda by default

.. this all is for backward compatibility.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agowall: add fallback for failed sysconf()
Karel Zak [Thu, 17 Jul 2014 13:19:34 +0000 (15:19 +0200)] 
wall: add fallback for failed sysconf()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoumount: fix memory leak [coverity scan]
Karel Zak [Thu, 17 Jul 2014 13:12:35 +0000 (15:12 +0200)] 
umount: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofstrim: fix memory leak [coverity scan]
Karel Zak [Thu, 17 Jul 2014 13:07:49 +0000 (15:07 +0200)] 
fstrim: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofindmnt: fix memory leak [coverity scan]
Karel Zak [Thu, 17 Jul 2014 13:00:17 +0000 (15:00 +0200)] 
findmnt: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosulogin: don't use uninitialized struct sigaction [coverity scan]
Karel Zak [Thu, 17 Jul 2014 12:47:20 +0000 (14:47 +0200)] 
sulogin: don't use uninitialized struct sigaction [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosulogin: check result of the open() [coverity scan]
Karel Zak [Thu, 17 Jul 2014 12:42:00 +0000 (14:42 +0200)] 
sulogin: check result of the open() [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolast: fix is_phantom() logic [coverity scan]
Karel Zak [Thu, 17 Jul 2014 12:39:11 +0000 (14:39 +0200)] 
last: fix is_phantom() logic [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: add missing assert()
Karel Zak [Thu, 17 Jul 2014 12:31:05 +0000 (14:31 +0200)] 
libmount: add missing assert()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: comparing an array to null is not useful [coverity scan]
Karel Zak [Thu, 17 Jul 2014 12:20:03 +0000 (14:20 +0200)] 
libblkid: comparing an array to null is not useful [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/procutils: check fgets() return value [coverity scan]
Karel Zak [Thu, 17 Jul 2014 12:11:28 +0000 (14:11 +0200)] 
lib/procutils: check fgets() return value [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/loopdev: comparing an array to null is not useful [coverity scan]
Karel Zak [Thu, 17 Jul 2014 12:08:18 +0000 (14:08 +0200)] 
lib/loopdev: comparing an array to null is not useful [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: bring four more man pages closer to standard formatting
Benno Schulenberg [Wed, 16 Jul 2014 21:09:50 +0000 (23:09 +0200)] 
docs: bring four more man pages closer to standard formatting

In the IPC man pages strictly adhere to the memory, queue, semaphore
order, to reduce disorientation.  And for 'ipcmk', the arguments for
-M and -S and -p are not optional.  Add --version for 'mountpoint'.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agofstrim: avoid TOCTOU race
Sami Kerola [Wed, 16 Jul 2014 20:54:58 +0000 (21:54 +0100)] 
fstrim: avoid TOCTOU race

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agofallocate: avoid unnecessary computation
Sami Kerola [Wed, 16 Jul 2014 20:54:57 +0000 (21:54 +0100)] 
fallocate: avoid unnecessary computation

Where POSIX_FADV_SEQUENTIAL and HAVE_POSIX_FADVISE are not available it
is waste of resources to have variables that are meaningful only for
posix_fadvise().  Also initialize the variables immediately to correct
values, and since cachesz is never changed mark it read only.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolib/colors: remove memory leak
Sami Kerola [Wed, 16 Jul 2014 20:54:56 +0000 (21:54 +0100)] 
lib/colors: remove memory leak

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agobuild-sys: harmonize some indentation
Benno Schulenberg [Wed, 16 Jul 2014 11:09:53 +0000 (13:09 +0200)] 
build-sys: harmonize some indentation

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: improve the wording and conventions in the man-page howto
Benno Schulenberg [Wed, 16 Jul 2014 11:09:52 +0000 (13:09 +0200)] 
docs: improve the wording and conventions in the man-page howto

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agodocs: improve the formatting and wording of two man pages
Benno Schulenberg [Wed, 16 Jul 2014 11:09:51 +0000 (13:09 +0200)] 
docs: improve the formatting and wording of two man pages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agocfdisk: make code more readable for analyzers [coverity scan]
Karel Zak [Thu, 17 Jul 2014 11:59:01 +0000 (13:59 +0200)] 
cfdisk: make code more readable for analyzers [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocfdisk: fix possible memory leak [coverity scan]
Karel Zak [Thu, 17 Jul 2014 11:46:27 +0000 (13:46 +0200)] 
cfdisk: fix possible memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>