summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-09-29 19:23:42 +0100
committerColin Guthrie <colin@mageia.org>2013-09-29 20:33:01 +0100
commit0e4d73a7ded23e8b5a76d58bd5b448dd9e884ef9 (patch)
tree0e1ed9f5a239645bd586f307d6ffdd4b384c4291 /bin
parentc610e1839b3903497a6f6d9009d997b7ac88eea5 (diff)
downloaddrakx-net-0e4d73a7ded23e8b5a76d58bd5b448dd9e884ef9.tar
drakx-net-0e4d73a7ded23e8b5a76d58bd5b448dd9e884ef9.tar.gz
drakx-net-0e4d73a7ded23e8b5a76d58bd5b448dd9e884ef9.tar.bz2
drakx-net-0e4d73a7ded23e8b5a76d58bd5b448dd9e884ef9.tar.xz
drakx-net-0e4d73a7ded23e8b5a76d58bd5b448dd9e884ef9.zip
Convert to polkit from usermode consolehelper for gaining root privileges
polkit is better integrated into various environments, both console and GUI and offers better access rules and prevents the internal need to run su which is prone to errors and doesn't offer an environment agnostic prompt to the user. In this case the current package policy (in rpm spec) has been migrated here and is as follows: draknetcenter requires authentication as the current user. Everything else require authentication as an administrator.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/drakconnect4
-rwxr-xr-xbin/drakconnect-old4
-rwxr-xr-xbin/drakfirewall4
-rwxr-xr-xbin/drakgw4
-rwxr-xr-xbin/drakinvictus2
-rwxr-xr-xbin/draknetcenter4
-rwxr-xr-xbin/draknetprofile2
-rwxr-xr-xbin/draknfs5
-rwxr-xr-xbin/drakproxy4
-rwxr-xr-xbin/drakroam4
-rwxr-xr-xbin/draksambashare4
-rwxr-xr-xbin/drakvpn4
12 files changed, 35 insertions, 10 deletions
diff --git a/bin/drakconnect b/bin/drakconnect
index dcb4e0c..4f58840 100755
--- a/bin/drakconnect
+++ b/bin/drakconnect
@@ -31,8 +31,10 @@ use common;
use network::network;
use modules;
+require_root_capability();
+
$ugtk2::wm_icon = "drakconnect";
-my $in = 'interactive'->vnew('su');
+my $in = 'interactive'->vnew;
my $net = {};
network::network::read_net_conf($net);
diff --git a/bin/drakconnect-old b/bin/drakconnect-old
index 41aaed9..e53ffe8 100755
--- a/bin/drakconnect-old
+++ b/bin/drakconnect-old
@@ -33,8 +33,10 @@ use mygtk2 qw(gtknew);
use network::netconnect;
use network::connection::ethernet;
+require_root_capability();
+
$ugtk2::wm_icon = "drakconnect";
-my $in = 'interactive'->vnew('su');
+my $in = 'interactive'->vnew;
my $net = {};
network::network::read_net_conf($net);
diff --git a/bin/drakfirewall b/bin/drakfirewall
index 4588047..688fd5b 100755
--- a/bin/drakfirewall
+++ b/bin/drakfirewall
@@ -27,7 +27,9 @@ use network::drakfirewall;
$ugtk2::wm_icon = "/usr/share/mcc/themes/default/firewall-mdk.png";
-my $in = 'interactive'->vnew('su');
+require_root_capability();
+
+my $in = 'interactive'->vnew;
network::drakfirewall::main($in, undef);
diff --git a/bin/drakgw b/bin/drakgw
index fd0ee19..f0fd106 100755
--- a/bin/drakgw
+++ b/bin/drakgw
@@ -45,7 +45,9 @@ my $sysconf_network = "/etc/sysconfig/network";
my $masq_file = "$::prefix/etc/shorewall/masq";
my $cups_conf = "$::prefix/etc/cups/cupsd.conf";
-my $in = 'interactive'->vnew('su');
+require_root_capability();
+
+my $in = 'interactive'->vnew;
my $net = {};
network::network::read_net_conf($net);
diff --git a/bin/drakinvictus b/bin/drakinvictus
index 1ae771b..c903bc6 100755
--- a/bin/drakinvictus
+++ b/bin/drakinvictus
@@ -32,6 +32,8 @@ use detect_devices;
use mygtk2 qw(gtknew);
use ugtk2 qw(:create :helpers :wrappers :dialogs);
+require_root_capability();
+
$ugtk2::wm_icon = 'invictus-16';
my $title = N("Invictus Firewall");
my $w = ugtk2->new($title);
diff --git a/bin/draknetcenter b/bin/draknetcenter
index 7396631..5f01d66 100755
--- a/bin/draknetcenter
+++ b/bin/draknetcenter
@@ -18,7 +18,9 @@ use dbus_object;
#- Allow multiple instances, but only one per user:
is_running('draknetcenter') and die "draknetcenter already running\n";
-my $in = 'interactive'->vnew('su');
+require_root_capability();
+
+my $in = 'interactive'->vnew;
my $net = {};
network::network::read_net_conf($net);
my $dbus;
diff --git a/bin/draknetprofile b/bin/draknetprofile
index 4e81e5e..e836c06 100755
--- a/bin/draknetprofile
+++ b/bin/draknetprofile
@@ -33,6 +33,8 @@ use Gtk2::SimpleList;
use ugtk2 qw(:create :helpers :wrappers :dialogs :ask);
use POSIX ();
+require_root_capability();
+
$ugtk2::wm_icon = 'draknetprofile-16';
my $title = N("Network profiles");
my $w = ugtk2->new($title);
diff --git a/bin/draknfs b/bin/draknfs
index a05c641..98aae11 100755
--- a/bin/draknfs
+++ b/bin/draknfs
@@ -27,12 +27,15 @@ use common;
use network::network;
use interactive;
use services;
+
+require_root_capability();
+
my $nfsicon = "/usr/share/mcc/themes/default/draknfs.png";
$ugtk2::wm_icon = $nfsicon;
use mygtk2 qw(gtknew gtkset);
use ugtk2 qw(:ask :wrappers :create :dialogs);
-my $in = 'interactive'->vnew('su');
+my $in = 'interactive'->vnew;
$in->do_pkgs->ensure_is_installed('nfs-utils', '/usr/sbin/rpc.nfsd') or exit(1);
if (!$in->do_pkgs->is_installed("portmap")) {
$in->do_pkgs->ensure_is_installed('rpcbind') or exit(1);
diff --git a/bin/drakproxy b/bin/drakproxy
index 6c52022..2c6b1fe 100755
--- a/bin/drakproxy
+++ b/bin/drakproxy
@@ -28,9 +28,11 @@ use network::network;
use any;
use common;
+require_root_capability();
+
$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakproxy-mdk.png";
my $u = { getVarsFromSh('/etc/profile.d/proxy.sh') };
-my $in = 'interactive'->vnew('su');
+my $in = 'interactive'->vnew;
if (network::network::miscellaneous_choose($in, $u)) {
network::network::proxy_configure($u);
any::ask_for_X_restart($in);
diff --git a/bin/drakroam b/bin/drakroam
index 0c6c400..0f41bad 100755
--- a/bin/drakroam
+++ b/bin/drakroam
@@ -18,7 +18,9 @@ use network::monitor;
my %args = map { if_(/^--(\w+)=(.*)$/ && member($1, qw(ap interface)), $1 => $2) } @ARGV;
-my $in = 'interactive'->vnew('su');
+require_root_capability();
+
+my $in = 'interactive'->vnew;
my $net = {};
network::network::read_net_conf($net);
my $dbus;
diff --git a/bin/draksambashare b/bin/draksambashare
index aef70e8..0c5f97d 100755
--- a/bin/draksambashare
+++ b/bin/draksambashare
@@ -37,7 +37,9 @@ use run_program;
use Libconf::Templates;
use Libconf::Glueconf::Samba::Smb_conf;
-my $in = 'interactive'->vnew('su');
+require_root_capability();
+
+my $in = 'interactive'->vnew;
$in->do_pkgs->ensure_is_installed('samba-server', '/usr/sbin/smbd') or exit(1);
#if (!-f "/etc/sysconfig/wizard_samba") {
diff --git a/bin/drakvpn b/bin/drakvpn
index fbf10a6..595787c 100755
--- a/bin/drakvpn
+++ b/bin/drakvpn
@@ -13,5 +13,7 @@ use standalone;
use interactive;
use network::drakvpn;
-my $in = 'interactive'->vnew('su');
+require_root_capability();
+
+my $in = 'interactive'->vnew;
network::drakvpn::create_connection($in);