]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
8 years agolsipc: tweak a few wordings on the manpage
Benno Schulenberg [Sun, 8 Nov 2015 10:54:15 +0000 (11:54 +0100)] 
lsipc: tweak a few wordings on the manpage

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
8 years agochfn: improve formatting and wording of the manpage
Benno Schulenberg [Sun, 8 Nov 2015 10:54:14 +0000 (11:54 +0100)] 
chfn: improve formatting and wording of the manpage

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
8 years agohexdump: fix a typo and tweak some wordings in the manpage
Benno Schulenberg [Sun, 8 Nov 2015 10:54:13 +0000 (11:54 +0100)] 
hexdump: fix a typo and tweak some wordings in the manpage

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
8 years agodmseg: slightly improve punctuation and formatting of the manpage
Benno Schulenberg [Sun, 8 Nov 2015 10:54:12 +0000 (11:54 +0100)] 
dmseg: slightly improve punctuation and formatting of the manpage

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
8 years agologger: sort the options in the manpage alphabetically
Benno Schulenberg [Sun, 8 Nov 2015 10:54:11 +0000 (11:54 +0100)] 
logger: sort the options in the manpage alphabetically

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
8 years agologger: improve grammar and formatting of the manpage
Benno Schulenberg [Sun, 8 Nov 2015 10:54:10 +0000 (11:54 +0100)] 
logger: improve grammar and formatting of the manpage

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
8 years agoscript, hwclock: check file exist with access(3) rather than stat(3)
Sami Kerola [Sat, 31 Oct 2015 19:21:17 +0000 (19:21 +0000)] 
script, hwclock: check file exist with access(3) rather than stat(3)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoagetty: fix chown(3), chmod(3) and open(3) race
Sami Kerola [Sat, 31 Oct 2015 19:21:16 +0000 (19:21 +0000)] 
agetty: fix chown(3), chmod(3) and open(3) race

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agofsck: retire stat(3) when access(3) does better job
Sami Kerola [Sat, 31 Oct 2015 19:21:15 +0000 (19:21 +0000)] 
fsck: retire stat(3) when access(3) does better job

The stat(3) and access(3) are in this case almost interchangeable, so choose
the lightweight function with additional advantage checking the file is
executable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoswapon: fix stat(3) and open(3) race
Sami Kerola [Sat, 31 Oct 2015 19:21:14 +0000 (19:21 +0000)] 
swapon: fix stat(3) and open(3) race

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agologin: fix stat(2) race
Sami Kerola [Sat, 31 Oct 2015 19:21:13 +0000 (19:21 +0000)] 
login: fix stat(2) race

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agologger: shadow declaration
Sami Kerola [Sat, 31 Oct 2015 12:27:36 +0000 (12:27 +0000)] 
logger: shadow declaration

misc-utils/logger.c:448:17: warning: declaration of 'msg' shadows a
parameter [-Wshadow]
misc-utils/logger.c:429:74: note: shadowed declaration is here

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoprlimit: cleanup output units
Karel Zak [Thu, 5 Nov 2015 17:59:00 +0000 (18:59 +0100)] 
prlimit: cleanup output units

The change is based on kernel fs/proc/base.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobash-completion: add cal --span
Karel Zak [Thu, 5 Nov 2015 10:34:25 +0000 (11:34 +0100)] 
bash-completion: add cal --span

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoMerge branch 'cal-span' of https://github.com/Deiz/util-linux
Karel Zak [Thu, 5 Nov 2015 10:32:10 +0000 (11:32 +0100)] 
Merge branch 'cal-span' of https://github.com/Deiz/util-linux

* 'cal-span' of https://github.com/Deiz/util-linux:
  cal: Add --span option
  cal: Track date span independently from months_in_row

8 years agobuild-sys: bump also PACKAGE_VERSION_RELEASE number
Karel Zak [Wed, 4 Nov 2015 15:02:44 +0000 (16:02 +0100)] 
build-sys: bump also PACKAGE_VERSION_RELEASE number

Now we bump only PACKAGE_VERSION_MAJOR and PACKAGE_VERSION_MINOR
numbers. The PACKAGE_VERSION_RELEASE is always zero.

