]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoImplement mempcpy() in terms of memcpy() if mempcpy() is unavailable
Daniel Trebbien [Wed, 30 Jan 2013 23:49:08 +0000 (18:49 -0500)] 
Implement mempcpy() in terms of memcpy() if mempcpy() is unavailable

12 years agotextual: improve an error message and a help text
Benno Schulenberg [Sat, 26 Jan 2013 22:21:07 +0000 (23:21 +0100)] 
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>
12 years agotextual: gettextize an overlooked string
Benno Schulenberg [Sat, 26 Jan 2013 22:17:38 +0000 (23:17 +0100)] 
textual: gettextize an overlooked string

* login-utils/islocal.c: Gettexttize the usage message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agofstrim: remove unnecessary "were" from verbose message
Karel Zak [Wed, 30 Jan 2013 14:59:58 +0000 (15:59 +0100)] 
fstrim: remove unnecessary "were" from verbose message

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: remove ext4 journal=update from man page
Karel Zak [Wed, 30 Jan 2013 14:53:39 +0000 (15:53 +0100)] 
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>
12 years agotextual: fix the example in whereis man page, plus further improvements
Benno Schulenberg [Mon, 21 Jan 2013 22:01:09 +0000 (23:01 +0100)] 
textual: fix the example in whereis man page, plus further improvements

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agodmesg: fix usage()
Karel Zak [Wed, 30 Jan 2013 14:36:21 +0000 (15:36 +0100)] 
dmesg: fix usage()

12 years agofsck: add "--" to usage()
Karel Zak [Wed, 30 Jan 2013 14:29:12 +0000 (15:29 +0100)] 
fsck: add "--" to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotextual: slice the help text of lscpu into strips, for translators
Benno Schulenberg [Wed, 23 Jan 2013 13:50:02 +0000 (14:50 +0100)] 
textual: slice the help text of lscpu into strips, for translators

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: slice the help text of fsck into strips, for translators
Benno Schulenberg [Wed, 23 Jan 2013 13:16:18 +0000 (14:16 +0100)] 
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>
12 years agotextual: standardize the reporting of program name plus package version
Benno Schulenberg [Wed, 23 Jan 2013 12:48:50 +0000 (13:48 +0100)] 
textual: standardize the reporting of program name plus package version

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agomkfs: indicate that specifying fs-type and fs-options are independent
Benno Schulenberg [Tue, 22 Jan 2013 10:56:58 +0000 (11:56 +0100)] 
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>
12 years agodoc: remove incorrect spaces from lscpu synopsis in manpage
Benno Schulenberg [Tue, 22 Jan 2013 10:13:07 +0000 (11:13 +0100)] 
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>
12 years agolscpu: correct the description of --sysroot in help text
Benno Schulenberg [Tue, 22 Jan 2013 09:57:52 +0000 (10:57 +0100)] 
lscpu: correct the description of --sysroot in help text

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agofsck: mark file descriptor for -C as optional in help text
Benno Schulenberg [Tue, 22 Jan 2013 09:26:31 +0000 (10:26 +0100)] 
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>
12 years agotextual: tiny tweaks of some error messages
Benno Schulenberg [Tue, 22 Jan 2013 09:08:03 +0000 (10:08 +0100)] 
textual: tiny tweaks of some error messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agomkswap: properly pluralize the bad-pages message
Benno Schulenberg [Tue, 22 Jan 2013 08:49:59 +0000 (09:49 +0100)] 
mkswap: properly pluralize the bad-pages message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agoagetty: properly pluralize the reporting of the number of users
Benno Schulenberg [Tue, 22 Jan 2013 08:36:01 +0000 (09:36 +0100)] 
agetty: properly pluralize the reporting of the number of users

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agofdisk: add support for the Xtensa architecture
Karel Zak [Wed, 30 Jan 2013 14:18:22 +0000 (15:18 +0100)] 
fdisk: add support for the Xtensa architecture

Based on patch from Chris Zankel <chris@zankel.net>.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofstrim: use human readable sizes in verbose output
Karel Zak [Mon, 28 Jan 2013 08:25:08 +0000 (09:25 +0100)] 
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>
12 years agocolumn: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:13 +0000 (23:27 +0000)] 
column: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoagetty: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:12 +0000 (23:27 +0000)] 
agetty: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agounshare: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:11 +0000 (23:27 +0000)] 
unshare: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoumount: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:10 +0000 (23:27 +0000)] 
umount: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolosetup: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:09 +0000 (23:27 +0000)] 
losetup: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agohwclock: make usage() change translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:08 +0000 (23:27 +0000)] 
hwclock: make usage() change translator friendly

