summaryrefslogtreecommitdiffstats
path: root/bin/drakproxy
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/drakproxy
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/drakproxy')
-rwxr-xr-xbin/drakproxy4
1 files changed, 3 insertions, 1 deletions
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);