Commit graph

36 commits

Author SHA1 Message Date
Michael Kerrisk
a4b3be3272 Manual pages: nsenter.1: note that 'file' can be a bind mount
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk
afbe4f3455 Manual pages: nsenter.1: clarify the intro discussion
The intro paragraph talks about entering the namespace of other
processes. That's not quite accurate, since nsenter can be used (via
a bind mount) to enter a namespace that has no member processes.  So
rework NAME and the intro paragraph in DESCRIPTION to remove mention
of "processes".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk
6ff4b15647 Manual pages: nsenter.1, unshare.1: remove repeated references to clone(2)
Back in commits f85b9777c2 and 894efece9e, in the
description of each namespace type, I added repeated cross references
to clone(2). Drop these references. The Section 7 namespaces pages,
which are already noted in the nsenter(1) and unshare(1) manual pages,
provide much more relevant information. Furthermore, pointing the
reader at clone(2) is perhaps a little misleading, since the system
call underlying nsenter(1) is setns(2) and the system call underlying
unshare(1) is unshare(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk
c89aadb727 Manual pages: nsenter.1, unshare.1: add a reference to time_namespaces(7)
Linux man-pages now has a page describing time namespaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk
6b2388d363 Manual pages: nsenter.1, unshare.1: update references to *_namespaces(7) pages
Nowadays, the Linux man-pages project provides separate Section 7
manual pages for each type of namespace. Update the cross references
in nsenter.1 and unshare.1 to reflect this.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk (man-pages)
ade04bb89c Manual pages: order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the AUTHORS, COPYRIGHT, SEE ALSO, and
AVAILABILITY sections are always placed at the end of the page.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:49 +02:00
Stephen Kitt
32ff1494e3 docs: nsenter(1): fix further details in PID namespace section
The "Further details" sentence in the PID namespace section got merged
with the surrounding text; this patch moves it to the end, to match
the other namespace sections, and adds the missing clone(2) reference.

Fixes: 894efece9e ("Provide better cross references for namespace concepts")
Signed-off-by: Stephen Kitt <steve@sk2.org>
2020-04-27 11:32:05 +02:00
Adrian Reber
7f1f0584c2
nsenter: add support for the time namespace
Just as with unshare and lsns this adds time namespace support to
nsenter.

In contrast to unshare nsenter does not have the options '--boottime'
and '--monotonic' as that offset can only be set as long as there have
no processes being started in the corresponding time namespace.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-03-10 07:46:37 +01:00
Bjarni Ingi Gislason
eb02489380 man pages: Add a comma after "e.g." and "i.e."
Add a comma (,) after "e.g." and "i.e.", or use English words
(man-pages(7) [package "manpages"]).

  Abbreviation points should be protected (usually with the
non-printing, zero width character '\&') from being interpreted as an
end of sentence, if they are not, and that independent of their current
place on the line.

  This is important when typing, as one does not usually know in
advance when the editor jumps to a new line.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2019-12-17 12:32:43 +01:00
Bjarni Ingi Gislason
0bb7e904d7 man: Use the correct macro for a font change of one argument
Use the correct macro (I, B) for the font change of one argument, not
those that are used for alternating two fonts, like "BR", "IR", "RB",
or "RI".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-05-23 10:43:27 +02:00
Karel Zak
0f0b5823a6 nsenter: fix usage() and improve man page
The "program" is optional and $SHELL is executed by default.

Addresses: https://github.com/karelzak/util-linux/issues/389
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-09 12:50:09 +01:00
Sébastien Helleu
d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Karel Zak
974cc006f1 nsenter: add --all option
Let's make it easy for users to enter target process namespaces.

Addresses: https://github.com/karelzak/util-linux/issues/382
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-13 14:56:48 +01:00
Karel Zak
91f20582e7 docs: nsenter(1): add missing 'see also' for --user
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-05 13:05:34 +01:00
Michael Kerrisk
ff88fc3ba5 docs: nsenter(1): Formatting fix
Add formatting for 'file' argument used by various options.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 11:18:17 +01:00
Michael Kerrisk
4b298f6187 docs: nsenter(1): Describe the 'file' argument used by namespace options
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 11:18:17 +01:00
Michael Kerrisk (man-pages)
170a8e4ad5 IPC namespaces also isolate POSIX message queues
As described in pid_namespaces(7), IPC namespaces also
isolate POSIX message queues. Update the unshare(1)
and nsenter(1) pages to clarify that.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages)
894efece9e Provide better cross references for namespace concepts
For each namespace that is discussed, add more explicit
references to the corresponding clone(2) flags and
add references to relevant section 7 namespace pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages)
4a3f07352b SEE ALSO: add cross reference to namespaces(7)
Rationale: both of these pages are about namespaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages)
f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Serge Hallyn
f9e7b66dbd Implement support for cgroup namespaces
Currently these are supported in #for-next.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-03-02 17:53:42 -08:00
Karel Zak
355ee3b898 nsenter: add -Z to set selinux context
The new context is copied from --target <PID>. This solution allows to
keep SELinux happy when you enter container by nsenter(1).

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1116100
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-20 15:39:38 +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
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
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
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
Benno Schulenberg
87ec43b671 docs: tweak wording and formatting of unshare and nsenter man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:31 +02:00
Benno Schulenberg
b4362b6f84 docs: standardize the phrases for --help and --version in all man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:30 +02:00
Richard Weinberger
6b9e5bf670 nsenter: Allow selecting the uid and gid to be used in the entered userns
Using -S (--setuid) and -G (--setgid) one can select the uid/gid which
will be used in the entered user namespace.

[kzak@redhat.com: - use setuid/gid unconditionally (always),
                  - update man page]

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-18 10:35:44 +02:00
Benno Schulenberg
dde08a8767 docs: normalize the formatting of man pages for nsenter and unshare
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-06-07 12:11:18 +02:00
Zbigniew Jędrzejewski-Szmek
1e3832bfd1 nsenter: fix errors in manpage
- spell abbreviations with capital letters
- fix the names of a few options and files

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2013-02-14 14:43:49 +01:00
Zbigniew Jędrzejewski-Szmek
5758069426 unshare,nsenter: spawn shell by default
The behaviour mimics chroot.

Possibly it would have been nicer to to query the password database in
the new namepace and run the shell of the user there, but it's hard to
do correctly. getpwuid() might need to load nss plugins, and the arch
in the new namespace might be different (in case of NEWNS mounts), or
the hostname might be different, etc. So in general it's not possible
to do it reliably.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2013-02-14 14:42:35 +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
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
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
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