Commit Graph

9192 Commits

Author SHA1 Message Date
Sami Kerola cd2a6f1cfd rpmatch: use symbolic value when evaluation return codes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 12:42:06 +01:00
Sami Kerola 47d20536e0 eject: use parse_switch()
[kzak@redhat.com: - use extended parse_switch()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-24 12:08:40 +01:00
Karel Zak 30b294c491 lib/strutils: extend parse_switch() to accept more options
* allow to specify more 0|1 pairs
* allow to specify error message

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-24 12:04:22 +01:00
Sami Kerola e5cf147655 lib/strutils: move parse_switch() from setterm(1) to library
To allow sharing the code with other utilities.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-24 11:33:31 +01:00
Sami Kerola c45c3837b6 tunelp: remove unnecessary preprocessor directives
The lp.h included earlier in the tunelp.c has the definitions that were
checked, so these statements could have not been false and such
impossible conditions does not need to be checked.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 11:30:51 +01:00
Sami Kerola 7e3c80a7b6 tunelp: remove get_val() in favour of strtol_or_err()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 11:28:55 +01:00
Sami Kerola 288cb6f5dd prlimit: tell in --verbose output which pid got the new limit
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 11:22:26 +01:00
Karel Zak af17d349fc libblkid: cleanup names, don't copy probing results
* cleanup function and variable names (s/vals/values/)
* in "safe probe" mode libblkid copies probing result from the first
  attempt, this is unnecessary, with values list we can just move
  values to another list rather than copy all.
* add new debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-24 10:24:15 +01:00
Ondrej Oprala 6c4a7811f8 libblkid: make probing data structures more dynamic
* replace static probing result array with list
* use allocated buffers for probing result variables

[kzak@redhat.com: - rename some functions
                  - clean up \0 terminator usage in variables
                  - remove never used code to convert UUID to lower-case
                  - remove possible memory leaks on errors]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-24 10:22:37 +01:00
Karel Zak 85589c4c49 docs: add terminal-colors requests to TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 14:31:02 +01:00
Karel Zak 9465221848 tools: add libfdisk docs to kernel.org release generator
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 13:43:42 +01:00
Karel Zak 3c0a983ec9 build-sys: release++ (v2.26)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 13:11:24 +01:00
Karel Zak 559e84b055 docs: update v2.26-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 13:10:10 +01:00
Karel Zak 07ecd0b297 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 13:07:55 +01:00
Karel Zak 3e2ab89e95 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 13:06:10 +01:00
Trần Ngọc Quân 3563d16134 po: update vi.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Yuri Chornoivan daa0498643 po: update uk.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Jakub Bogusz 587a53b767 po: update pl.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Benno Schulenberg 8f40996d59 po: update nl.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
David Prévot c72fdb5409 po: update fr.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Antonio Ceballos Roa 021f47db33 po: update es.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Mario Blättermann d7c1dbc6f3 po: update de.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Joe Hansen 171ece6204 po: update da.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Petr Písař 8ad65cd292 po: update cs.po (from translationproject.org) 2015-02-19 13:02:28 +01:00
Karel Zak 0be901e535 libfdisk: fix fdisk_partition_get_parent() docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 12:37:23 +01:00
Karel Zak 71b74ca792 tests: scsi_debug workaround
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 12:36:52 +01:00
Karel Zak 4e3b32eb8f docs: add cfdisk auto-sort to TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 11:56:11 +01:00
Karel Zak 703bf3535d libblkid: set SBMAGIC for nilfs2
Reported-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 11:33:39 +01:00
Sami Kerola 00b5ef70e2 setarch: print error when command runs without arguments
$ ./setarch
Segmentation fault (core dumped)
$ coredumpctl gdb
...
Program terminated with signal SIGSEGV, Segmentation fault.
301                     if (*argv[1] != '-') {

Reference: 5edb0ea6bb
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-19 10:55:10 +01:00
Benno Schulenberg 0209a128b5 tests: improve some wordings of the output
For one, replace the puzzlingly stern imperative "IGNORE" with
the simple and light-hearted and descriptive "SKIPPED".

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-19 10:55:10 +01:00
Karel Zak d65c7c7701 Merge branch 'hwman2' of https://github.com/jwpi/util-linux
* 'hwman2' of https://github.com/jwpi/util-linux:
  hwclock: improve man-page language
2015-02-19 10:54:12 +01:00
J William Piggott 440afddb1c hwclock: improve man-page language
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-02-19 10:54:02 +01:00
Karel Zak 37290a5396 libmount: remove assert(arg) from public functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 14:17:54 +01:00
Karel Zak 323da9ce47 libsmartcols: remove assert(arg) from public functions
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 13:49:29 +01:00
J William Piggott f3f4197021 hwclock: improve man-page language
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-02-16 07:43:40 -05:00
Karel Zak ff5ace78d6 libmount: improve remount logic
* fix fs type detection for remount
 * parse mtab only for remount and umount

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 13:39:33 +01:00
Karel Zak e3f72275ca libmount: add --enable-libmount-force-mountinfo
The default libmount mtab management depends on mtan symlink. If the
symlink exists than libmount parses /proc/self/mountinfo, otherwise it
parses regular classic /etc/mtab. This is backwardly compatible and
transparent solution.

Unfortunately, this is not robust enough because some broken init
scripts or 3-party mount helpers may remove the symlink and create
regular mtab file. This is pretty bad if initd (systemd) depends on
libmount.

Fortunately we known that mtab is absolutely unwanted on some distros,
so it's fine too ignore mtab at all and don't care about the symlink.

Reported-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 12:49:49 +01:00
J William Piggott 440b529693 hwclock: man-page errata
Professor Eggert, maintainer of the tz database, reviewed
the new POSIX vs 'RIGHT' man-page section and suggested
the following corrections.

Correct the subdirectory names and remove IANA from the
name of the Time Zone Database.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-02-16 11:08:24 +01:00
Sami Kerola d77dc29e6e logger: add --socket-errors compatibility option
Hello,

Depending viewpoint this change is either regression fix, or
re-regression in context of none-systemd init.  I ack the change is sent
very late to be part of v2.26, but then again the excess noise was found
only because of -rc1 was tested in sysvinit environment.  IMHO it would
contradict purpose of having rc's if faults will not lead to fixes.

I also want to point out the sysvinit scripts are broken, not the
logger(1), but getting them corrected is practically impossible.
Assuming sysvinit script are further developed by various teams and
distributions who maintain them they should use --socket-error=on in
future, and write scripts that pass without noise.  Meanwhile trying to
be clever when to silence errors seems like a reasonable thing to do.

--->8----
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 14 Feb 2015 19:05:55 +0000
Subject: [PATCH] logger: add --socket-errors compatibility option

Now when logger(1) has stopped using openlog() for Unix sockets, in
commit mentioned in reference, the lack of /dev/log detected will report
error accordingly.  According to Gabriele Balducci this makes sysvinit
style boot scripts to print a lot of errors.  So make the logger to
detect whether it should be in compatibility mode, and not report errors
if logging device is missing.  That imitates behavior of glibc openlog().

To allow full control to users the /dev/log error messages can be forced
to on or off.  The automatic error messaging is explained in manual page.

Reference: 1d57503378
Reported-by: Gabriele Balducci <balducci@units.it>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-16 11:08:24 +01:00
Sami Kerola 6340e9137f sfdisk: include rpmatch.h
Some libc's do not have rpmatch(), and they need the workaround in the
header file.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-16 11:08:24 +01:00
Karel Zak 0b1bb28399 fsck: fix compiler warning [-Wlogical-not-parentheses]
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 11:02:53 +01:00
Stanislav Brabec ab52a8bcce script.1: Improve documentation of non-interactive behavior
- use exit in .profile to avoid non-logged session after typing "exit"
- document that script can read more from stdin than the command inside:

echo -e 'script -c "read a b ; echo a=\$a b=\$b >defs.sh"\n1 2\necho Done' | sh
Script started, file is typescript
1 2
echo Done
Script done, file is typescript
2015-02-16 10:49:36 +01:00
Stanislav Brabec 8fd4a7aa81 script: no logging for non-interactive shells
Karel Zak wrote:

> Would be better to learn people to fix their shell initialization
> files to not call script(1) for non-interactive sessions?

It makes sense.

From 8fff32e65399ae07f70e12568d4d5278725673a7 Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@suse.cz>
Date: Wed, 11 Feb 2015 15:02:10 +0100
Subject: [PATCH] script.1: Document behavior in non-interactive shells

And discourage users from such use.
2015-02-12 14:31:16 +01:00
Karel Zak 60d29f827b libmount: read utab always when read mtab from /proc
Now libmount reads utab only when mtab filename is no explicitly
specified, but for example:

 mnt_table_parse_mtab(tb, "/proc/self/mountinfo");

ignores utab because filename points to regular file. This is mistake,
we wnat to read utab always when we read mount table from kernel.

Reported-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-12 13:21:08 +01:00
Karel Zak 9c277ede65 findmnt: don't parse mountinfo twice
We parse /proc/self/mountinfo to initialize cache targets, this step
is unnecessary if --mtab reads all from kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-12 12:57:03 +01:00
Benjamin Romer 4597b69249 lscpu: add s-Par support
Adds support for the s-Par firmware's hypervisor leaf.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
2015-02-11 11:46:19 +01:00
Sami Kerola 559a5b6cf2 sulogin, hwclock: use xusleep() instead of usleep()
As said in include/c.h the usleep() is marked as obsolete, so do the same
that most of the other util-linux calls do with this interface.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-10 13:21:24 +01:00
Sami Kerola 2fc5a0d5bc rename: use strrchr() instead of rindex()
The rindex() is marked legacy in POSIX.1-2001, and apparently Androids
bionic libc does not even have it so it is best not to use the legacy
interface.

Reference: https://lists.gnu.org/archive/html/weechat-dev/2014-02/msg00004.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-10 13:21:23 +01:00
Karel Zak 4863ddaddf libfdisk: add some docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-10 13:17:29 +01:00
Karel Zak fbec8d9fad libfdisk: ignore whole-disk partition when check order
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-10 13:00:52 +01:00