After parsing flags check that the command is nsenter

Signed-off-by: Michael Crosby <michael@docker.com>
This commit is contained in:
Michael Crosby 2014-08-07 10:47:42 -07:00
parent 5226b39d15
commit ae9af437f0
2 changed files with 5 additions and 1 deletions

View File

@ -117,6 +117,10 @@ void nsenter()
}
}
if (strcmp(argv[optind], kNsEnter) != 0) {
return;
}
if (init_pid_str == NULL) {
print_usage();
exit(1);

View File

@ -50,7 +50,7 @@ func execAction(context *cli.Context) {
// the process for execing a new process inside an existing container is that we have to exec ourself
// with the nsenter argument so that the C code can setns an the namespaces that we require. Then that
// code path will drop us into the path that we can do the file setup of the namespace and exec the users
// code path will drop us into the path that we can do the final setup of the namespace and exec the users
// application.
func startInExistingContainer(config *libcontainer.Config, state *libcontainer.State, context *cli.Context) (int, error) {
var (