  		case 'U':
  			if (optarg)
  				open_namespace_fd(CLONE_NEWUSER, optarg);
-@@ -420,7 +435,7 @@ int main(int argc, char *argv[])
+@@ -427,7 +442,7 @@ int main(int argc, char *argv[])
  				continue;
  			if (nsfile->nstype == CLONE_NEWPID && do_fork == -1)
  				do_fork = 1;

flags at run time, it will be granted access to the root name space.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 sys-utils/nsenter.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--- a/sys-utils/nsenter.c
+++ b/sys-utils/nsenter.c
@@ -84,6 +84,7 @@ static void usage(int status)
 	fputs(_(" -i, --ipc[=<file>]     enter System V IPC namespace\n"), out);
 	fputs(_(" -n, --net[=<file>]     enter network namespace\n"), out);
 	fputs(_(" -p, --pid[=<file>]     enter pid namespace\n"), out);
+	fputs(_(" -P  --parent           enter parent name space\n"), out);
 	fputs(_(" -C, --cgroup[=<file>]  enter cgroup namespace\n"), out);
 	fputs(_(" -U, --user[=<file>]    enter user namespace\n"), out);
 	fputs(_(" -S, --setuid <uid>     set uid in entered namespace\n"), out);
@@ -107,6 +108,7 @@ static void usage(int status)
 static pid_t namespace_target_pid = 0;
 static int root_fd = -1;
 static int wd_fd = -1;

 		if ((ret == child) && (WIFSTOPPED(status))) {
 			/* The child suspended so suspend us as well */
 			kill(getpid(), SIGSTOP);
@@ -219,6 +230,7 @@ int main(int argc, char *argv[])
 		{ "ipc", optional_argument, NULL, 'i' },
 		{ "net", optional_argument, NULL, 'n' },
 		{ "pid", optional_argument, NULL, 'p' },
+		{ "parent", no_argument, NULL, 'P' },
 		{ "user", optional_argument, NULL, 'U' },
 		{ "cgroup", optional_argument, NULL, 'C' },
 		{ "time", optional_argument, NULL, 'T' },
@@ -251,7 +263,7 @@ int main(int argc, char *argv[])
 	close_stdout_atexit();
 
 	while ((c =
-		getopt_long(argc, argv, "+ahVt:m::u::i::n::p::C::U::T::S:G:r::w::FZ",
+		getopt_long(argc, argv, "+ahVt:m::u::i::n::Pp::C::U::T::S:G:r::w::FZ",
 			    longopts, NULL)) != -1) {
 		switch (c) {
 		case 'a':
@@ -297,6 +309,9 @@ int main(int argc, char *argv[])
 			else
 				namespaces |= CLONE_NEWCGROUP;
 			break;
