Commit Graph

1515 Commits

Author SHA1 Message Date
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
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
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
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
Karel Zak 6067af3f65 Merge branch 'hwman' of github.com:jwpi/util-linux
* 'hwman' of github.com:jwpi/util-linux:
  hwclock: add checking kernel vars to man-page
  hwclock: Add ntptime reference to man-page
2015-02-10 11:53:42 +01:00
Ruediger Meier d9ca5dd442 setarch: fix typo (missing braces) for ppcle
Introduced in 77eb13b9, noticed on ppc64le.

CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-02-10 11:18:51 +01:00
Karel Zak d45984bef6 lscpu: fix typos in ppc code
Reported-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-09 12:03:18 +01:00
J William Piggott 3400dbba7c hwclock: add checking kernel vars to man-page
How to check kernel clock variables with either
adjtimex or ntptime added to man-page.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-02-08 16:44:26 -05:00
J William Piggott 37f8d848af hwclock: Add ntptime reference to man-page
Some distros do not have an adjtimex package;
ntptime can be used as an alternate.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-02-07 20:44:02 -05:00
Karel Zak 79738105b1 lscpu: cleanup ppc virtualization detection
References: https://bugzilla.redhat.com/show_bug.cgi?id=1151604
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-06 11:23:40 +01:00
Karel Zak f93993b746 lscpu: fix compiler error [-Werror=format-security]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-06 10:31:03 +01:00
Karel Zak 3565bd7aec lscpu: detect also QEMU emulation on ppc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-05 16:52:43 +01:00
Benno Schulenberg fc14ceba5e textual: grammarize and harmonize the stat error message
The message "stat failed %s" seems to say that stat() failed to
do something, or failed to pass a test, but of course it means
that the statting of something failed.  So say so.  Also make
two very similar messages equal to this one.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 11:27:10 +01:00
Sami Kerola 51278ec020 docs: mention nice(1) in renice(1) manual page
Addresses: https://bugs.debian.org/260984
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-02 11:27:10 +01:00
Jan Kara 3c1f7603bf mount: Further FAT mount option update
Add some mount options mentioned in Documentation/filesystems/vfat.txt.

Signed-off-by: Jan Kara <jack@suse.cz>
2015-02-02 11:27:10 +01:00
Jan Kara b7b16b0bcf mount: Add documentation of FAT mount option time_offset
Signed-off-by: Jan Kara <jack@suse.cz>
2015-02-02 11:27:10 +01:00
Karel Zak b2b5b502d2 setarch: fix --list
$ ./setarch --list
.
.
setarch: no architecture argument specified

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 08:26:09 +01:00
Karel Zak 8a3f29c34a switch_root: document that maintains /run too
Addresses: https://github.com/karelzak/util-linux/issues/144
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-26 11:45:43 +01:00
Karel Zak a471a9e780 Merge branch 'icc-fixes' of https://github.com/rudimeier/util-linux
* 'icc-fixes' of https://github.com/rudimeier/util-linux:
  build: fix printf warnings for icc (-Wformat-security)
  build-sys: fix UL_SCANF_TYPE_MODIFIER for icc
  build-sys: free() needs stdlib.h
  build-sys: avoid icc warnings "ignoring unknown option"
  tests: python tests should not remove user's LD_LIBRARY_PATH
2015-01-26 11:35:25 +01:00
Karel Zak 3d0b57d62c Merge branch 'opts' of https://github.com/jwpi/util-linux 2015-01-26 11:31:05 +01:00
Benno Schulenberg 54fefa078e textual: fix spellos and inconsistencies in several program messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:17:55 +01:00
Ingo Brückl b45c3da2e1 dmesg: Enable proper indent for messages containing line breaks
Messages containing line breaks somehow look broken when additional time,
facility or level information is displayed, because they partly appear in
time/facility/level column.

Indent them accordingly.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-26 11:03:34 +01:00
Ruediger Meier f205c90a72 build: fix printf warnings for icc (-Wformat-security)
Intel compiler complains about printf style function calls with trivial
format string and no other arguments. Like this one:

../sys-utils/ipcrm.c(117): warning #2279: printf/scanf format not a string literal and no format arguments
                        err(EXIT_FAILURE, iskey ? _("key failed") : _("id failed"));
2015-01-21 11:15:19 +01:00
J William Piggott b06c1ca6f8 docs: restore minus symbols in long opts
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-20 18:15:30 -05:00
Karel Zak 2498303575 libmount: revert "read mtab on remount" idea
It's backwardly incompatible nonsense to prefer mtab on remount.

 mount -o remount /foo

has to read mount options from fstab otherwise the remount has no
effect. (The ideal solution would be to read both mtab, then modify
the options according to fstab -- but for now more important is to be
backwardly compatible.)

References: https://bugzilla.redhat.com/show_bug.cgi?id=1182778
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-16 12:24:57 +01:00
Karel Zak 7e9dddc67b Merge branch 'isa' of github.com:jwpi/util-linux
* 'isa' of github.com:jwpi/util-linux:
  hwclock: update man-page for directisa change
  hwclock: remove automatic ISA fallback
