Mageia Bugzilla – Attachment 4597 Details for
Bug 11929
net_applet segfaults
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Workaround
0001-Avoid-system-as-this-seems-to-crash-net_applet.patch (text/plain), 1.66 KB, created by
Colin Guthrie
on 2013-12-08 16:00:57 CET
(
hide
)
Description:
Workaround
Filename:
MIME Type:
Creator:
Colin Guthrie
Created:
2013-12-08 16:00:57 CET
Size:
1.66 KB
patch
obsolete
>From a6547a103a7f94f251bfdb01563052bba455f898 Mon Sep 17 00:00:00 2001 >From: Colin Guthrie <colin@mageia.org> >Date: Sun, 8 Dec 2013 14:58:34 +0000 >Subject: [PATCH] Avoid system() as this seems to crash net_applet. > >In what would appear to be related to threads and gtk3, calling system() >here appears to crash net_applet(). > >We can avoid it by simply reading the network config. > >I'm not sure if a global $net variable is available here >or if things could be re-engineered to pass this object in, >but this seems like a quick and easy fix. > >mga#11929 >--- > NEWS | 2 ++ > lib/network/tools.pm | 8 +++++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > >diff --git a/NEWS b/NEWS >index df4cdd5..0890c40 100644 >--- a/NEWS >+++ b/NEWS >@@ -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); >-- >1.8.4.5 >
From a6547a103a7f94f251bfdb01563052bba455f898 Mon Sep 17 00:00:00 2001 From: Colin Guthrie <colin@mageia.org> Date: Sun, 8 Dec 2013 14:58:34 +0000 Subject: [PATCH] Avoid system() as this seems to crash net_applet. In what would appear to be related to threads and gtk3, calling system() here appears to crash net_applet(). We can avoid it by simply reading the network config. I'm not sure if a global $net variable is available here or if things could be re-engineered to pass this object in, but this seems like a quick and easy fix. mga#11929 --- NEWS | 2 ++ lib/network/tools.pm | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index df4cdd5..0890c40 100644 --- a/NEWS +++ b/NEWS @@ -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); -- 1.8.4.5
View Attachment As Raw
Actions:
View
Attachments on
bug 11929
:
4595
| 4597