The --compare option from 83765871ef0d6c554c46027577648b77c7351a78 is
made to be separate fputs() line.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodmesg: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:07 +0000 (23:27 +0000)] 
dmesg: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agorename: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:06 +0000 (23:27 +0000)] 
rename: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolsblk: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:05 +0000 (23:27 +0000)] 
lsblk: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agofindmnt: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:04 +0000 (23:27 +0000)] 
findmnt: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agosu-common: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:03 +0000 (23:27 +0000)] 
su-common: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopartx: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:02 +0000 (23:27 +0000)] 
partx: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agonsenter: make usage() translator friendly
Sami Kerola [Tue, 22 Jan 2013 23:27:01 +0000 (23:27 +0000)] 
nsenter: make usage() translator friendly

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: usage function and gettext
Sami Kerola [Tue, 22 Jan 2013 23:27:00 +0000 (23:27 +0000)] 
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>
12 years agonsenter: respect --exec no matter where it appears
Zbigniew Jędrzejewski-Szmek [Fri, 25 Jan 2013 15:32:01 +0000 (16:32 +0100)] 
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>
12 years agodocs: align nsenter.1 man page with howto-man-page.txt
Sami Kerola [Sun, 20 Jan 2013 18:04:51 +0000 (18:04 +0000)] 
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>
12 years agonsenter: fix indentation
Sami Kerola [Sun, 20 Jan 2013 18:04:56 +0000 (18:04 +0000)] 
nsenter: fix indentation

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agonsenter: drop core when impossible happens
Sami Kerola [Sun, 20 Jan 2013 18:04:55 +0000 (18:04 +0000)] 
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>
12 years agonsenter: fix compiler warning
Sami Kerola [Sun, 20 Jan 2013 18:04:54 +0000 (18:04 +0000)] 
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>
12 years agonsenter: adjust few error messages
Sami Kerola [Sun, 20 Jan 2013 18:04:53 +0000 (18:04 +0000)] 
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>
12 years agobuild-sys: add nsenter to gitignore
Sami Kerola [Sun, 20 Jan 2013 18:04:52 +0000 (18:04 +0000)] 
build-sys: add nsenter to gitignore

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agonsenter: rename --exec/-e to --no-fork/-F
Zbigniew Jędrzejewski-Szmek [Mon, 21 Jan 2013 06:38:05 +0000 (01:38 -0500)] 
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>
12 years agonsenter: allow arguments to be specified in any order
Zbigniew Jędrzejewski-Szmek [Mon, 21 Jan 2013 06:38:01 +0000 (01:38 -0500)] 
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>
12 years agotextual: use UTIL_LINUX_VERSION everywhere
Karel Zak [Fri, 25 Jan 2013 11:05:26 +0000 (12:05 +0100)] 
textual: use UTIL_LINUX_VERSION everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agorenice: accept also -V for --version, and document it
Benno Schulenberg [Mon, 6 Feb 2012 16:48:25 +0000 (17:48 +0100)] 
renice: accept also -V for --version, and document it

Also improve the man page.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agorenice: correct the usage synopsis, and improve help text
Benno Schulenberg [Mon, 6 Feb 2012 15:44:23 +0000 (16:44 +0100)] 
renice: correct the usage synopsis, and improve help text

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: standardize reporting of program name plus package version
Benno Schulenberg [Mon, 6 Feb 2012 15:37:16 +0000 (16:37 +0100)] 
textual: standardize reporting of program name plus package version

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: gettextize several overlooked messages
Benno Schulenberg [Mon, 6 Feb 2012 15:11:27 +0000 (16:11 +0100)] 
textual: gettextize several overlooked messages

Also improve the clarity of some of them.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: tag two bug messages as "internal error"
Benno Schulenberg [Mon, 6 Feb 2012 15:05:35 +0000 (16:05 +0100)] 
textual: tag two bug messages as "internal error"

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: remove inconsistent periods from two error messages
Benno Schulenberg [Mon, 6 Feb 2012 15:04:33 +0000 (16:04 +0100)] 
textual: remove inconsistent periods from two error messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: fix a few typos in some of the usage help texts
Benno Schulenberg [Mon, 6 Feb 2012 15:01:48 +0000 (16:01 +0100)] 
textual: fix a few typos in some of the usage help texts