2015-01-14 10:29:44 +01:00
J William Piggott 1afe0412e0 hwclock: update man-page for directisa change
Update man-page for the direct ISA options
changes.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-13 20:31:47 -05:00
J William Piggott 97c9060b92 hwclock: remove automatic ISA fallback
The old behavior when hwclock was unable to access
the rtc device was to fallback to direct ISA I/O.

This was sometimes allowing two processes to access
the Hardware Clock at the same time and hanging the
system. This is the reason the rtc device driver
only allows one process to open it.

Now hwclock defaults to using the rtc device and only
uses direct ISA when that option is given.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-13 20:29:21 -05:00
J William Piggott 973252578d docs: fix-up man-pages flaged by checkmans.sh
disk-utils/sfdisk.8	Fix font escape
login-utils/vipw.8	Delete bogus macro
misc-utils/look.1	Delete bogus macro
sys-utils/prlimit.1	Delete bogus macro

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-13 11:43:46 -05:00
Karel Zak 1c50f02612 hwclock: exclude also i386 from CMOS auto-probing 2015-01-13 13:47:48 +01:00
Karel Zak 9f109204b2 hwclock: don't check CMOS automatically on x86_64
We have enabled CMOS also for x86_64, but it should be available only
if --directisa is explicitly specified.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 09:44:11 +01:00
Lubomir Rintel 69a7761b95 unshare: add some examples
...and fix one typo.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-12 12:41:02 +01:00
JWP d1bfa4ef53 hwclock: man regression
Fixes merge for commit 2ed1d70 that clobbered commit 98ac774

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-12 12:36:23 +01:00
Karel Zak 5edb0ea6bb setarch: cleanup options usage
* call --help, --verbose and --list from one place only
* add 'archwrapper' variable to detect when called by symplink
* make --list available only got setchar(8) (but no for symlinks)

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-12 12:22:10 +01:00
Benno Schulenberg 8854b121fd docs: mention that setarch may not be able to set all listed architectures
[[kzak@redhat.com: - use minus in option name\

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-12 11:33:47 +01:00
Benno Schulenberg 1e098672f4 setarch: differentiate between "unrecognized" and "cannot set"
When the provided string does not match any architecture that
setarch knows about, the response stays "Unrecognized architecture",
but when trying to set the specified architecture does not have any
effect, then respond with "Kernel cannot set architecture to...".

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:28:21 +01:00
Benno Schulenberg 3a60b1c26b docs: remove obsolete and unneeded comments from man-page files
Transform some of them into copyright lines.
Also fix three header lines and snip some trailing whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:26 +01:00
JWP cb15645bd3 hwclock: man page 'Since v2.26' notes
Clean up the 'Since v2.26' man page notes.
They were redundant of information already
in the manual, and became too verbose.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-09 10:50:26 +01:00
JWP 2ed1d70160 hwclock: update man page for v2.26 rc
Authored new section: DATE-TIME CONFIGURATION.
Subsections: Keeping Time..., LOCAL vs UTC, POSIX vs 'RIGHT'.
Errata and drop outdated language.
Updates for v2.26

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-09 10:50:26 +01:00
JWP bf6199673b hwclock: Incorrect UTC defaults
Hwclock's default timescale was changed to UTC in:

commit 7894bf0f08
Date:   Mon Feb 21 13:27:07 2011 +0000

This change was incomplete.

With no /etc/adjtime file the current behavior is:
hwclock --utc --adjust        #Creates a UTC file.
hwclock --localtime --adjust  #File is not created.

That is the opposite of what UTC default should do.

With this patch the behavior is:
hwclock --utc --adjust        #File is not created.
hwclock --localtime --adjust  #Creates a LOCAL file.

'Creates a xxxx file' means: An /etc/adjtime file
is created with zero for all parameters except the
Hardware Clock's timescale field, which is set to
the value indicated by xxxx.

The second item missed in the patch was a test in
the save_adjtime() function that defaults to LOCAL.

Theoretically we cannot get to the save function
without having a value set for adjtime.local_utc,
but the test is there so it needs be correct.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-09 10:44:02 +01:00
JWP cfb8ed1910 hwclock: enable --directisa for x86_64
Currently only x86 and Alpha can use --directisa.
This patch allows x86_64 machines to use it as well.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-09 10:44:00 +01:00
Karel Zak e99a6626d6 nsenter: add --preserve-credentials and cleanup setgroups() usage
The new option --preserve-credentials completely disables all
operations related to UIGs and GIDs.

The patch also calls setgroups() before we enter user namespace (so
root can always clear their groups) and after we enter user namespace
(to detect /proc/self/setgroups "deny"). If both fail then nsenter
complains.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-09 10:36:21 +01:00
Karel Zak 83fb8aa53d nsenter: keep semantic consistent
The current nseneter behavior is inconsistent and depends on way how
namespace is specified on command line

    # nsenter --user
vs.
    # nseneter --user=filename

if the namespace is specified by <filename> than nsenter does not do
additinal setting and actions (e.g. does not call setgroups, setuid).
This is bug.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-09 10:36:01 +01:00
Karel Zak fbceefded6 unshare: add --setgroups=deny|allow
Since Linux 3.19 the file /proc/self/setgroups controls setgroups(2)
syscall usage in user namespaces. This patch provides command line knob
for this feature.

The new --setgroups does not automatically implies --user to avoid
complexity, it's user's responsibility to use it in right context. The
exception is --map-root-user which is mutually exclusive to
--setgroups=allow.

CC: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-09 10:35:16 +01:00
Eric W. Biederman 0bf159413b unshare: Fix --map-root-user to work on new kernels
In rare cases droping groups with setgroups(0, NULL) is an operation
that can grant a user additional privileges.  User namespaces were
allwoing that operation to unprivileged users and that had to be
fixed.

Update unshare --map-root-user to disable the setgroups operation
before setting the gid_map.

This is needed as after the security fix gid_map is restricted to
privileged users unless setgroups has been disabled.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2015-01-09 10:32:33 +01:00
Sami Kerola c4e8acb9d9 eject: add verbosity to cdrom door lock error
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 22:33:09 +00:00
Sami Kerola 587f90b055 ipcs: remove FIXME markup
The ipc message q_qbytes information is not in /proc, and it is unlikely
it will ever appear to there.

Reference: https://lkml.org/lkml/2012/11/25/18
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 21:57:53 +00:00
Sami Kerola 98ac77456e docs: make tools/checkmans.sh to pass without warnings
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 21:57:53 +00:00
Karel Zak 2fa60c5ec2 build-sys: support nsenter.static
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-07 10:59:16 +01:00
Sami Kerola 7ee26cbf02 maint: fix shadow declaration
This change fixes all shadow declarations.  The worth while to mention
fix is with libfdisk sun geometry.  It comes from bitops.h cpu_to_be16
macro that further expands from include/bits/byteswap.h that has the
shadowing.

libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow]
libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow]

