  		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;

From: Jason Wessel <jason.wessel@windriver.com>
Date: Thu, 11 Aug 2016 13:21:45 -0500
Subject: [PATCH] nsenter: Add "-P" option for access to root/parent name space

The idea behind this patch is that the kernel will extend the setns()

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

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Upstream-Status: Pending
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 sys-utils/nsenter.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c
index 4432cd3..476688f 100644
--- a/sys-utils/nsenter.c
+++ b/sys-utils/nsenter.c
@@ -85,6 +85,7 @@ static void __attribute__((__noreturn__)) usage(void)
 	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(_(" -T, --time[=<file>]    enter time namespace\n"), out);
@@ -108,6 +109,7 @@ static void __attribute__((__noreturn__)) usage(void)
 static pid_t namespace_target_pid = 0;
 static int root_fd = -1;
 static int wd_fd = -1;