These numbers are used for LIBxxx_VERSION strings and Version: field
in the .pc files.

Unfortunately, if we keep PACKAGE_VERSION_RELEASE= always zero then
our bugfix releases are invisible for pkg-config.

(Although I don't think it's good idea to depend in code on any
 library bugfix release, code should be about APIs).

Addresses: https://github.com/systemd/systemd/pull/1754
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolib/sysfs: make sysfs_get_devname()/blkid_devno_to_wholedisk() more robust
Karel Zak [Fri, 30 Oct 2015 10:08:32 +0000 (11:08 +0100)] 
lib/sysfs: make sysfs_get_devname()/blkid_devno_to_wholedisk() more robust

Now the function uses result buffer for internal stuff (readlink), so
it requires that the buffer is large enough. This is unexpected as
caller assumes that the buffer has to be large enough for devname only.

References: http://www.spinics.net/lists/util-linux-ng/msg12015.html
Reported-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agologger: remove unnecessary comment
Karel Zak [Thu, 29 Oct 2015 10:32:50 +0000 (11:32 +0100)] 
logger: remove unnecessary comment

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agologger: use --id as local socket credentials
Karel Zak [Thu, 29 Oct 2015 10:18:21 +0000 (11:18 +0100)] 
logger: use --id as local socket credentials

If you have really paranoid syslog (or systemd who listens on /dev/log)
then it replaces in the message PID with a real PID from socket header
credentials:

 # echo $PPID
 1550

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:22:13 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:22:13 ws kzak[22100]: This is message baby!
                         ^^^^^

This patch forces kernel to accept another *valid* PID if logger(1)
executed with root permissions; improved version:

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:26:00 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:26:00 ws kzak[1550]: This is message baby!

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agologger: use iovec for all message
Karel Zak [Tue, 27 Oct 2015 17:44:00 +0000 (18:44 +0100)] 
logger: use iovec for all message

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agologger: use iovec and sendmsg() to send message
Karel Zak [Tue, 27 Oct 2015 12:19:16 +0000 (13:19 +0100)] 
logger: use iovec and sendmsg() to send message

The iovec based solutions allow to send multiple strings by one
syscall (for example additional \n messages separator). We can also
use it to send additional socket header metadata (e.g.
SCM_CREDENTIALS) later.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoMerge branch 'uuid' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 27 Oct 2015 11:01:22 +0000 (12:01 +0100)] 
Merge branch 'uuid' of git://github.com/kerolasa/lelux-utiliteetit

* 'uuid' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: add uuidd output check
  tests: add uuidgen output check
  tests: make test_uuid_parser to read files
  tests: add uuid parser check

8 years agoctrlaltdel: use path.h to read /proc
Karel Zak [Tue, 27 Oct 2015 10:56:51 +0000 (11:56 +0100)] 
ctrlaltdel: use path.h to read /proc

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: add uuidd output check
Sami Kerola [Sun, 18 Oct 2015 19:01:38 +0000 (20:01 +0100)] 
tests: add uuidd output check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agotests: add uuidgen output check
Sami Kerola [Sun, 18 Oct 2015 18:42:46 +0000 (19:42 +0100)] 
tests: add uuidgen output check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agotests: make test_uuid_parser to read files
Sami Kerola [Sun, 18 Oct 2015 18:07:11 +0000 (19:07 +0100)] 
tests: make test_uuid_parser to read files

This allows using the command to check uuidgen and uuidd are generating
valid outputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agotests: add uuid parser check
Sami Kerola [Sun, 18 Oct 2015 17:39:21 +0000 (18:39 +0100)] 
tests: add uuid parser check

The check is based on code by Theodore Ts'o to test libuuid, from which
unstable output is commented out.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoctrlaltdel: display setting when ran without arguments
Sami Kerola [Tue, 13 Oct 2015 10:52:55 +0000 (11:52 +0100)] 
ctrlaltdel: display setting when ran without arguments

This is more useful than printing an error.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agodocs: update ctrlaltdel.8 man page
Sami Kerola [Mon, 12 Oct 2015 23:45:00 +0000 (00:45 +0100)] 
docs: update ctrlaltdel.8 man page