That could have caused earlier some unexpected results.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:08:21 +01:00
Karel Zak 185aa9e5b8 fallocate: create mode 0666, that's what umask is for
User's umask will typically mask the mode down to 0664 or 0644.

Reported-by: Peter Cordes <peter@cordes.ca>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-07 09:57:55 +01:00
Karel Zak 17bf9c1c39 ipcrm: fix usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-06 11:55:21 +01:00
Benno Schulenberg 7009af0e0d ipc*: use customary fputs() instead of fprintf() with the usage macros
Also use the clearer word <number> with the --semaphore option.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:50:18 +01:00
Benno Schulenberg 26b0b857c9 textual: list the options of setarch in a more alphabetical order
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:43:16 +01:00
Benno Schulenberg 682430494c setarch: make the usage synopsis comprehensible for translators
Use two separate strings for the two different forms of setarch,
instead of filling in an untranslated word into a single string.
Also use the standard angular brackets for nonliteral arguments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:42:41 +01:00
Benno Schulenberg 6ad5b22ca6 docs: restore the alternative form of setarch in its man page
Commit c372860ddb accidentally removed
the alternative form of setarch in which the command name specifies
the architecture to be set.  Also improve some formatting.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:41:03 +01:00
Benno Schulenberg 4e788f4621 ipcrm: gettextize the command synopsis of the usage text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:41:03 +01:00
Benno Schulenberg afd86656de ipcs: in usage show resource option as nonoptional when used with -i
Also, the resource option -a is not valid with -i, so show the valid
ones explicitly.  Also gettextize the synopsis as a single string, as
the two lines are tightly related and other synopses do this too.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:40:01 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Karel Zak 929c257548 ipcs: fix shmctl() usage
The function shmctl() has to be called with 'struct shmid_ds', and if
you need 'struct shminfo' then the right way is to cast:

bad way:
  struct shm_info info;

  shmctl(0, SHM_INFO, &info);

right way:
  struct shmid_ds buf;
  struct shm_info *info;

  shmctl(0, SHM_INFO, &buf);
  info = (struct shm_info *) &buf);

The patch also fixes bug in ipc_shm_get_limits() where is missing
lim->shmmax in code based on shmctl().

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-19 13:42:41 +01:00
Sami Kerola 3ce29d6d46 ipcs: fix two data type errors [AddressSanitizer]
==3218==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffa577e2b0 at pc 0x4501f9 bp 0x7fffa577e130 sp 0x7fffa577e108
WRITE of size 112 at 0x7fffa577e2b0 thread T0
    #0 0x4501f8 in shmctl /home/users/aadgrand/LLVM/releases/ubuntu/final/llvm.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:2502
    #1 0x48bd13 in ipc_shm_get_info /home/travis/build/kerolasa/lelux-utiliteetit/sys-utils/ipcutils.c:157
    #2 0x488884 in do_shm /home/travis/build/kerolasa/lelux-utiliteetit/sys-utils/ipcs.c:279
    #3 0x4844a8 in main /home/travis/build/kerolasa/lelux-utiliteetit/sys-utils/ipcs.c:175
    #4 0x2afb3f8c176c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
    #5 0x48408c in _start (/home/travis/build/kerolasa/lelux-utiliteetit/ipcs+0x48408c)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-19 11:32:38 +01:00
Sami Kerola 772420322d lscpu: blacklist vmware_bdoor() AddressSanitizer check
AddressSanitizer is identifying the __asm__ segment as suspicious.

