Commit Graph

5951 Commits

Author SHA1 Message Date
Andy Lutomirski 5600c405d5 setpriv: run a program with different Linux privilege settings
This new command can set no_new_privs, uid, gid, groups, securebits,
inheritable caps, the cap bounding set, securebits, and selinux and
apparmor labels.

[kerolasa@iki.fi: a lot of small adjustment making the command to be good
fit to util-linux project]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2013-02-05 10:35:33 +01:00
Karel Zak cd0fe5c165 libblkid: add blkid_probe_step_back()
It seems that blkid_do_probe() is too high-level solution for some
mkfs programs (for example ext4 mkfs supports "undo" so all write
operations has to be implemented by filesystem specific functions).

The new function blkid_probe_step_back() resets internal libblkid
buffers and move probing stuff one step back. It means that the
previously used probing function will be called again in the next
blkid_do_probe() call. This allows to modify on-disk data and check
for backup superblocks or alternative magic strings. Something like:

  while (blkid_do_probe(pr) == 0) {
    ... get SBMAGIC_OFFSET and SBMAGIC len ...
    ... use your private seek & write() ...

    blkid_probe_step_back(pr);
  }

References: https://bugzilla.redhat.com/show_bug.cgi?id=902512
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-04 11:28:09 +01:00
Karel Zak 19a1ca6c0d newgrp: more robust crypt() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-01 18:00:52 +01:00
Karel Zak 6a0766444d libblkid: remove optimization from verify( funrtion
Now libblkid (the cache based part) tries to probe for the cached
filesystem firstly. This optimization is broken, because:

  * new another superblock could be on the device and the original
    is already obsolete
  * we still need to probe for partitions and raids
  * the code was too fragile

The patch also suggests lsblk --fs in blkid.8 for end users. lsblk
read information from used db.

Reported-by: Andreas Hofmeister <andi@collax.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-01 15:59:58 +01:00
Benno Schulenberg b548a8c989 textual: improve an error message and a help text
* disk-utils/isosize.c: Improve grammar of error message, and in the
help text make use of the standard angular brackets for arguments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 16:06:23 +01:00
Benno Schulenberg 0429455ab6 textual: gettextize an overlooked string
* login-utils/islocal.c: Gettexttize the usage message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 16:06:23 +01:00
Karel Zak 2be4015b4d fstrim: remove unnecessary "were" from verbose message
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-30 15:59:58 +01:00
Karel Zak 1429557b06 mount: remove ext4 journal=update from man page
It's already unsupported.

References: http://patchwork.ozlabs.org/patch/123291/
Reported-by: Roman Žilka <roman.zilka@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-30 15:53:39 +01:00
Benno Schulenberg 2e1d40c63f textual: fix the example in whereis man page, plus further improvements
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:41:20 +01:00
Karel Zak 0a86a1a66c dmesg: fix usage() 2013-01-30 15:36:21 +01:00
Karel Zak 2e4c5b48b6 fsck: add "--" to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-30 15:29:12 +01:00
Benno Schulenberg c6f095cf59 textual: slice the help text of lscpu into strips, for translators
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:24:03 +01:00
Benno Schulenberg 0ae6331543 textual: slice the help text of fsck into strips, for translators
Also improve the descriptions a bit and alphabetize the options.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:24:02 +01:00
Benno Schulenberg 0c6625a15d textual: standardize the reporting of program name plus package version
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:24:00 +01:00
Benno Schulenberg 4ec32f6a89 mkfs: indicate that specifying fs-type and fs-options are independent
Also standardize and improve the help text, and slice it into strips
for ease of later translation maintenance.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:59 +01:00
Benno Schulenberg 7ff986d328 doc: remove incorrect spaces from lscpu synopsis in manpage
Also normalize text spacing and add some formatting.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:56 +01:00
Benno Schulenberg 52f63b29ac lscpu: correct the description of --sysroot in help text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:54 +01:00
Benno Schulenberg de8f54834e fsck: mark file descriptor for -C as optional in help text
Also slightly improve the man page.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:51 +01:00
Benno Schulenberg 4e0968018b textual: tiny tweaks of some error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:49 +01:00
Benno Schulenberg ff21848c64 mkswap: properly pluralize the bad-pages message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:45 +01:00
Benno Schulenberg 9e53140075 agetty: properly pluralize the reporting of the number of users
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:23:42 +01:00
Karel Zak e69f2b0c1a fdisk: add support for the Xtensa architecture
Based on patch from Chris Zankel <chris@zankel.net>.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-30 15:18:22 +01:00
Karel Zak fe98b1805f fstrim: use human readable sizes in verbose output
# fstrim -v /home
  /home: 513.9 MiB (538828800 bytes) were trimmed

Reported-by: member graysky <graysky@archlinux.us>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-28 09:25:08 +01:00
Sami Kerola 3eed42f342 column: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola 7d36855604 agetty: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola 010f618285 unshare: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola 83d9110053 umount: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola 59a4ed117c losetup: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola c2f0a85671 hwclock: make usage() change translator friendly
The --compare option from 83765871ef is
made to be separate fputs() line.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola fbbc4c88d5 dmesg: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola 540dfebe3e rename: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Sami Kerola 39b232c169 lsblk: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +01:00
Sami Kerola ff2bd506db findmnt: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +01:00
Sami Kerola 09f5902e1e su-common: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +01:00
Sami Kerola b7e785edaf partx: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +01:00
Sami Kerola 26f879edf5 nsenter: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +01:00
Sami Kerola 24f109e342 docs: usage function and gettext
I made following survey which was sent to all email addresses in po/
directory that had the on-going millenium as time when translator had
been active.

  There are two quite common styles to write a command usage print out,
  which one you prefer?

  1. Each option as separated translatable string.	18 votes
  2. Or the whole thing as one big output.		 1 vote
  3. No preference.					 1 vote

The questionaire had also free text field asking 'Why do you prefer
that?', and here are the answers.

  [Separately] It is easier to follow changes with the translations.  If
  you change only one line or two, the big string would change to fuzzy
  and I have to check the whole thing to see what was changed in the
  original.  If the changed line is a single string, the string to check
  is a lot shorter.

  [No preference] Usually, if there is no reason to separate strings,
  better keep them together so that the context is obvious.  In the case at
  hand, it might help if in some language e.g.  one translated line is too
  wide for the screen.  This is unlikely, but...  OTOH, with this solution,
  if you change one string the whole translation will be discarded until a
  translator comes and updates it...

  [Separately] It may be a bit harder to get the formatting right, but it
  is much easier in maintenance.  With one option changing, the
  translator immediately sees the spot.  And even with a lazy translator,
  program author will have all the options translated that have not
  changed at all.

  [Separately] First one would be more in elegant I believe

  [Separately] I prefer to have them separately because they don't form a
  single text paragraph.  In other words, they can be translated
  separately because they are complete and separate "sentences".  Of
  course consistency of format and word choices need to be taken care of,
  but the fact that the messages appear next to each other in the PO file
  should be enough.  Also if the options are not translated separately,
  adding or editing one option causes the translation of all options to
  become fuzzy and if for some reason it isn't checked before next
  release (happens sometimes), all of them will show untranslated to the
  user.

  [Separately] Translations are a lot easier to update that way.  If an
  option is added, removed or changed, only a small amount of text
  becomes fuzzy.  If everything is in one big output, a lot of text
  becomes fuzzy, and you have to read a lot more text to discover what
  exactly changed.

  [Separately] When updating a fuzzy translation, with one big output
  it's very tedious and error-prone to find out the reason for fuzziness,
  i.e.  what actually has changed in the msgid.

  [Separately] Way easier to translate, and especially to spot
  translation updates when one string gets removed, added or modified.

  [Separately] Makes translation memory more efficient.  Some hard terms
  in the list don't prevent translation of the whole block.  Actually the
  beginning of the strings don't need any translation ta all before []
  part.  Information about the context can be provided in comments or the
  context parameter.

  [Separately] Please consider the case when a part of string, (= msgid)
  is changed.  It is marked as fuzzy in the .po files, we translators
  have to check whole sentences for the difference between it and
  previous version.

  [Separately] Every sentence must be a separate translation unit.

  [One big output] for performance to ouput strings

  [Separately] In the second case, if only one option changes (or a new
  one is added), the translator will see as if all of the options
  changed, having to find out which one of them is really new or has
  actually changed.  Also, if the translator has had no time to update
  the string, only one of the options will be shown in the original
  language (which is arguably ugly, but better than nothing for many
  users).

  [Separately] It's easier to translate the options separately using
  translation memory.

  [Separately] Easier to separate and see changes

  [Separately] more translator friendly

  [Separately] From the user POV I found the separeted version more
  interesting because if a maintainer can't update the translation fast
  enough between releases the user will still get the current translated
  string with the new ones untraslated.  From the translator POV the big
  output will give more context information as one can see the whole
  command options.  With a new string added while the rest is translated
  having some context can be more difficult.

  [Separately] Additions to the list or changes to one options means you
  don't have to check all lines each time.

So unless you have very, _very_ good reason you should not output all
usage as one big table.  This implies also that when large usage output
is changed it should be split to small hunks.  That may be a bit more
work once, but the next change will pay the extrawork off so never
hesitate when splitting.

Reference: http://www.surveymonkey.com/s/QKZ75HK
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:38:49 +01:00
Zbigniew Jędrzejewski-Szmek 57dbcf94d8 nsenter: respect --exec no matter where it appears
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25 16:32:01 +01:00
Sami Kerola 08e86f4c2c docs: align nsenter.1 man page with howto-man-page.txt
Most visible change; the --target option has a path - explanation table
instead a long paragraph.  This makes pairing of the information easier
for an average user such as me.

The rest of the changes are about aligning with howto, i.e., fix spaces
after dots, URL & mail address macros, remove inline emphasis where
possible, mark directory paths and words with underscore to be line
breakable, use optional option syntax from howto, cut line lenght to 80
chars.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 15:49:51 +01:00
Sami Kerola a167328a74 nsenter: fix indentation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 15:42:11 +01:00
Sami Kerola dfd8b1171b nsenter: drop core when impossible happens
Message to user is less informative, but impossible events should be
rare so core files are much appriciated for these cases.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 15:41:00 +01:00
Sami Kerola 9905912fa7 nsenter: fix compiler warning
nsenter.c:53:2: warning: ISO C forbids empty initializer braces [-pedantic]

[kzak@redhat.com: - use initialize .fd to -1]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25 15:38:36 +01:00
Sami Kerola 8b7a7750dd nsenter: adjust few error messages
The 'neither filename nor target' is changed to use errx() rather than
err(), because the errno is indicating success at the time of fatal error
which is wrong message for an user.

The "cannot open %s" is same string as in other files, making translators
to work less.

Remaining changes aim to ease understanding what went wrong for a
non-programmer audience.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 15:37:22 +01:00
Sami Kerola a4c8fe7b8c build-sys: add nsenter to gitignore
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 15:37:20 +01:00
Zbigniew Jędrzejewski-Szmek 28384adc60 nsenter: rename --exec/-e to --no-fork/-F
The naming of this option was really confusing.
Just rename it for clarity.

[kzak@redhat.com: rebase to original code without --all]

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25 15:32:35 +01:00
Zbigniew Jędrzejewski-Szmek 984e1b7ce9 nsenter: allow arguments to be specified in any order
Allows 'nsenter -mt $PID', which would fail previously.

[kzak@redhat.com: - fix open_target_fd() arguments]

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25 15:13:39 +01:00
Karel Zak e421313dc2 textual: use UTIL_LINUX_VERSION everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25 12:05:26 +01:00
Benno Schulenberg 5cc224f552 renice: accept also -V for --version, and document it
Also improve the man page.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:33 +01:00
Benno Schulenberg ae3ca2aacc renice: correct the usage synopsis, and improve help text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:30 +01:00
Benno Schulenberg 217615e8ed textual: standardize reporting of program name plus package version
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:29 +01:00