Most significant clarification is to tell hard C_A_D is the default in linux
kernel.  Update also kernel reference, and improve readability.

Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/reboot.c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoctrlaltdel: improve error messaging
Sami Kerola [Mon, 12 Oct 2015 23:35:42 +0000 (00:35 +0100)] 
ctrlaltdel: improve error messaging

Tell user what is wrong rather than print usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agonologin: require /etc/nologin.txt to be file
Sami Kerola [Tue, 6 Oct 2015 22:15:54 +0000 (23:15 +0100)] 
nologin: require /etc/nologin.txt to be file

This makes silly practical jokes impossible, like for example symlinking
/dev/null or dev/random to /etc/nologin.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agolast: display input file in usage() according to command name
Sami Kerola [Tue, 6 Oct 2015 21:18:27 +0000 (22:18 +0100)] 
last: display input file in usage() according to command name

Default depends on whether the executable is called 'lastb' or something
else.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoscript: be pedantic and use "%"SCNi64
Karel Zak [Fri, 16 Oct 2015 09:48:47 +0000 (11:48 +0200)] 
script: be pedantic and use "%"SCNi64

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoscript: don't assume that time_t is compatible with long
Isaac Dunham [Fri, 16 Oct 2015 01:12:59 +0000 (18:12 -0700)] 
script: don't assume that time_t is compatible with long

time_t may change to 64-bit on 32-bit Linux kernels at some point;
at that point, it may be desireable to test for issues with dates
past 2038.

[kzak@redhat.com: - use %jd rather than %lld]

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosulogin: Use fallback method on the Hurd for detecting consoles
James Clarke [Fri, 9 Oct 2015 23:29:47 +0000 (00:29 +0100)] 
sulogin: Use fallback method on the Hurd for detecting consoles

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
8 years agolibmount: follow docs with parse-error callback return code
Karel Zak [Thu, 15 Oct 2015 10:12:11 +0000 (12:12 +0200)] 
libmount: follow docs with parse-error callback return code

The docs says that recoverable errors have rc > 0.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoRevert "libblkid: support LSI RAID on partition too"
Karel Zak [Thu, 15 Oct 2015 10:04:35 +0000 (12:04 +0200)] 
Revert "libblkid: support LSI RAID on partition too"

This reverts commit bc9007c372765ad4a1c7e1d3d69ba8be800f250f.