==1215==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000
(pc 0x0000004ccffd bp 0x7fff9b7184f0 sp 0x7fff9b7184e0 T0)
    #0 0x4ccffc in vmware_bdoor /home/src/util-linux/sys-utils/lscpu.c:660

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-19 11:32:38 +01:00
Benno Schulenberg f49ccec212 docs: don't use bold or italics for "[option]" in synopsis of man pages
As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:23 +01:00
Karel Zak 01966ce852 libmount: allow unspecified source on remount
kernel does not require mount source (e.g. device name) on remount, it
means that fstab/mtab/mountinfo should be optional in this case.
For example:

 mount -o rw,remount /

has to work on system without mounted /proc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-18 10:47:39 +01:00
Cristian Rodríguez fad25f02a3 build-sys: hwclock requires -lm
hwclock uses fabs and therefore needs libm, otherwise a linking
error ocurrs when building with -fno-builtin.
2014-12-09 09:19:36 +01:00
Karel Zak bc265f7cfa eject: use sysfs API to detect hotplug
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-02 11:00:19 +01:00
Karel Zak 784467ad2d blkdiscard: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 12:38:53 +01:00
Karel Zak 41525ce062 ldattach: add fallback for N_GSM0710
Addresses: https://github.com/karelzak/util-linux/issues/133
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-21 13:57:14 +01:00
Karel Zak cd2876d252 build-sys: move all around clock_gettime() to monotonic.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-19 11:54:47 +01:00
Karel Zak a4830f617e build-sys: use CLOCKGETTIME_LIBS
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-19 11:23:05 +01:00
Karel Zak 700031ade7 misc: use monotonic time rater than gettimeofday
Based on patch Alexander Samilovskih <alexsamilovskih@gmail.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 14:35:21 +01:00
Ville Skyttä 9779f59831 docs: Spelling fixes
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 13:59:19 +01:00
Karel Zak 8596f63914 ldattach: GSM0710 support, add intro modem command
Patch add:
 --intro-command string  : send command to modem
 --pause value           : define delay between intro command and ldattach

Based on patch from Martin Schmid <scm@aps-systems.ch>

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 13:49:42 +01:00
Tobias Stoeckmann 6cbf75e56e lscpu: theoretical buffer overflow
there is a theoretical buffer overflow possible in the hypervisor
parsing code of lscpu.  It would require a proc entry to return way more
than expected so it's no high priority.  But better be safe than sorry.

At first I thought about switching to fgets but there is another
code file that adds a format specifier.  The diff is less intrusive
that way, too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 11:38:21 +01:00
Benno Schulenberg df48a72161 hwclock: improve wording and formatting of man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-13 15:09:16 +01:00
Karel Zak 64d0cee6c0 include/statfs_magic: use macro rather than type for f_type
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-10 11:29:42 +01:00
Benno Schulenberg f4cae17663 swapon: reword some usage strings
Also remove some inconsistent periods and properly punctuate
the closing sentence.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-07 13:21:06 +01:00
Benno Schulenberg 24930e7088 docs: fix some wording, grammar and formatting in man page of swapon
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-07 13:21:06 +01:00
Karel Zak 52f2fd9bcc swapoff: swapoff swap files by LABEL and UUID
# swapon --show=NAME,UUID
 NAME                   UUID
 /dev/sda3              8d52fca3-bf48-41d6-b826-2315e518a305
 /home/fs-images/2g.img 6fa72b96-b802-441f-a31c-091d65c0212c

 # swapoff UUID=6fa72b96-b802-441f-a31c-091d65c0212c
 swapoff: cannot find the device for UUID=6fa72b96-b802-441f-a31c-091d65c0212c

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 12:08:11 +01:00
Karel Zak 8f806bb1ea switch_root: improve statfs->f_type portability
__SWORD_TYPE is not available everywhere, for example it's not defined
by musl libc. It also seems that __SWORD_TYPE is not used for f_type
on some architectures (s390x).

Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-06 12:50:27 +01:00
Karel Zak 0bf037402a lib/loopdev: replace custom DBG() with include/debug.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-04 14:08:45 +01:00
Karel Zak 68e422ecae docs: update info about env debug variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:54 +01:00
Karel Zak 03b5e5975a swapon: improve man page notes about holes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 10:11:58 +01:00
Karel Zak 54f2e4563d swapon: remove extra word from usage
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-31 10:58:27 +01:00
Benno Schulenberg 6ee8e19489 textual: slice up the usage text of swapon for ease of translation
A new option was added recently; seize this opportunity to cut the
usage text into small and easily managed chunks.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-31 10:39:11 +01:00
Benno Schulenberg b1301d7865 docs: fix some wording and formatting in man page of swapon
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-31 10:39:08 +01:00
Sami Kerola b35c37274c fstrim: initialize path variable
Reading the code this initialization is not necessary, so the change is
mostly about silencing a compiler warning and ensuring the program keeps
on working if there is a future bug that could make uninitialized 'path'
reachable to use.

