|
|
6717ab |
diff -up util-linux-2.23.2/sys-utils/nsenter.1.kzak util-linux-2.23.2/sys-utils/nsenter.1
|
|
|
6717ab |
--- util-linux-2.23.2/sys-utils/nsenter.1.kzak 2014-03-12 12:39:19.283577293 +0100
|
|
|
6717ab |
+++ util-linux-2.23.2/sys-utils/nsenter.1 2014-03-12 12:42:08.930336415 +0100
|
|
|
6717ab |
@@ -47,12 +47,7 @@ flag).
|
|
|
6717ab |
will fork by default if changing the PID namespace, so that the new program
|
|
|
6717ab |
and its children share the same PID namespace and are visible to each other.
|
|
|
6717ab |
If \-\-no\-fork is used, the new program will be exec'ed without forking.
|
|
|
6717ab |
-.TP
|
|
|
6717ab |
-.B user namespace
|
|
|
6717ab |
-process will have distinct set of UIDs, GIDs and capabilities
|
|
|
6717ab |
-.RB ( CLONE_\:NEWUSER
|
|
|
6717ab |
-flag).
|
|
|
6717ab |
-.TP
|
|
|
6717ab |
+.PP
|
|
|
6717ab |
See the
|
|
|
6717ab |
.BR clone (2)
|
|
|
6717ab |
for exact semantics of the flags.
|
|
|
6717ab |
@@ -88,9 +83,6 @@ the network namespace
|
|
|
6717ab |
/proc/\fIpid\fR/ns/pid
|
|
|
6717ab |
the PID namespace
|
|
|
6717ab |
.TP
|
|
|
6717ab |
-/proc/\fIpid\fR/ns/user
|
|
|
6717ab |
-the user namespace
|
|
|
6717ab |
-.TP
|
|
|
6717ab |
/proc/\fIpid\fR/root
|
|
|
6717ab |
the root directory
|
|
|
6717ab |
.TP
|
|
|
6717ab |
@@ -124,11 +116,6 @@ Enter the PID namespace. If no file is
|
|
|
6717ab |
the target process. If file is specified enter the PID namespace specified by
|
|
|
6717ab |
file.
|
|
|
6717ab |
.TP
|
|
|
6717ab |
-\fB\-U\fR, \fB\-\-user\fR [\fIfile\fR]
|
|
|
6717ab |
-Enter the user namespace. If no file is specified enter the user namespace of
|
|
|
6717ab |
-the target process. If file is specified enter the user namespace specified by
|
|
|
6717ab |
-file.
|
|
|
6717ab |
-.TP
|
|
|
6717ab |
\fB\-r\fR, \fB\-\-root\fR [\fIdirectory\fR]
|
|
|
6717ab |
Set the root directory. If no directory is specified set the root directory to
|
|
|
6717ab |
the root directory of the target process. If directory is specified set the
|
|
|
6717ab |
diff -up util-linux-2.23.2/sys-utils/nsenter.c.kzak util-linux-2.23.2/sys-utils/nsenter.c
|
|
|
6717ab |
--- util-linux-2.23.2/sys-utils/nsenter.c.kzak 2014-03-12 12:39:10.402485179 +0100
|
|
|
6717ab |
+++ util-linux-2.23.2/sys-utils/nsenter.c 2014-03-12 12:44:07.986570461 +0100
|
|
|
6717ab |
@@ -42,12 +42,7 @@ static struct namespace_file {
|
|
|
6717ab |
int fd;
|
|
|
6717ab |
} namespace_files[] = {
|
|
|
6717ab |
/* Careful the order is significant in this array.
|
|
|
6717ab |
- *
|
|
|
6717ab |
- * The user namespace comes first, so that it is entered
|
|
|
6717ab |
- * first. This gives an unprivileged user the potential to
|
|
|
6717ab |
- * enter the other namespaces.
|
|
|
6717ab |
*/
|
|
|
6717ab |
- { .nstype = CLONE_NEWUSER, .name = "ns/user", .fd = -1 },
|
|
|
6717ab |
{ .nstype = CLONE_NEWIPC, .name = "ns/ipc", .fd = -1 },
|
|
|
6717ab |
{ .nstype = CLONE_NEWUTS, .name = "ns/uts", .fd = -1 },
|
|
|
6717ab |
{ .nstype = CLONE_NEWNET, .name = "ns/net", .fd = -1 },
|
|
|
6717ab |
@@ -71,7 +66,6 @@ static void usage(int status)
|
|
|
6717ab |
fputs(_(" -i, --ipc [=<file>] enter System V IPC namespace\n"), out);
|
|
|
6717ab |
fputs(_(" -n, --net [=<file>] enter network namespace\n"), out);
|
|
|
6717ab |
fputs(_(" -p, --pid [=<file>] enter pid namespace\n"), out);
|
|
|
6717ab |
- fputs(_(" -U, --user [=<file>] enter user namespace\n"), out);
|
|
|
6717ab |
fputs(_(" -r, --root [=<dir>] set the root directory\n"), out);
|
|
|
6717ab |
fputs(_(" -w, --wd [=<dir>] set the working directory\n"), out);
|
|
|
6717ab |
fputs(_(" -F, --no-fork do not fork before exec'ing <program>\n"), out);
|
|
|
6717ab |
@@ -168,7 +162,6 @@ int main(int argc, char *argv[])
|
|
|
6717ab |
{ "ipc", optional_argument, NULL, 'i' },
|
|
|
6717ab |
{ "net", optional_argument, NULL, 'n' },
|
|
|
6717ab |
{ "pid", optional_argument, NULL, 'p' },
|
|
|
6717ab |
- { "user", optional_argument, NULL, 'U' },
|
|
|
6717ab |
{ "root", optional_argument, NULL, 'r' },
|
|
|
6717ab |
{ "wd", optional_argument, NULL, 'w' },
|
|
|
6717ab |
{ "no-fork", no_argument, NULL, 'F' },
|
|
|
6717ab |
@@ -186,7 +179,7 @@ int main(int argc, char *argv[])
|
|
|
6717ab |
atexit(close_stdout);
|
|
|
6717ab |
|
|
|
6717ab |
while ((c =
|
|
|
6717ab |
- getopt_long(argc, argv, "hVt:m::u::i::n::p::U::r::w::F",
|
|
|
6717ab |
+ getopt_long(argc, argv, "hVt:m::u::i::n::p::r::w::F",
|
|
|
6717ab |
longopts, NULL)) != -1) {
|
|
|
6717ab |
switch (c) {
|
|
|
6717ab |
case 'h':
|
|
|
6717ab |
@@ -228,12 +221,6 @@ int main(int argc, char *argv[])
|
|
|
6717ab |
else
|
|
|
6717ab |
namespaces |= CLONE_NEWPID;
|
|
|
6717ab |
break;
|
|
|
6717ab |
- case 'U':
|
|
|
6717ab |
- if (optarg)
|
|
|
6717ab |
- open_namespace_fd(CLONE_NEWUSER, optarg);
|
|
|
6717ab |
- else
|
|
|
6717ab |
- namespaces |= CLONE_NEWUSER;
|
|
|
6717ab |
- break;
|
|
|
6717ab |
case 'F':
|
|
|
6717ab |
do_fork = 0;
|
|
|
6717ab |
break;
|
|
|
6717ab |
diff -up util-linux-2.23.2/sys-utils/unshare.1.kzak util-linux-2.23.2/sys-utils/unshare.1
|
|
|
6717ab |
--- util-linux-2.23.2/sys-utils/unshare.1.kzak 2014-03-12 12:39:41.367806340 +0100
|
|
|
6717ab |
+++ util-linux-2.23.2/sys-utils/unshare.1 2014-03-12 12:40:25.186260760 +0100
|
|
|
6717ab |
@@ -34,9 +34,6 @@ etc. (\fBCLONE_NEWNET\fP flag).
|
|
|
6717ab |
.BR "pid namespace"
|
|
|
6717ab |
children will have a distinct set of pid to process mappings than their parent.
|
|
|
6717ab |
(\fBCLONE_NEWPID\fP flag).
|
|
|
6717ab |
-.TP
|
|
|
6717ab |
-.BR "user namespace"
|
|
|
6717ab |
-process will have distinct set of uids, gids and capabilities. (\fBCLONE_NEWUSER\fP flag).
|
|
|
6717ab |
.PP
|
|
|
6717ab |
See the \fBclone\fR(2) for exact semantics of the flags.
|
|
|
6717ab |
.SH OPTIONS
|
|
|
6717ab |
@@ -58,9 +55,6 @@ Unshare the network namespace.
|
|
|
6717ab |
.TP
|
|
|
6717ab |
.BR \-p , " \-\-pid"
|
|
|
6717ab |
Unshare the pid namespace.
|
|
|
6717ab |
-.TP
|
|
|
6717ab |
-.BR \-U , " \-\-user"
|
|
|
6717ab |
-Unshare the user namespace.
|
|
|
6717ab |
.SH SEE ALSO
|
|
|
6717ab |
.BR unshare (2),
|
|
|
6717ab |
.BR clone (2)
|
|
|
6717ab |
diff -up util-linux-2.23.2/sys-utils/unshare.c.kzak util-linux-2.23.2/sys-utils/unshare.c
|
|
|
6717ab |
--- util-linux-2.23.2/sys-utils/unshare.c.kzak 2014-03-12 12:39:46.385858383 +0100
|
|
|
6717ab |
+++ util-linux-2.23.2/sys-utils/unshare.c 2014-03-12 12:44:49.955005384 +0100
|
|
|
6717ab |
@@ -45,7 +45,6 @@ static void usage(int status)
|
|
|
6717ab |
fputs(_(" -i, --ipc unshare System V IPC namespace\n"), out);
|
|
|
6717ab |
fputs(_(" -n, --net unshare network namespace\n"), out);
|
|
|
6717ab |
fputs(_(" -p, --pid unshare pid namespace\n"), out);
|
|
|
6717ab |
- fputs(_(" -U, --user unshare user namespace\n"), out);
|
|
|
6717ab |
|
|
|
6717ab |
fputs(USAGE_SEPARATOR, out);
|
|
|
6717ab |
fputs(USAGE_HELP, out);
|
|
|
6717ab |
@@ -65,7 +64,6 @@ int main(int argc, char *argv[])
|
|
|
6717ab |
{ "ipc", no_argument, 0, 'i' },
|
|
|
6717ab |
{ "net", no_argument, 0, 'n' },
|
|
|
6717ab |
{ "pid", no_argument, 0, 'p' },
|
|
|
6717ab |
- { "user", no_argument, 0, 'U' },
|
|
|
6717ab |
{ NULL, 0, 0, 0 }
|
|
|
6717ab |
};
|
|
|
6717ab |
|
|
|
6717ab |
@@ -78,7 +76,7 @@ int main(int argc, char *argv[])
|
|
|
6717ab |
textdomain(PACKAGE);
|
|
|
6717ab |
atexit(close_stdout);
|
|
|
6717ab |
|
|
|
6717ab |
- while ((c = getopt_long(argc, argv, "hVmuinpU", longopts, NULL)) != -1) {
|
|
|
6717ab |
+ while ((c = getopt_long(argc, argv, "hVmuinp", longopts, NULL)) != -1) {
|
|
|
6717ab |
switch (c) {
|
|
|
6717ab |
case 'h':
|
|
|
6717ab |
usage(EXIT_SUCCESS);
|
|
|
6717ab |
@@ -100,9 +98,6 @@ int main(int argc, char *argv[])
|
|
|
6717ab |
case 'p':
|
|
|
6717ab |
unshare_flags |= CLONE_NEWPID;
|
|
|
6717ab |
break;
|
|
|
6717ab |
- case 'U':
|
|
|
6717ab |
- unshare_flags |= CLONE_NEWUSER;
|
|
|
6717ab |
- break;
|
|
|
6717ab |
default:
|
|
|
6717ab |
usage(EXIT_FAILURE);
|
|
|
6717ab |
}
|