Also improve clarity of some other lines of those texts.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotests: sort commands strings
Sami Kerola [Sat, 19 Jan 2013 00:09:11 +0000 (00:09 +0000)] 
tests: sort commands strings

The list is starting to be long enough that making any order to it seems
like right thing to do.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add ipcmk(1) and ipcrm(1) checks
Sami Kerola [Sat, 19 Jan 2013 00:09:10 +0000 (00:09 +0000)] 
tests: add ipcmk(1) and ipcrm(1) checks

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodmesg: parse level when --color is used
Sami Kerola [Sat, 19 Jan 2013 00:09:09 +0000 (00:09 +0000)] 
dmesg: parse level when --color is used

When user runs with --color it should not need to be combined with
filtering per level or facility, or decoding.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add whereis(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:08 +0000 (00:09 +0000)] 
tests: add whereis(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add isosize(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:07 +0000 (00:09 +0000)] 
tests: add isosize(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: mkswap.8: recommend fallocate(1)
Sami Kerola [Sat, 19 Jan 2013 00:09:06 +0000 (00:09 +0000)] 
docs: mkswap.8: recommend fallocate(1)

There is no reason why fallocate(1) should not be preferred instead of
'dd if=/dev/zero of=swapfile' with it's cumbersome size spec.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add fallocate(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:05 +0000 (00:09 +0000)] 
tests: add fallocate(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add setarch(8) check
Sami Kerola [Sat, 19 Jan 2013 00:09:04 +0000 (00:09 +0000)] 
tests: add setarch(8) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add setsid(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:03 +0000 (00:09 +0000)] 
tests: add setsid(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodmesg: add boundary check to facility & level array usage
Sami Kerola [Sat, 19 Jan 2013 00:09:02 +0000 (00:09 +0000)] 
dmesg: add boundary check to facility & level array usage

The dmesg should not crash while --decode'ing message facilities and
levels to readable string even if the values are out of bounds.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add dmesg(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:01 +0000 (00:09 +0000)] 
tests: add dmesg(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add line(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:00 +0000 (00:09 +0000)] 
tests: add line(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add more(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:59 +0000 (00:08 +0000)] 
tests: add more(1) check

[kzak@redhat.com: use test_more program rather than directly more(1)]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomore: allow to compile as non-interactive test_more program
Karel Zak [Thu, 24 Jan 2013 18:27:12 +0000 (19:27 +0100)] 
more: allow to compile as non-interactive test_more program

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add --disable-{more,ul,pg}
Karel Zak [Thu, 24 Jan 2013 18:23:56 +0000 (19:23 +0100)] 
build-sys: add --disable-{more,ul,pg}

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: support list of variables for UL_REQUIRES_HAVE macro
Karel Zak [Thu, 24 Jan 2013 18:22:40 +0000 (19:22 +0100)] 
build-sys: support list of variables for UL_REQUIRES_HAVE macro

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add ionice(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:57 +0000 (00:08 +0000)] 
tests: add ionice(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add ul(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:56 +0000 (00:08 +0000)] 
tests: add ul(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add tailf(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:55 +0000 (00:08 +0000)] 
tests: add tailf(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add mcookie(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:54 +0000 (00:08 +0000)] 
tests: add mcookie(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add getopt(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:53 +0000 (00:08 +0000)] 
tests: add getopt(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add utmpdump(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:52 +0000 (00:08 +0000)] 
tests: add utmpdump(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add rev(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:51 +0000 (00:08 +0000)] 
tests: add rev(1) check

Fairly lenghty input line tries to ensure realloc segment in code is hit
at least once.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: add gcov files to .gitignore
Sami Kerola [Sat, 19 Jan 2013 00:08:50 +0000 (00:08 +0000)] 
build-sys: add gcov files to .gitignore

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoinclude: add missing values to sysfs_cxt initializer definition
Sami Kerola [Wed, 9 Jan 2013 19:36:56 +0000 (19:36 +0000)] 
include: add missing values to sysfs_cxt initializer definition

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcmk: use random_get_bytes() to generate IPC keys
Karel Zak [Thu, 24 Jan 2013 15:27:04 +0000 (16:27 +0100)] 
ipcmk: use random_get_bytes() to generate IPC keys

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agocal: don't mix ncurses output functions and printf()
Karel Zak [Thu, 17 Jan 2013 17:48:16 +0000 (18:48 +0100)] 
cal: don't mix ncurses output functions and printf()

Fedora 18 (ncurses-libs-5.9-7.20121017, glibc-2.16-28):

$ cal | cat
Actual results:
    January 2013    Su Mo Tu We Th Fr Sa       1  2  3  4  5 6  7  8
9 10 11 1213 14 15 16 17 18 1920 21 22 23 24 25 2627 28 29 30 31

Not sure where is the problem, but it's too fragile to mix two
output methods in one code.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=896447
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonsenter: improve optional args in usage() and man page
Karel Zak [Thu, 17 Jan 2013 12:30:33 +0000 (13:30 +0100)] 
nsenter: improve optional args in usage() and man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agounshare,nsenter: Move the old libc handling into a common header namespace.h
Eric W. Biederman [Thu, 17 Jan 2013 00:36:32 +0000 (16:36 -0800)] 
unshare,nsenter: Move the old libc handling into a common header namespace.h

Move the defitions of CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC,
CLONE_NEWNET, CLONE_NEWUSER, CLONE_NEWPID into namespace.h in case
sched.h does not provide those definitions.  Are there systems
around that are old enough that still need this?

Move the definitions of unshare() and setns() into namespace.h
for supporting old versions of libc that does not provice these.
I have tested this support with setns as I still have systems
old enough that glibc does not wrap setns.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Replace a bare strtoul with strtoul_or_err
Eric W. Biederman [Thu, 17 Jan 2013 00:35:53 +0000 (16:35 -0800)] 
nsenter: Replace a bare strtoul with strtoul_or_err

This is shorter code and makes things a bit clearer and less
error prone if anyone happens to copy the code.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Add const to declarations where possible.
Eric W. Biederman [Thu, 17 Jan 2013 00:35:12 +0000 (16:35 -0800)] 
nsenter: Add const to declarations where possible.

Make it clear where functions do not modify their arguments.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Properly spell significant in a comment.
Eric W. Biederman [Thu, 17 Jan 2013 00:34:44 +0000 (16:34 -0800)] 
nsenter: Properly spell significant in a comment.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Enhance waiting for a child process
Eric W. Biederman [Thu, 17 Jan 2013 00:34:17 +0000 (16:34 -0800)] 
nsenter: Enhance waiting for a child process

In the case of a pid namespace we need to fork a child process instead
of calling exec.  Move all of that logic out of line into a function
continue_as_child, making the logic of the primary case easier to
understand.

Update the logic for waiting for a child process to suspend ourselves
when the child processes suspends and to continue the child process
when we are unsuspsended.  This supports the bash suspend command and
various editors that suspend themselves.

If the child process exits with a signal update the logic to run
kill(getpid(), WTERMSIG(status)) so the caller sees the same exit code
that nsenter observed.

There will always be permission to send signals to our children and
the tty is not changing so there is no need for the intermediate
process to forward signals to it's child.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agounshare: Add support for the pid and user namespaces
Eric W. Biederman [Fri, 11 Jan 2013 22:53:34 +0000 (14:53 -0800)] 
unshare: Add support for the pid and user namespaces

- Update the unshare application to support the pid and user namespaces.
- Update the man page for the new options
- Fix typo in the man page where UTS was spelled UTC.
- Remove the vestigal support for running a suid unshare.
  After unsharing a user namespace setuid(getuid()) won't work because
  no uid or gid mappings have been specified yet. So it is just easier not
  to have any support for running suid.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: new command (light wrapper around setns)
Eric W. Biederman [Fri, 11 Jan 2013 22:46:38 +0000 (14:46 -0800)] 
nsenter: new command (light wrapper around setns)

Inspired by unshare, nsenter is a simple wrapper around setns that
allows running a new process in the context of an existing process.

Full paths may be specified to the namespace arguments so that
namespace file descriptors may be used wherever they reside in the
filesystem.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agoRevert "unshare: support the switching of namespaces"
Karel Zak [Thu, 17 Jan 2013 12:00:44 +0000 (13:00 +0100)] 
Revert "unshare: support the switching of namespaces"

The functionality will be replaced with nsenter from Eric W.
Biederman.

This reverts commit 4bbe8099390d528018890efa914e268de3c4b44b.

12 years agofindmnt: use tree output in more cases
Karel Zak [Thu, 17 Jan 2013 11:02:03 +0000 (12:02 +0100)] 
findmnt: use tree output in more cases

It seems that we can create the tree also if output is restricted by
fstype or options filter, for example

$ findmnt -t cgroups

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: make --verbose more verbose about propagation
Karel Zak [Tue, 15 Jan 2013 15:09:07 +0000 (16:09 +0100)] 
mount: make --verbose more verbose about propagation

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: keep MS_PROPAGATION flags in mnt_context_set_mflags() result
Karel Zak [Tue, 15 Jan 2013 15:08:41 +0000 (16:08 +0100)] 
libmount: keep MS_PROPAGATION flags in mnt_context_set_mflags() result

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: write success messages to stdout
Karel Zak [Tue, 15 Jan 2013 14:53:46 +0000 (15:53 +0100)] 
mount: write success messages to stdout

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add/improve mount shared-subtree tests
Karel Zak [Tue, 15 Jan 2013 13:25:23 +0000 (14:25 +0100)] 
tests: add/improve mount shared-subtree tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: support multiple MS_PROPAGATION flags in one mount(8) exec
Karel Zak [Tue, 15 Jan 2013 13:23:54 +0000 (14:23 +0100)] 
mount: support multiple MS_PROPAGATION flags in one mount(8) exec

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: allow to use propagation flags in fstab
Karel Zak [Tue, 15 Jan 2013 12:55:29 +0000 (13:55 +0100)] 
libmount: allow to use propagation flags in fstab

Linux kernel does not allow to change more than one propagation flag
by one mount(2) syscall. The flags also cannot be mixed with another
mount options. It means that the propagation flags cannot be stored in
/etc/fstab, manual "mount --make-* <mountpoint>" is always necessary
after successful mount. Painful...

This patch implements additional mount(2) after previous successful
mount(2) (or exec /sbin/mount.<type>).

For example:

  mount /dev/sda1 /A -o private,unbindable,ro

or fstab entry:

  /dev/sda1   /A  auto  ro,private,unbindable

is implemented by three mount(2) calls:

- 1st mounts /dev/sda1 with MS_RDONLY
- 2nd sets MS_PRIVATE flag
        - 3rd sets MS_UNBINDABLE flag.

It's the same as as to manually call:

  mount /dev/sda1 /A -o ro
  mount --make-private /A
  mount --make-unbindable /A

This solution is not atomic, and umount(2) is not called if
propagation flags are not successfully applied, only error is
returned.

This change does not affect libmount API, so one beautiful day when
mount(2) syscall will be improved we can drop this nasty patch.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agokill: add note about threads to the man page
Karel Zak [Tue, 15 Jan 2013 10:14:03 +0000 (11:14 +0100)] 
kill: add note about threads to the man page

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=846790
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: make --target usable with bind mounts
Karel Zak [Mon, 14 Jan 2013 13:50:50 +0000 (14:50 +0100)] 
findmnt: make --target usable with bind mounts

The --target <non-mount-point> functionality should be enabled only if
previous regular search found nothing to avoid collisions with bind
mounts, because to detect mountpoint we use traditional child / parent
stat.st_dev comparison which does not work for bind mounts (--bind /A
/A).

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add PROPAGATION column
Karel Zak [Thu, 10 Jan 2013 14:59:16 +0000 (15:59 +0100)] 
findmnt: add PROPAGATION column

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add mnt_fs_get_propagation()
Karel Zak [Thu, 10 Jan 2013 14:58:52 +0000 (15:58 +0100)] 
libmount: add mnt_fs_get_propagation()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add ID column
Karel Zak [Thu, 10 Jan 2013 13:59:39 +0000 (14:59 +0100)] 
findmnt: add ID column

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add OPT-FIELDS column
Karel Zak [Thu, 10 Jan 2013 13:58:05 +0000 (14:58 +0100)] 
findmnt: add OPT-FIELDS column

Signed-off-by: Karel Zak <kzak@redhat.com>