sys-utils/fstrim.c:247: warning: 'path' may be used uninitialized in this
function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:38:58 +01:00
Karel Zak 8fc4a88630 build-sys: properly check for -lrt
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 11:05:14 +01:00
Karel Zak c0dedab013 build-sys: old glibc requires -lrt clock_gettime()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 10:47:32 +01:00
Karel Zak 4f55368cc5 blkdiscard: fix includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 10:00:19 +01:00
Karel Zak 8f59654a40 blkdiscard: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 09:42:51 +01:00
Federico Simoncelli c472a7e35a blkdiscard: add support for steps and progress
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2014-10-27 09:16:49 +01:00
Federico Simoncelli d7ce9acb33 blkdiscard: fail on sector misalignment 2014-10-27 09:16:47 +01:00
J William Piggott bbb4c273e9 hwclock: Reduce drift factor update period
To facilitate the calculation of 'cold' vs 'warm' Hardware Clock drift
factor the limit on the update period needs to be less than 8 hours.

4 hours should be enough drift to allow calculations that are not
grossly out of range.

For example, with a workstation that is shutdown every night the cold
drift factor can be significantly different than a drift factor based on
a 24 hour period.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-20 15:22:24 -04:00
J William Piggott 66af1c0f44 hwclock: fix superfluous 'if' statement and typo
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-20 14:48:07 -04:00
J William Piggott 5cb71d2bca hwclock: adjust wording of v2.26 notes
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-20 14:07:27 -04:00
Sami Kerola 6f7f155c0c eject: move unreachable code to preprocessor #else block [smatch scan]
eject.c:466 toggle_tray() info: ignoring unreachable code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-20 14:07:18 +02:00
Karel Zak 732ac3a52a hwclock: add notes about default behavior changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-20 14:01:25 +02:00
Karel Zak fc56c36368 hwclock: cleanup man and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-20 13:31:36 +02:00
Karel Zak e2c1eb9913 Merge branch 'master' of https://github.com/jwpi/util-linux into hwclock 2014-10-20 11:41:38 +02:00
Karel Zak e07fdac476 swapon: add -o <list> for compatibility with mount
The new option allows to specify swap options by fstab compatible
string. The concept is the same as for mount(8).

   swapon -o pri=1,discard=pages,nofail /dev/sda2

The advantage is that tools (like systmed) that parses fstab can call
swapon without translation from fstab options to swapon(8) command
line options.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-20 10:59:08 +02:00
Karel Zak ba986e815c mount: don't ignore mtab for --bind -o remount
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-17 08:53:54 +02:00
J William Piggott cd950279f1 hwclock: Add --update-drift option MAN
Update hwclock man page for the
hwclock: Add --update-drift option patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 16:15:06 -04:00
J William Piggott f276d71a3e hwclock: Add --update-drift option
There are cases where we need to refresh the
timestamps in the adjtime file without updating the
drift factor.

For example, with ntpd and an Eleven Minute Mode
kernel, we need to call systohc at shutdown to
facilitate drift correction.  With the current
behavior hwclock will clobber the drift factor to
near zero, because the Hardware Clock and System
Clock are synced by Eleven Minute Mode.  What
actually needs to be done is refresh the adjtime
file timestamps and not calculate a new drift
factor.

Because it is a manual process to craft a good
Hardware Clock drift factor, that is, there is no
automated method that will produce a good drift
factor, this patch changes the default drift
calculation behavior to off, and it is turned on
by using the --update-drift option. Once we have a good
drift factor for a given machine we do not want
anything clobbering it, including an administrator
forgetting to turn off recalculation. A system
administrator should make a concious effort in
telling hwclock with the --update-drift option that
(s)he wants to recalculate the drift factor.

Without using the --update-drift option with calibrate
operations only the timestamps are refreshed in
the adjtime file. With the --update-drift option the old
default behavior of refreshing the timestamps and
updating the drift factor is performed.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 15:48:17 -04:00
J William Piggott 8db424dcbc hwclock: persistent_clock_is_local MAN
Update hwclock man page for the
hwclock: persistent_clock_is_local patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:48:07 -04:00
J William Piggott d17a12a368 hwclock: persistent_clock_is_local
When hctosys is used at boot time, making it the
first caller of settimeofday, the responsibility
of setting persistent_clock_is_local is thrust
upon it.  Currently hctosys always leaves this
variable uninitialized.  This causes a Hardware
Clock configured to use the local timescale to be
clobbered with the UTC timescale by the kernel's
NTP eleven minute mode.

This patch fixes this hctosys bug, by having it
properly set persistent_clock_is_local according
to the time scale configured for the Hardware
Clock.

It does this via the kernel warp_clock function
but this in inconsequential, because we set the
system time immediately afterward.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:45:29 -04:00
J William Piggott cb7efbc12d hwclock: hctosys drift compensation II MAN
Update hwclock man page for the
hwclock: hctosys drift compensation II patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:37:08 -04:00
J William Piggott ede32597f5 hwclock: hctosys drift compensation II COMMENTS
Update source comments and --help output for the
hwclock: hctosys drift compensation II patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:32:31 -04:00
J William Piggott 2794995ad9 hwclock: hctosys drift compensation II
Allowing hctosys to drift compensate facilitates:

More precise setting of the System Clock early in
the boot process when --adjust cannot be used
because the file system is not writeable.

