Commit Graph

1043 Commits

Author SHA1 Message Date
Karel Zak 47dd69188a docs: add info about *_DEBUG= to man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 11:16:46 +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
Karel Zak db0ccb761d whereis: lookup also info docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-02 11:15:47 +01:00
Karel Zak f1b64c1c1f wipefs: fix FD leak on error [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-29 12:42:58 +01:00
Karel Zak 1539750f2a lsblk: implement SOMEOK (=64) return code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-29 12:35:26 +01:00
Karel Zak 4631e25427 findmnt: fix mem leaks [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-29 11:59:54 +01:00
Karel Zak c580b554c9 Merge branch 'timex' of https://github.com/kerolasa/lelux-utiliteetit
* 'timex' of https://github.com/kerolasa/lelux-utiliteetit:
  logger: check availability of ntp_gettime()
2015-01-26 11:59:10 +01:00
Yuri Chornoivan 6e834d67ee textual: fix various minor typos 2015-01-26 11:38:38 +01:00
Karel Zak 3d0b57d62c Merge branch 'opts' of https://github.com/jwpi/util-linux 2015-01-26 11:31:05 +01:00
Karel Zak d0e875ffd4 logger: improve usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-26 11:26:40 +01:00
Benno Schulenberg d45867162c textual: put option and its description into a single translatable string
Also improve the description: notime, notq, and nohost are literals,
not things to be replaced by something else -- so no angular brackets.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:22:13 +01:00
Benno Schulenberg 981997dd37 docs: fix two spellings in man page of logger
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:22:13 +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
Samuel Thibault 87ee265835 logger: check availability of ntp_gettime()
Make compilation to work in systems which don't have sys/timex.h and its
ntp_gettime().

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Samuel Thibault <sthibault@debian.org>
2015-01-23 19:57:22 +00: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
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
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
Sami Kerola 9329e724af look: remove dead code
MAP_FILE is ignored compatibility flag.

Reference: http://man7.org/linux/man-pages/man2/mmap.2.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 21:57:53 +00:00
Sami Kerola 64a265bf8a lslocks: fix type warning
misc-utils/lslocks.c:229:2: warning: format '%x' expects argument of type
'unsigned int *', but argument 3 has type 'int *' [-Wformat=]

Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/locks.c?id=5e0f872c7d7e371fbdf09e864eddd24bddfda8fe#n2533
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:14:11 +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
Benno Schulenberg dfe6a6d085 look: slice up the usage text for ease of translation
Also use the standard macros, and correct the synopsis: use angular
brackets and show that look accepts multiple files.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:46:11 +01:00
Benno Schulenberg 92f1c5ab8d docs: improve some wordings on the man page of wipefs
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:38:29 +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
Sami Kerola 26f3a38673 cal: fix signed integer overflow [AddressSanitizer]
misc-utils/cal.c:811:16: runtime error: signed integer overflow:
2147483645 + 536870911 cannot be represented in type 'int'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-19 09:10:48 +00:00
Benno Schulenberg 7ab7109972 docs: adjust some formatting and wordings in a handful of man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:25 +01:00
Benno Schulenberg a54b8e245f docs: adjust the grammar, text, sorting and formatting of logger man page
The message argument is not an option and should not be listed among
those.  Describe the optional argument of --rfc5424 better.  Use the
= and no space for optional option arguments.  Don't italicize words
unnecessarily.  Use bold for literal things.  And sort the options
alphabetically (apart from -V and -h).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:24 +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
Benno Schulenberg 1d855f188f docs: improve the sorting of the options in the man page of getopt
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:22 +01:00
Benno Schulenberg ae76917250 textual: do not start option descriptions with a capital
This normalizes the help text of getopt, clarifies one description,
and also adjust two comments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:21 +01:00
Karel Zak 4b4e1b10f3 getopt: cleanup add_log_options()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-09 12:21:33 +01:00
Karel Zak c29b090fc5 getopt: rename function to keep code readable
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-09 12:17:57 +01:00
Karel Zak f7b38b8733 getopt: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-09 12:17:22 +01:00
Sami Kerola 3aa141879f getopt: avoid re-terminating long_option list at every update
Terminating the ctl->long_options list once when adding options is
completed is enough.  This also allows moving ctl->long_options_nr
increment to more appropriate location.

CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:02 +00:00
Sami Kerola 80dd38e9fb getopt: change --shell argument parsing function
Avoid passing getopt_control stucture in when returning a value is enough.

CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:01 +00:00
Sami Kerola bb742d7352 getopt: prefer switch-case rather than long if statement
And avoid testing same thing time after time.

CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:01 +00:00
Sami Kerola 0640689c20 getopt: remove unnecessary code
The control structure is initialized in main().

CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:01 +00:00
Sami Kerola eba520d824 getopt: make normalize() print strings
A change towards less indirection, and a change to free allocated memory.

CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:01 +00:00
Sami Kerola 05ac43f5f8 getopt: use xstrdup rather than malloc + strcpy
CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:01 +00:00
Sami Kerola 1dacc901ec getopt: add struct getopt_control and remove global variables
CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:00 +00:00
Sami Kerola 5f69b38c5e getopt: remove function prototypes
Functions are in right order so they do not need prototypes, with effect
of not needing to keep function argument changes in sync in two locations.

CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:00 +00:00
Sami Kerola d01f47f6f5 getopt: make nonoptions optstring comment correct
From manual page: 'If the first character of optstring is '-', then each
nonoption argv-element is handled as if it were the argument of an option
with character code 1.'

Reference: http://man7.org/linux/man-pages/man3/getopt.3.html
CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:00 +00:00
Sami Kerola b5f3078e14 getopt: sync with 1.1.6 release
Reference: http://www.spinics.net/lists/util-linux-ng/msg10556.html
CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-08 20:07:00 +00:00
Karel Zak 7f14ee1b55 lsblk: add SUBSYSTEMS column
$ lsblk -oNAME,SIZE,TYPE,SUBSYSTEMS /dev/sr0
 NAME  SIZE TYPE SUBSYSTEMS
 sr0   7.8M rom  block:scsi:usb:pci

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-02 11:38:15 +01:00
Karel Zak 483987c275 lsblk: add HOTPLUG column
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-02 11:09:04 +01:00
Karel Zak 89e90ae7b2 libblkid: care about unsafe chars in cache
The high-level libblkid API uses /run/blkid/blkid.tab cache to
store probing results. The cache format is

   <device NAME="value" ...>devname</device>

and unfortunately the cache code does not escape quotation marks:

   # mkfs.ext4 -L 'AAA"BBB'

   # cat /run/blkid/blkid.tab
   ...
   <device ... LABEL="AAA"BBB" ...>/dev/sdb1</device>

such string is later incorrectly parsed and blkid(8) returns
nonsenses. And for use-cases like

   # eval $(blkid -o export /dev/sdb1)

it's also insecure.

Note that mount, udevd and blkid -p are based on low-level libblkid
API, it bypass the cache and directly read data from the devices.

The current udevd upstream does not depend on blkid(8) output at all,
it's directly linked with the library and all unsafe chars are encoded by
\x<hex> notation.

   # mkfs.ext4 -L 'X"`/tmp/foo` "' /dev/sdb1
   # udevadm info --export-db | grep LABEL
   ...
   E: ID_FS_LABEL=X__/tmp/foo___
   E: ID_FS_LABEL_ENC=X\x22\x60\x2ftmp\x2ffoo\x60\x20\x22

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-27 13:39:35 +01:00
Karel Zak 9b825f8194 blkid: add hint about lsblk to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-19 14:43:38 +01:00
Nikolay Sivov 570a930014 uuidd: Fixed a typo in daemon logging message
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2014-11-18 14:14:47 +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 68e422ecae docs: update info about env debug variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:54 +01:00
Bernhard Voelker 169b85c9f2 findmnt: document --uniq option in man page
* misc-utils/findmnt.8: Add an entry for the -U, --uniq option
added in commit v2.24-132-gbebdda3.
2014-10-31 10:39:21 +01:00