Commit Graph

9853 Commits

Author SHA1 Message Date
Karel Zak 4b09b1c253 uuidd: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-09 11:23:16 +02:00
Sami Kerola fd346daf89 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>
2015-10-09 11:17:12 +02:00
Sami Kerola 25d66b4e32 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>
2015-10-09 11:17:11 +02:00
Sami Kerola 67791b7787 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>
2015-10-09 11:17:09 +02:00
Sami Kerola 61b6427638 uuidd: slice up the usage text and normalize its layout
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-09 11:17:08 +02:00
Karel Zak 64b5e362a9 tests: replace username with tag in logger test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-06 11:06:21 +02:00
Karel Zak 9baf46ea54 tests: add missing files
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-06 10:46:37 +02:00
Karel Zak 5b90a8f38f tests: update and extend logger tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-06 10:17:11 +02:00
Karel Zak fc20393cdb 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>
2015-10-06 09:16:33 +02:00
Sami Kerola fa8945db4a 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>
2015-10-02 12:38:30 +02:00
Alexander Kuleshov 100a43932c 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>
2015-10-02 12:34:23 +02:00
Jörg Jenderek b12b07e361 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>
2015-10-02 12:34:01 +02:00
Karel Zak 2b29b8734a Merge branch 'logger' 2015-10-01 14:51:49 +02:00
Karel Zak 4299ed1ce2 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>
2015-10-01 14:48:15 +02:00
Karel Zak de8d3863c8 lib/strv: add strv_extendv()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-01 14:43:05 +02:00
Karel Zak 4eec8a8c45 Revert "logger: add support for rfc5424 structured data (--hdr-data)"
Sorry, pushed incomplete implementation...

This reverts commit d8959474c4.
2015-10-01 12:00:54 +02:00
Karel Zak d8959474c4 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>
2015-10-01 11:47:05 +02:00
Karel Zak d5358bbb6b 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>
2015-09-30 12:42:16 +02:00
Karel Zak 1ceb4077af 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>
2015-09-24 12:46:21 +02:00
Karel Zak 2355dd6a49 libblkid: add read() based fallback for char (UBI) devs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak a674a0ab03 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>
2015-09-24 11:10:09 +02:00
Karel Zak 9325a8be9e libblkid: (zfs) keep bufferes read-only
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak 6b86ef4a6a libblkid: (promise raid) cleanup code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak 7020de0be8 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>
2015-09-24 09:26:42 +02:00
Karel Zak aab9be66c4 sfdisk: add --delete
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 13:57:44 +02:00
Karel Zak 83677b99cb 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>
2015-09-17 13:22:11 +02:00
Karel Zak f2be8b3dfc libfdisk: add more debug message to resize code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 12:04:23 +02:00
Karel Zak 31c79e1823 sfdisk: fix -N return code detection, add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 11:45:02 +02:00
Karel Zak c949fa98d8 libfdisk: (gpt) control ranges in set_partition
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 11:44:08 +02:00
Karel Zak 53650755e0 ipcs: fix ipc_sem_get_limits()
Reported-by: https://github.com/AndrewIrcha
Addresses: e5995acda2 (commitcomment-13200369)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-15 09:50:08 +02:00
Karel Zak 1d15c4b273 libmount: (monitor) remove unnecessary epoll EPOLLPRI
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-11 11:37:49 +02:00
Karel Zak 0250174654 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>
2015-09-11 11:19:30 +02:00
Karel Zak d85a7fa744 sfdisk: cleanup and optimize --move-data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-09 14:48:33 +02:00
Karel Zak 161f399f13 tests: add sfdisk --move-data test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-09 14:43:31 +02:00
Karel Zak f42205d89a sfdisk: add --move-data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-08 16:37:08 +02:00
Karel Zak 9a17d9460a sfdisk: add --reorder
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1232707
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 10:18:46 +02:00
Karel Zak cd150a429d build-sys: release++ (v2.27)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:55:19 +02:00
Karel Zak dbf5898fca docs: update v2.27-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:53:37 +02:00
Karel Zak 8cc98eab8c docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:50:08 +02:00
Karel Zak ac31e6f823 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:47:51 +02:00
Yuri Chornoivan 242d1044d2 po: update uk.po (from translationproject.org) 2015-09-07 09:42:15 +02:00
Jakub Bogusz 7a9dfc96a4 po: update pl.po (from translationproject.org) 2015-09-07 09:42:15 +02:00
Takeshi Hamasaki 00a96dbb4e po: update ja.po (from translationproject.org) 2015-09-07 09:42:15 +02:00
Antonio Ceballos Roa 8e4f54d00e po: update es.po (from translationproject.org) 2015-09-07 09:42:14 +02:00
Michal Schmidt b632f55c29 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>
2015-09-07 08:54:15 +02:00
Andreas Henriksson e8c0003481 hwclock: fix format warning in alpha code
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-09-07 08:50:39 +02:00
Karel Zak 9d0655fe2d 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
2015-09-04 10:07:28 +02:00
Kir Kolyshkin 58dda170fb libmount: typo fixes
I was reading the code and found these mountinfo typos.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-09-02 18:45:06 -07:00
Kir Kolyshkin e46a7f8efe 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>
2015-09-02 18:42:24 -07:00
Kir Kolyshkin a8afc8c666 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>
2015-09-02 18:41:52 -07:00