Applies sub second drift corrections immediately,
where as --adjust cannot.

Reduces boot time by not calling hwclock multiple
times, e.g., --hctosys early before fsck when the
file system is read-only, then --adjust later when
the file system is read-write and --hctosys again
for drift correction.

Use of --adjust elsewhere may no longer be
necessary.

Part II

After the original submission of this patch I
realized that now all operations except --systz
require drift corrected Hardware Clock time.
Therefore, it should be done only once early in
the process. Upon implementation of that premise
many improvements were facilitated:

* Adds drift correction to --hctosys.
* Adds setting system time with sub-second precision.
* Adds --get, a drift corrected 'show' operation.
* Improves drift factor calculation precision while
   greatly simplifying its algorithm.
* Fixes --show bug, printing integer sub-seconds, and
   now uses a more intuitive positive value.
* Fixes --predict bug, drift correction must be
   negated to predict future RTC time.
* Reduces the number of function arguments and
   lines of code.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:21:13 -04:00
Karel Zak 0c75b6a470 blkdiscard: fix err->errx()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-14 12:14:05 +02:00
Raphael S. Carvalho 303884a495 blkdiscard: fix underflow when offset is greater than device size
If offset (range[0]) is greater than device size (blksize), the variable 'end'
will be greater than blksize, and range[1] (length) will be recalculated.
The underflow happens when subtracting range[0] (offset) from blksize, thus
range[1] will be the result of an underflow. The bug leads to unwanted behavior
from the program, where range[1] is likely to be a high number and then will
discard a considerable amount of blocks from the device. The fix consists of
exitting the program with an error message when the condition stated above is
true. Spotted while auditing the code.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-10-14 12:04:14 +02:00
Karel Zak 33ecab2b9c dmesg: improve reltime colors
[  +0.004034] sd 113:0:0:0: [sdb] Attached SCSI disk
[Oct10 13:04]  sdb: unknown partition table
[  +0.034011]  sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 >

.. the "Oct10 13:04" is possible to colorize by "timebreak"
scheme (default is bold green).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-14 10:20:19 +02:00
Karel Zak c4604c38b5 flock: zero timeout is valid
This patch reverts Sami's "timeout cannot be zero", introduced
in commit 605325b23b.

The --timeout 0 has been originally interpreted as --nonblock. The
patch also add hint about this behavior to the man page.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1149974
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 12:12:39 +02:00
Karel Zak f1453d528e losetup: improve man page -D docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 11:54:33 +02:00
Sami Kerola 83aa4ad797 hwclock: use fabs() instead abs() when argument is double
sys-utils/hwclock.c:1219:13: warning: using integer absolute value function
      'abs' when argument is of floating point type [-Wabsolute-value]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 13:09:36 +02:00
Sami Kerola db433bf737 textual: use usage() text element macros
Translating these text elements should happen only once, which is
more likely when the text macros are used properly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:26 +02:00
Sami Kerola a587cc5520 textual: use manual tail usage() macro
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:24 +02:00
Sami Kerola f627750083 textual: use version printing macro everywhere
Only mount, umount, and blkid remains not using the macro because they
are print also library references.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:23 +02:00
Sami Kerola c5c056e7fe flock: add error message to translations
And remove type casting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:18 +02:00
Sami Kerola 7d2600e2d0 docs: update deprecation banners
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:11 +02:00
Sami Kerola a12124ce7a swapon: align available columns section in usage()
Commit 5db57cfc46 missed doing this change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:10 +02:00
Benno Schulenberg 42f00a7df5 textual: there may be no space between option and optional =arg
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:11 +02:00
Benno Schulenberg 298dc4ff6b textual: angular brackets around a non-literal argument, singular
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:10 +02:00
Benno Schulenberg 548696c442 textual: grammarize another error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:09 +02:00
Benno Schulenberg 7a853ebc38 textual: using angular brackets around individual arguments
And separate short and long options with the standard comma.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:08 +02:00
Benno Schulenberg 6269814950 textual: grammarize an error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:07 +02:00
Benno Schulenberg b73142b97a textual: not using angular brackets around literal arguments
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:06 +02:00
Benno Schulenberg 09638694d4 textual: use angular brackets around each individual argument
In usage texts each word that is an argument should be marked
separately with angular brackets.  Also add a translator comment.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:02 +02:00
Karel Zak 8a4c64e6ac mount: improve --move docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-09-25 11:01:39 +02:00
Karel Zak 286f1e229b Merge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetit
* 'misc' of git://github.com/kerolasa/lelux-utiliteetit:
  textual: share crypt() error message in sulogin and newgrp
  newgrp: avoid use of obsolete getpass() function
  newgrp: use libc function to read gshadow if it is available
  setarch: use personality() system call when it is available
  setarch: reindent code
  hwclock: remove referal to deprecated keyboard interface
  eject: make open_device() and select_speed() to use struct eject_control
  eject: add struct eject_control to remove global variables
  mountpoint: simplify if statement
  mkfs.minix: fix couple compiler warnings
  mountpoint: add struct mountpoint_control
  last: improve code readability by renaming variable names
  last: make is_phantom() when kernel config does not include audit support
  lib: remove xgetpass()
  include: simplify fputc_careful() in carefulputc.h
  libuuid: add extern qualifiers to uuid/uuid.h system header
