From 4542dfad9d493f42e8b9c1c2b2da476f0e7ff815 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 4 Oct 2017 19:04:51 +0100 Subject: Add an option to disable netns --- NEWS | 1 + iurt | 4 ++++ lib/Iurt/Chroot.pm | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index cb885a9..6a86701 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - iurt: bring lo up in the chroot and point hostname to 127.0.0.1 +- iurt: add an option to disable the use of network namespaces 0.7.1 - iurt: also use --urpmi-root for urpmi.addmedia diff --git a/iurt b/iurt index bca67a4..17fa536 100755 --- a/iurt +++ b/iurt @@ -501,6 +501,10 @@ my %config_usage = ( desc => 'Enabled icecream usage and uses N procs', default => 0 }, + use_netns => { + desc => 'Create a separate network namespace for each chroot to prevent builds from accessing the network', + default => 1 + }, ); if ($run{config_usage}) { diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 1bf019e..c54b180 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -316,7 +316,7 @@ sub create_build_chroot { } } - if ($ret) { + if ($ret && $config->{use_netns}) { sudo($config, '--netns_create', $chroot); } return $ret; -- cgit v1.2.1