We need a better way, it seems that the original report is mostly
about udev rules disadvantages than about libblkid bug. See RH
bugzilla (#1172510) for more details.

8 years agomount, umount, swapon, fsck, lsblk, findmnt: ignore malformed lines
Karel Zak [Thu, 15 Oct 2015 09:53:44 +0000 (11:53 +0200)] 
mount, umount, swapon, fsck, lsblk, findmnt: ignore malformed lines

The libmount provides way how to deal with parsing errors in fstab --
on error callback function is executed and according to the return
libmount manipulate with the malformed line, possible are three
states:

  1/ fatal error; all file ignored              (callback rc < 0)
  2/ recoverable error; malformed line ignored  (callback rc > 0)
  3/ ignore the error                           (callback rc == 0)

The 2/ is the default if no callback specified.

Unfortunately our utils uses 3/. The correct way is to use 2/.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: make XFS Log visible for wipefs
Karel Zak [Tue, 13 Oct 2015 10:01:29 +0000 (12:01 +0200)] 
libblkid: make XFS Log visible for wipefs

Reported-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: root <root@ws.net.home>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: support LSI RAID on partition too
Karel Zak [Tue, 13 Oct 2015 08:55:47 +0000 (10:55 +0200)] 
libblkid: support LSI RAID on partition too

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1172510
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: fix uid= and gid= translation
Karel Zak [Mon, 12 Oct 2015 09:42:13 +0000 (11:42 +0200)] 
libmount: fix uid= and gid= translation

The current libmount version returns error when no able to convert
username/groupname to uid/git.

 # mount mount /dev/sda1 /mnt/test -o uid=ignore
 # mount: failed to parse mount options

This is regression, the original mount(8) has ignored possible unknown
user/group names and the option has been used unconverted (with the
original value). For example UDF kernel driver depends on this behavior
and "uid=ignore" (or "forgot") is a valid mount option.

Fixed version (unit test):

./test_mount_optstr  --fix uid=kzak,gid=forgot,aaa,bbb
optstr: uid=kzak,gid=forgot,aaa,bbb
fixed:  uid=1000,gid=forgot,aaa,bbb

Reported-By: Anthony DeRobertis <anthony@derobert.net>
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801527
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agocal: Add --span option
Deiz [Sat, 10 Oct 2015 00:39:02 +0000 (20:39 -0400)] 
cal: Add --span option

This allows the date spanning behaviour of -3 to be used with other
month ranges.

Signed-off-by: Deiz <silverwraithii@gmail.com>
8 years agocal: Track date span independently from months_in_row
Deiz [Sat, 10 Oct 2015 00:35:17 +0000 (20:35 -0400)] 
cal: Track date span independently from months_in_row

This fixes a minor issue where cal -n 3 would mirror the spanning
behaviour of cal -3 with Gregorian calendars, instead of starting with
the current month.

Signed-off-by: Deiz <silverwraithii@gmail.com>
8 years agoinclude/pt-mbr-partnames: remove '|' from partition type name
Karel Zak [Fri, 9 Oct 2015 11:13:53 +0000 (13:13 +0200)] 
include/pt-mbr-partnames: remove '|' from partition type name

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: Detect out-of-space when adding new primary partition
Ian Wienand [Thu, 8 Oct 2015 04:00:44 +0000 (15:00 +1100)] 
libfdisk: Detect out-of-space when adding new primary partition

I got a bit confused with the interaction below:

  Command (m for help): p
  Disk /dev/sda: 41 GiB, 43965677568 bytes, 85870464 sectors
    ...
  Device     Boot   Start      End  Sectors  Size Id Type
  /dev/sda1  *       2048  1026047  1024000  500M 83 Linux
  /dev/sda2       1026048 85868543 84842496 40.5G 8e Linux LVM

  Command (m for help): n
  To create more partitions, first replace a primary with an extended partition.

I knew I should have had two primary partitions available, but I did
not notice that the disk was seen as full (I was trying to grow it)

This change detects available primary partitions, and if so indicates
we are out of space, rather than out of partitions.

Signed-off-by: Ian Wienand <iwienand@redhat.com>
8 years agofdisk: to recognize Intel Rapid Start hibernation partition
Jörg Jenderek [Wed, 7 Oct 2015 09:41:23 +0000 (11:41 +0200)] 
fdisk: to recognize Intel Rapid Start hibernation partition

I use Intel Rapid Start Technology on my PC. According to their User Guide
"Rapid_Start_Technology_User_Guide_v1.4.pdf" I create a partition with id=84
for hibernation by this Technology.

Unfortunately the software fdisk (util-linux-2.27) classifies that partition as
"OS/2 hidden C:".  That is not wrong, but on website
https://en.wikipedia.org/wiki/Partition_type is written, that id 0x84 beside
using for hiding drive C: this type is a also used as hibernation partition for
Microsoft  APM and also for Intel Rapid Start

So I patched 2 header files so that fdisk recognize this partition type variation.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopartx: prevent code duplication
Karel Zak [Tue, 6 Oct 2015 17:50:56 +0000 (23:50 +0600)] 
partx: prevent code duplication

Reported-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agouuidd: add debug message for timeout
Karel Zak [Fri, 9 Oct 2015 09:46:49 +0000 (11:46 +0200)] 
uuidd: add debug message for timeout

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: use REALTIME_LIBS
Karel Zak [Fri, 9 Oct 2015 09:31:49 +0000 (11:31 +0200)] 
build-sys: use REALTIME_LIBS

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agouuidd: use cxt->quiet
Karel Zak [Fri, 9 Oct 2015 09:26:28 +0000 (11:26 +0200)] 
uuidd: use cxt->quiet

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agouuidd: fix compiler warning [-Wsign-compare]
Karel Zak [Fri, 9 Oct 2015 09:23:16 +0000 (11:23 +0200)] 
uuidd: fix compiler warning [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agouuidd: fix shadow declaration
Sami Kerola [Sat, 3 Oct 2015 18:31:07 +0000 (19:31 +0100)] 
uuidd: fix shadow declaration

misc-utils/uuidd.c:384:13: warning: declaration of 'ret' shadows a previous
   local [-Wshadow]
misc-utils/uuidd.c:327:6: note: shadowed declaration is here

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agouuidd: use signalfd() and setup_timer()
Sami Kerola [Sat, 3 Oct 2015 18:31:06 +0000 (19:31 +0100)] 
uuidd: use signalfd() and setup_timer()

Point of this change is to replace use of signal() and alarm() system calls
using newer interfaces.  Nice side effect is that the point where timer was
earlier used cannot be distracted by sending rogue SIGALRM.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoblkid, uuidd, uuidgen: assume getopt.h and getopt.h are available
Sami Kerola [Sat, 3 Oct 2015 18:31:05 +0000 (19:31 +0100)] 
blkid, uuidd, uuidgen: assume getopt.h and getopt.h are available

These headers are in use allover this project without issues.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agouuidd: slice up the usage text and normalize its layout
Sami Kerola [Sat, 3 Oct 2015 18:31:04 +0000 (19:31 +0100)] 
uuidd: slice up the usage text and normalize its layout

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agotests: replace username with tag in logger test
Karel Zak [Tue, 6 Oct 2015 09:06:21 +0000 (11:06 +0200)] 
tests: replace username with tag in logger test

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: add missing files
Karel Zak [Tue, 6 Oct 2015 08:46:37 +0000 (10:46 +0200)] 
tests: add missing files

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: update and extend logger tests
Karel Zak [Tue, 6 Oct 2015 08:17:11 +0000 (10:17 +0200)] 
tests: update and extend logger tests

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agologger: fix messages separation on UNIX socket
Karel Zak [Tue, 6 Oct 2015 07:16:33 +0000 (09:16 +0200)] 
logger: fix messages separation on UNIX socket

The function write_output() add additional \n after each message on
TYPE_TPC. This is required by syslog daemons, otherwise you will see
multiple log messages merged together in your log file, for example:

  Oct  6 09:01:40 ws kzak: AAA<14>Oct  6 09:01:40 kzak: BBB

for

  printf "AAA\nBBB\n" | logger -p info -u <any-socket>

Unfortunately, the connection initialization functions keep the
default ALL_TYPES as connection type and nowhere in the control struct
is info about the final real connection type. The problem is invisible
when you specify --tpc or --udp on logger command line.

Addresses: https://github.com/karelzak/util-linux/issues/225
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agouuidd: improve socket activation error messaging
Sami Kerola [Sat, 5 Sep 2015 18:56:36 +0000 (19:56 +0100)] 
uuidd: improve socket activation error messaging

Tell more exactly what is wrong and how, and give hint how to recover
when possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agobash-completion: curly brace missed for findmnt
Alexander Kuleshov [Fri, 2 Oct 2015 09:38:56 +0000 (15:38 +0600)] 
bash-completion: curly brace missed for findmnt

This patch provides fix for bash-completion/fndmt script. There
is curly brace missed in the completion generation for the -M/--mountpoint
option.

In other way we will get following messages:

bash: /etc/bash_completion.d/findmnt: line 91: unexpected EOF while looking for matching `)'
bash: /etc/bash_completion.d/findmnt: line 141: syntax error: unexpected end of file

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
8 years agofdisk: to recognize partition type 0xEA (Rufus)
Jörg Jenderek [Sat, 26 Sep 2015 00:58:06 +0000 (02:58 +0200)] 
fdisk: to recognize partition type 0xEA (Rufus)

i used a partitioning+formatting tool product rufus 2.2. of
https://rufus.akeo.ie/ This software has an extra format option for older BIOS.
With this fix the main partition is created with some alignments and for the
remaining unallocated space a small extra and empty partition with
identification 0xEA is created.

On the List of partition identifiers for PCs at
http://www.win.tue.nl/~aeb/partitions/partition_types-1.html is is said that
there is a freedesktop proposal to use also type ea as boot partition

Unfortunately the software fdisk (util-linux-2.27) can not classify that
partition.  I send for the fdisk program my 2 patches so that fdisk recognize
this partition type.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoMerge branch 'logger'
Karel Zak [Thu, 1 Oct 2015 12:51:49 +0000 (14:51 +0200)] 
Merge branch 'logger'

8 years agologger: add --sd-id and -sd-param
Karel Zak [Thu, 1 Oct 2015 12:48:15 +0000 (14:48 +0200)] 
logger: add --sd-id and -sd-param

This patch add support for RFC 5424 structured data elements. For
example:

     logger --rfc5424 --sd-id zoo@123                \
                      --sd-param tiger=\"hungry\"    \
                      --sd-param zebra=\"running\"   \
                      --sd-id manager@123            \
                      --sd-param onMeeting=\"yes\"   \
                      "this is message"

produces:

     <13>1 2015-10-01T14:07:59.168662+02:00 ws kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="218616"][zoo@123 tiger="hungry" zebra="running"][manager@123 onMeeting="yes"] this is message

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolib/strv: add strv_extendv()
Karel Zak [Thu, 1 Oct 2015 12:43:05 +0000 (14:43 +0200)] 
lib/strv: add strv_extendv()

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoRevert "logger: add support for rfc5424 structured data (--hdr-data)"
Karel Zak [Thu, 1 Oct 2015 10:00:54 +0000 (12:00 +0200)] 
Revert "logger: add support for rfc5424 structured data (--hdr-data)"

Sorry, pushed incomplete implementation...

This reverts commit d8959474c4af7abd47c2027ed9b7e63a433b9427.

8 years agologger: add support for rfc5424 structured data (--hdr-data)
Karel Zak [Thu, 1 Oct 2015 09:35:58 +0000 (11:35 +0200)] 
logger: add support for rfc5424 structured data (--hdr-data)

for example:
   logger --rfc5424 --hdr-data myAnimal=\"cat\" --hdr-data isHungry "message string"

produces:
   <13>1 2015-10-01T11:38:08.265799+02:00 ws kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="369547" myAnimal="cat" isHungry] message string

Reported-by: Priya Ahuja <priahuja321@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibuuid: fix buffer overflow with long paths
Karel Zak [Wed, 30 Sep 2015 10:42:16 +0000 (12:42 +0200)] 
libuuid: fix buffer overflow with long paths

Based on patch from Justin Akers, he wrote:
> When building Openembedded inside a Jenkins matrix job the paths can
> get quite long. This ensures libuuid won't crash when attempting to
> connect to uuidd in such a scenario.

Reported-by: Justin Akers <dafugg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agozramctl: fix lists of the all devices
Karel Zak [Thu, 24 Sep 2015 10:46:21 +0000 (12:46 +0200)] 
zramctl: fix lists of the all devices

The command zramctl lists the same stat info for all devices (DATA COMPR TOTAL).

Reported-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: add read() based fallback for char (UBI) devs
Karel Zak [Thu, 24 Sep 2015 08:35:18 +0000 (10:35 +0200)] 
libblkid: add read() based fallback for char (UBI) devs

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: use mmap() rather than read()
Karel Zak [Tue, 22 Sep 2015 13:37:26 +0000 (15:37 +0200)] 
libblkid: use mmap() rather than read()

diff between
perf stat -e 'syscalls:sys_enter_*'
for old and new version:

-                35      syscalls:sys_enter_lseek
-                38      syscalls:sys_enter_read
+                 3      syscalls:sys_enter_read
...
-                19      syscalls:sys_enter_mmap
+                17      syscalls:sys_enter_mmap

-       0.001083084 seconds time elapsed
+       0.000751722 seconds time elapsed

The patch dramatically reduces malloc()+seek()+read() operations in
libblkid. The code mmaps ~2MiB of the begin and the end of the device
and it moves buffers management to kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: (zfs) keep bufferes read-only
Karel Zak [Tue, 22 Sep 2015 13:27:39 +0000 (15:27 +0200)] 
libblkid: (zfs) keep bufferes read-only

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: (promise raid) cleanup code
Karel Zak [Tue, 22 Sep 2015 09:14:31 +0000 (11:14 +0200)] 
libblkid: (promise raid) cleanup code

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolib/crc32: don't require to modify GPT header
Karel Zak [Tue, 22 Sep 2015 13:26:36 +0000 (15:26 +0200)] 
lib/crc32: don't require to modify GPT header

This patch introduces smart crc32 function that is able to exclude
specified. The advantage is that we does not have to modify GPT header
(set the current in-header crc field to zero) when we count crc32.

This allows to keep GPT header in read-only buffers and simplify code.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: add --delete
Karel Zak [Thu, 17 Sep 2015 11:57:44 +0000 (13:57 +0200)] 
sfdisk: add --delete

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: fix partition move/resize code
Karel Zak [Thu, 17 Sep 2015 10:27:58 +0000 (12:27 +0200)] 
libfdisk: fix partition move/resize code

- verify that the new partition fits to the area if the size of the
  has not been modified
- fix remaining space calculation (yes, brown-paper-bag bug..)
- offer also space before first partition as free space

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: add more debug message to resize code
Karel Zak [Thu, 17 Sep 2015 10:04:23 +0000 (12:04 +0200)] 
libfdisk: add more debug message to resize code

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: fix -N return code detection, add debug messages
Karel Zak [Thu, 17 Sep 2015 09:45:02 +0000 (11:45 +0200)] 
sfdisk: fix -N return code detection, add debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: (gpt) control ranges in set_partition
Karel Zak [Thu, 17 Sep 2015 09:44:08 +0000 (11:44 +0200)] 
libfdisk: (gpt) control ranges in set_partition

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoipcs: fix ipc_sem_get_limits()
Karel Zak [Tue, 15 Sep 2015 07:50:08 +0000 (09:50 +0200)] 
ipcs: fix ipc_sem_get_limits()

Reported-by: https://github.com/AndrewIrcha
Addresses: https://github.com/karelzak/util-linux/commit/e5995acda2d3d55ba4d926741ddd789c9776f1e7#commitcomment-13200369
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: (monitor) remove unnecessary epoll EPOLLPRI
Karel Zak [Fri, 11 Sep 2015 09:37:49 +0000 (11:37 +0200)] 
libmount: (monitor) remove unnecessary epoll EPOLLPRI

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: (monitor) don't check for regular mtab
Karel Zak [Fri, 11 Sep 2015 09:19:30 +0000 (11:19 +0200)] 
libmount: (monitor) don't check for regular mtab

The monitor supports utab only (as documented). It's application
responsibility to use libmount in the right way. It's overkill to
check for valid environment during monitor initialization.

For example systemd checks for regular mtab during boot, it's better
than try to be smart later in libmount monitor when system is already
running.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: cleanup and optimize --move-data
Karel Zak [Wed, 9 Sep 2015 12:48:33 +0000 (14:48 +0200)] 
sfdisk: cleanup and optimize --move-data

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: add sfdisk --move-data test
Karel Zak [Wed, 9 Sep 2015 12:43:31 +0000 (14:43 +0200)] 
tests: add sfdisk --move-data test

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: add --move-data
Karel Zak [Tue, 8 Sep 2015 14:37:08 +0000 (16:37 +0200)] 
sfdisk: add --move-data

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agosfdisk: add --reorder
Karel Zak [Wed, 2 Sep 2015 12:49:36 +0000 (14:49 +0200)] 
sfdisk: add --reorder

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1232707
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agobuild-sys: release++ (v2.27) v2.27
Karel Zak [Mon, 7 Sep 2015 07:55:19 +0000 (09:55 +0200)] 
build-sys: release++ (v2.27)

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update v2.27-ReleaseNotes
Karel Zak [Mon, 7 Sep 2015 07:53:37 +0000 (09:53 +0200)] 
docs: update v2.27-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update AUTHORS file
Karel Zak [Mon, 7 Sep 2015 07:50:08 +0000 (09:50 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: merge changes
Karel Zak [Mon, 7 Sep 2015 07:47:51 +0000 (09:47 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Mon, 7 Sep 2015 07:42:15 +0000 (09:42 +0200)] 
po: update uk.po (from translationproject.org)

8 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 7 Sep 2015 07:42:15 +0000 (09:42 +0200)] 
po: update pl.po (from translationproject.org)

8 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Mon, 7 Sep 2015 07:42:15 +0000 (09:42 +0200)] 
po: update ja.po (from translationproject.org)

8 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Mon, 7 Sep 2015 07:42:14 +0000 (09:42 +0200)] 
po: update es.po (from translationproject.org)

8 years agologger: improve logger --journald man page example
Michal Schmidt [Thu, 3 Sep 2015 11:41:19 +0000 (13:41 +0200)] 
logger: improve logger --journald man page example

The example use of logger --journald in the man page has a couple of flaws:
 - It's missing a "MESSAGE=" field. This is supposed to be the primary
   human readable text. Without it the log entry is invisible in a
   plain "journalctl" output.
 - The MESSAGE_ID is supposed to be a 128-bit hexadecimal string that
   globally uniquely identifies the message type.
   One can generate such an id with "journalctl --new-id".

This patches fixes the above and also changes the example to use a
here-document instead of printf. In my opinion it makes the expected
multi-line data format more obvious.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
8 years agohwclock: fix format warning in alpha code
Andreas Henriksson [Mon, 7 Sep 2015 06:50:39 +0000 (08:50 +0200)] 
hwclock: fix format warning in alpha code

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
8 years agoMerge branch 'build-sys' of https://github.com/kolyshkin/util-linux
Karel Zak [Fri, 4 Sep 2015 08:07:28 +0000 (10:07 +0200)] 
Merge branch 'build-sys' of https://github.com/kolyshkin/util-linux

* 'build-sys' of https://github.com/kolyshkin/util-linux:
  build-sys: allow gettext 0.17 to be used
  build-sys: allow autoconf < 2.64 to be used

8 years agolibmount: typo fixes
Kir Kolyshkin [Thu, 3 Sep 2015 00:48:56 +0000 (17:48 -0700)] 
libmount: typo fixes

I was reading the code and found these mountinfo typos.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
8 years agobuild-sys: allow gettext 0.17 to be used
Kir Kolyshkin [Thu, 3 Sep 2015 01:20:22 +0000 (18:20 -0700)] 
build-sys: allow gettext 0.17 to be used

The requirement for gettext 0.18 was introduced by commit e3e16717
to pass --no-wrap option to msgmerge tool, which I guess improves
the process of updating po files for translators. At the same time,
unfortunately, it makes building from git fail on a RHEL/CentOS 6
system, as it comes with gettext 0.17.

Use the existing hack in autogen.sh to allow building with gettext 0.17,
with an appropriate warning so that the user is aware:

 warning: forcing autopoint to use old gettext 0.17

The only negative side effect of this patch I am aware of is
if gettext-0.17 is used, then --no-wrap is not being passed
to msgmerge (although msgmerge 1.17 already supports it), because
Makefile.in.in that comes with gettext 0.17 doesn't have MSGMERGE_OPTIONS.
From my POV, this is way better than to not being able to build.

NOTE if gettext 0.18.3 is installed, it is used and this patch
doesn't change anything; it only allows gettext 1.17 to be used
if this is all we have.

Cc: Benno Schulenberg <bensberg@justemail.net>
Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
8 years agobuild-sys: allow autoconf < 2.64 to be used
Kir Kolyshkin [Thu, 3 Sep 2015 00:50:15 +0000 (17:50 -0700)] 
build-sys: allow autoconf < 2.64 to be used

Since commit 50d096a macro m4_ifblank is used, but as it is only
available in autoconf-2.64, on CentOS 6 system we end up with:

> $ ./autogen.sh
> configure:25396: error: possibly undefined macro: m4_ifblank
>       If this token and others are legitimate, please use
> m4_pattern_allow.
>       See the Autoconf documentation.
> [root@kir-ovz2 util-linux]# autoconf --version
> autoconf (GNU Autoconf) 2.63

So, the obvious thing to do would be to raise AC_PREREQ to 2.64
in configure.ac. But, given the facts that
 - autoconf 2.64 is not available for RHEL/CentOS 6,
 - the only need is one small macro,
it's better to just add the missing macro.

While at it, add the m4_ifnblank, too.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>