diff --git a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py index d0832318..b9a1dc1e 100644 --- a/plugins/python/uwsgiplugin.py +++ b/plugins/python/uwsgiplugin.py @@ -20,10 +20,8 @@ else: os.environ['LD_RUN_PATH'] = "%s/lib" % sysconfig.PREFIX -version = sys.version_info -uver = "%d.%d" % (version[0], version[1]) - -LIBS.append('-lpython' + uver) +version = sysconfig.get_config_var('VERSION') +LIBS.append('-lpython' + version) #if str(PYLIB_PATH) != '': # libs.insert(0,'-L' + PYLIB_PATH) diff --git a/uwsgi.c b/uwsgi.c index b7fc33a9..a74542fa 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -956,7 +956,9 @@ options_parsed: int waitpid_status; uwsgi_log("*** jailing uWSGI in %s ***\n", uwsgi.ns); int clone_flags = SIGCHLD|CLONE_NEWUTS|CLONE_NEWPID|CLONE_NEWIPC|CLONE_NEWNS; - //clone_flags |= CLONE_NEWNET; + if (uwsgi.ns_net) { + clone_flags |= CLONE_NEWNET; + } pid_t pid = clone(uwsgi_start, stack+PTHREAD_STACK_MIN, clone_flags, (void *)argv); if (pid == -1) { uwsgi_error("clone()"); @@ -2409,6 +2411,9 @@ end: case LONG_ARGS_LINUX_NS: uwsgi.ns = optarg; return 1; + case LONG_ARGS_LINUX_NS_NET: + uwsgi.ns_net = optarg; + return 1; #endif case LONG_ARGS_LIMIT_AS: uwsgi.rl.rlim_cur = (atoi(optarg)) * 1024 * 1024; diff --git a/uwsgi.h b/uwsgi.h index 9c296dc4..a6c27ebd 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -962,6 +962,7 @@ struct uwsgi_server { char *cgroup_opt[64]; int cgroup_opt_cnt; char *ns; + char *ns_net; #endif int sockets_cnt;