Commit Graph

845 Commits

Author SHA1 Message Date
Bernhard Voelker 9b4257c8b3 mount: fix bind mount success message
* sys-utils/mount.c (success_message): s/binded/bound/.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2013-02-06 11:12:46 +01:00
Benno Schulenberg d38a30a3e0 docs: improve wording, formatting and accuracy of ipcs man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-02-06 10:56:49 +01:00
Benno Schulenberg fa03fa051a ipcs: report an error when -i is used with multiple resources
Also put everything in POSIX order: queues, memory, sempahores.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-02-06 10:54:39 +01:00
Karel Zak 59c68b4368 setpriv: move paths to pathnames.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-05 11:48:55 +01:00
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 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
Karel Zak 0a86a1a66c dmesg: fix usage() 2013-01-30 15:36:21 +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 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 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
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 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 26f879edf5 nsenter: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +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
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
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
Benno Schulenberg 8c219bf463 textual: gettextize several overlooked messages
Also improve the clarity of some of them.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:29 +01:00
Benno Schulenberg 48899b9eae textual: remove inconsistent periods from two error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:27 +01:00
Sami Kerola bb9013177c 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>
2013-01-25 10:29:37 +01:00
Sami Kerola ae6288da84 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>
2013-01-25 10:09:36 +01:00
Karel Zak 96f6ad889b ipcmk: use random_get_bytes() to generate IPC keys
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-24 16:27:04 +01:00
Karel Zak 620d3f2dc7 nsenter: improve optional args in usage() and man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-17 13:30:33 +01:00
Eric W. Biederman c91280a4bd 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>
2013-01-17 13:18:08 +01:00
Eric W. Biederman 0d3ec8603b 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>
2013-01-17 13:17:50 +01:00
Eric W. Biederman f9bbdea6e1 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>
2013-01-17 13:17:45 +01:00
Eric W. Biederman ebbc87cdea nsenter: Properly spell significant in a comment.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2013-01-17 13:17:40 +01:00
Eric W. Biederman c9515f86d4 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>
2013-01-17 13:17:35 +01:00
Eric W. Biederman bc7f9b95c0 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>
2013-01-17 13:17:32 +01:00
Eric W. Biederman f8aa8e9495 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>
2013-01-17 13:17:13 +01:00
Karel Zak ef6acdb81c Revert "unshare: support the switching of namespaces"
The functionality will be replaced with nsenter from Eric W.
Biederman.

This reverts commit 4bbe809939.
2013-01-17 13:00:44 +01:00
Karel Zak b4ec4573df mount: make --verbose more verbose about propagation
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-15 16:09:07 +01:00
Karel Zak f5ae1d706e mount: write success messages to stdout
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-15 15:53:46 +01:00
Karel Zak be6904b92f mount: support multiple MS_PROPAGATION flags in one mount(8) exec
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-15 14:23:54 +01:00
Ondrej Oprala 701c69617e mount: add support for x-mount.mkdir[=<mode>] option
If the target directory (mountpoint) does not exist then mount(8) will create
it before mount.<type> is executed or mount(2) syscall is called.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-09 18:52:32 +01:00
Karel Zak f3242e065a mount: document x-* options
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-09 15:41:46 +01:00
Richard Tollerton 1707b9b104 mount: Fix -t in listing mode when run as non-root
Presently, libmount-mount completely prohibits the use of -t by non-root
users.  This breaks using -t in listing mode as a user, which represents
a regression against mount-deprecated, macosx and presumably *BSD.

This commit fixes the issue by deferring the mnt_context_is_restricted
check for -t until we know we're not in listing mode.

Signed-off-by: Rich Tollerton <rich.tollerton@ni.com>
2013-01-09 14:47:25 +01:00