2014-09-22 14:55:37 +02:00
Karel Zak fb2ba06663 Merge branch 'renice' of git://github.com/kerolasa/lelux-utiliteetit
* 'renice' of git://github.com/kerolasa/lelux-utiliteetit:
  renice: reorder usage() option descriptions
  rename: add getpriority() message lookup table
  renice: fix numeric uid argument parsing
  renice: avoid having same lines of code twice
  renice: disallow --priority <arg> without pid argument
  rename: use usage and version print out macros
  renice: reorder functions to avoid need of function prototype
2014-09-22 14:43:30 +02:00
Karel Zak 18b3e5495b swapon: split swapon-common.c
swapon    - requires libmount and libblkid
 swapoff   - requires libmount
 swaplabel - requires libblkid

This patch add lib/swapprober.c with blkid stuff for swap. It allows
to use and link libblkid only when necessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-09-22 13:16:25 +02:00
Sami Kerola 94b1623be3 renice: reorder usage() option descriptions
Make the Usage: and Options: sections to be in same order, which I found
to be quicker to use than alphabetical order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola ce4030e484 rename: add getpriority() message lookup table
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola 80ca9e2039 renice: fix numeric uid argument parsing
The following was inconflict with what usage() tells are valid option
arguments.

$ renice 1 -u 1000
renice: unknown user 1000
$ id
uid=1000(kerolasa) ...

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola 00b490f002 renice: avoid having same lines of code twice
Add getprio() function to avoid duplication of a simple task.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola 0bb01bb0b7 renice: disallow --priority <arg> without pid argument
Earlier a lonely priority with an argument but without pid resulted to no
action and success, when the invocation should have failed.

$ renice --priority 42 ; echo $?
0

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:12 +01:00
Sami Kerola 6dcc066f3b rename: use usage and version print out macros
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:12 +01:00
Sami Kerola 5ebcab664e renice: reorder functions to avoid need of function prototype
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:12 +01:00
Sami Kerola 9ed11cc260 setarch: use personality() system call when it is available
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 77eb13b965 setarch: reindent code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 846c7d30b3 hwclock: remove referal to deprecated keyboard interface
The KDGHWCLK has been gone quite a while.

Reference: http://marc.info/?l=linux-kernel&m=104171103925897
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 25a3fa8159 eject: make open_device() and select_speed() to use struct eject_control
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 257a003528 eject: add struct eject_control to remove global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola ee5de88c51 mountpoint: simplify if statement
Returning straight after print_devno() makes the code to be more obvious
and removes need for long else statement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:01 +01:00
Sami Kerola f112f41e05 mountpoint: add struct mountpoint_control
This unifies variable names in different functions, and removes redundant
stat() calls.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:01 +01:00
Karel Zak 29607edf65 Merge branch 'master' of https://github.com/stevenhoneyman/util-linux 2014-09-17 11:56:13 +02:00
Andreas Henriksson 2eaac5489b ipcrm: add hacks to avoid FTBFS
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-09-17 10:15:14 +02:00
Aurelien Jarno e4a382b777 ipcs: remaining kFreeBSD hackery for building.
Addresses-Debian-Bug: #527384
Signed-off-by: LaMont Jones <lamont@debian.org>
2014-09-17 10:14:19 +02:00
Boris Egorov 73f2bec5f8 lscpu: fix cppcheck warnings
CppCheck founds a few wrong arguments in format strings and a NULL
pointer dereference.

Amended version with fixed strcmp() usage.

Signed-off-by: Boris Egorov <egorov@linux.com>
2014-09-16 11:16:09 +02:00
Steven Honeyman 0a55b319d4 zramctl: fixed two -Wformat-security warnings
(they prevented compilation if -Werror=format-security is enabled)

Signed-off-by: Steven Honeyman <stevenhoneyman@users.noreply.github.com>
2014-09-15 21:59:31 +01:00
Dave Reisner 44e9d52e52 mountpoint: clarify that it works on files
fef4dfa174 removed the restriction that the argument must explicitly be
a directory, so let's fix up the documentation to reflect that.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-22 08:14:29 +02:00
Dave Reisner fef4dfa174 mountpoint: drop S_ISDIR check
Files can be mountpoints, too.
2014-08-21 15:05:45 +02:00
Benno Schulenberg 882be62610 docs: improve the description of --size in the man page of zramctl
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-20 10:47:07 +02:00
Sami Kerola 3077ff49f3 swapon: remove invalid error string print outs
To avoid messages like this:

$ swapon /dev/zram0
swapon: /dev/zram0: read swap header failed: Success

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-11 14:51:56 +02:00
Benno Schulenberg 1d23119072 textual: remove some inconsistent periods from error messages
While doing so, also improve translatability and some wordings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-11 14:51:54 +02:00
Mike Frysinger 7845b91dbc lscpu: clean up vmware inline asm
This code is not PIC clean which means it fails to build on hardened
32bit x86 systems (i.e. building as PIE).

While here, optimize the existing cpuid logic slightly.

