diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | lib/network/tools.pm | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,5 @@ +- avoid system() as this seems to segv perl when combined with threads (mga#11929) + 2.2 - fix "undefined value for mandatory argument 'sensitive'" (mga#11799) diff --git a/lib/network/tools.pm b/lib/network/tools.pm index 951b445..c80c269 100644 --- a/lib/network/tools.pm +++ b/lib/network/tools.pm @@ -21,8 +21,14 @@ sub passwd_by_login { sub run_interface_command { my ($action, $intf, $detach) = @_; + my $have_perms = !$>; + if (!$have_perms) { + my $xxnet = {}; + network::network::read_net_conf($xxnet); + $have_perms = text2bool($xxnet->{ifcfg}{$intf}{USERCTL}); + } my @command = - !$> || system("/usr/sbin/usernetctl $intf report") == 0 ? + $have_perms ? ('/usr/sbin/if' . $action, $intf, if_(!$::isInstall, "daemon")) : ('/usr/bin/pkexec', '/usr/sbin/if' . $action, $intf); run_program::raw({ detach => $detach, root => $::prefix }, @command); |