URL: https://bugs.gentoo.org/518936
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-08-11 14:51:53 +02:00
Sami Kerola 1fa6c3e0b9 zramctl: improve option combination error messaging
Use of --algorithm or --streams is not expected to work without
reseting device, that happens when --size is specified, so ensure the
former options to be combined with the later.

[kzak@redhat.com: - make it more generic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 14:47:08 +02:00
Karel Zak 342436c66a zramctl: cannonicalize devname when no fullpath specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 14:39:46 +02:00
Sami Kerola 929c7b2817 zramctl: improve error message
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-11 14:27:13 +02:00
Karel Zak 116c9ce23d zramctl: fail status printout when device does not exist
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 14:26:20 +02:00
Sami Kerola ef567176b1 zramctl: add details to --size option documentation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 13:58:35 +02:00
Karel Zak 423c0d75ec zramctl: remove extra \n from usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 15:04:58 +02:00
Steven Honeyman 1b19ea31a3 docs: fix inconsistencies in man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 14:50:20 +02:00
Karel Zak b07ca5160c zramctl: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 09:02:09 +02:00
Karel Zak 6ed7f01127 zramctl: fix typo
Reported-by: Steven Honeyman
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-05 15:47:36 +02:00
Benno Schulenberg f0b3e6c2f9 docs: improve the wording and formatting of the zramctl man page
Especially fix the mistaken short option -h for --noheadings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-05 15:37:42 +02:00
Benno Schulenberg 1c35e62517 zramctl: fix the wording of some message strings
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-05 15:37:41 +02:00
Benno Schulenberg 851c2bd55d docs: restore the mention of uhelper= and helper= in man page of umount
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-05 15:37:36 +02:00
Karel Zak 0624d8406b zrmactl: add new command to control /dev/zramN devices
Co-Author: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-01 12:09:55 +02:00
Sami Kerola 3d595f92c8 build-sys: remove swap-common.h from sys-utils/Makemodule.am
The commit 25a365e moved the file to include/

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-30 20:48:46 +01:00
Karel Zak 47f42c1d14 nsenter: allow to use --set{uid,gid} for all namespaces
Now it's possible to set UID and GID for user namespaces only. This
patch removes this restriction and allow to use --set{uid,gid} in all
cases. The default for user namespaces is still GID=0, UID=0.

Reported-by: Tomas Doran <bobtfish@bobtfish.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:07:44 +02:00
Benno Schulenberg d6983300a2 docs: remove all mention of helper= and uhelper= from umount man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-29 12:14:57 +02:00
Benno Schulenberg ae4cc2adea docs: sort the options in the man pages of hwclock and uuidd
Also improve the formatting a bit.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-29 12:14:56 +02:00
Benno Schulenberg 61ef38eb1b docs: bring the rtcwake man page closer to standard formatting
Also sort the options alphabetically, and use the standard comma
instead of the vertical bar to separate short from long option.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-29 12:14:56 +02:00
Karel Zak 68030a76d7 hwclock: check for permissions before use clock interface
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 08:27:00 +02:00
Sami Kerola 25a365ef5a 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>
2014-07-28 12:28:05 +02:00
Lauri Nurmi 5adf126ef2 hwclock: use pluralized translations. 2014-07-28 11:47:50 +02:00
Benno Schulenberg 6070a9853a 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>
2014-07-28 11:16:58 +02:00
Benno Schulenberg 556c9c4842 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>
2014-07-28 11:16:57 +02:00
Benno Schulenberg 00d1cc1ddf 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>
2014-07-28 11:16:55 +02:00
Benno Schulenberg 5e43af7e34 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>
2014-07-28 11:16:53 +02:00
Karel Zak e9b6e76a26 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>
2014-07-25 13:08:41 +02:00
Karel Zak 64a7e20980 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>
2014-07-25 12:28:34 +02:00
Karel Zak a3c74d88e1 swapon: don't print errors as data in smartcols table
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 12:29:38 +02:00
Karel Zak 7c1fa4691f 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>
2014-07-22 12:24:56 +02:00
Sami Kerola 5db57cfc46 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>
2014-07-22 12:17:20 +02:00
Benno Schulenberg b59c86c8d5 docs: bring one more man page closer to standard formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-22 10:43:04 +02:00
Karel Zak c6f637e667 prlimit: remove repeating words from man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-21 16:09:38 +02:00
Benno Schulenberg c372860ddb 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>
2014-07-21 10:29:44 +02:00
Benno Schulenberg cf8e0bae34 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>
2014-07-21 10:29:43 +02:00
Karel Zak 06716dffdc mount: update info about mtab in mount.8
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-21 10:27:25 +02:00
Karel Zak 7887c6e0f0 prlimit: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:54:31 +02:00
Karel Zak a560a3487b swapon: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:53:02 +02:00
Karel Zak d78deddc6d losetup: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:52:02 +02:00
Karel Zak 059a91f8d0 wdctl: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:50:33 +02:00
Karel Zak 86c58c4a82 umount: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 15:12:35 +02:00
Karel Zak df1a1ca0c9 fstrim: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 15:07:49 +02:00
Benno Schulenberg d179d01950 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>
2014-07-17 14:01:04 +02:00