aboutsummaryrefslogtreecommitdiffstats
path: root/AdminPanel
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo.pasotti@gmail.com>2013-08-19 19:21:18 +0200
committerMatteo Pasotti <matteo.pasotti@gmail.com>2013-08-19 19:21:18 +0200
commitd967275cb5d9c7c3c773a3d7d745fa649df86b3d (patch)
tree921b831a1ee25872033c03c439a9c07e80a69c07 /AdminPanel
parent03ccf8d0c5df0c17d3e31cb24a0d27ad81795435 (diff)
downloadmanatools-d967275cb5d9c7c3c773a3d7d745fa649df86b3d.tar
manatools-d967275cb5d9c7c3c773a3d7d745fa649df86b3d.tar.gz
manatools-d967275cb5d9c7c3c773a3d7d745fa649df86b3d.tar.bz2
manatools-d967275cb5d9c7c3c773a3d7d745fa649df86b3d.tar.xz
manatools-d967275cb5d9c7c3c773a3d7d745fa649df86b3d.zip
- drop USE_* variables (configurable privileges method)
Diffstat (limited to 'AdminPanel')
-rw-r--r--AdminPanel/Privileges.pm17
1 files changed, 5 insertions, 12 deletions
diff --git a/AdminPanel/Privileges.pm b/AdminPanel/Privileges.pm
index f6db9d41..73f20984 100644
--- a/AdminPanel/Privileges.pm
+++ b/AdminPanel/Privileges.pm
@@ -26,18 +26,11 @@ use base qw(Exporter);
use English qw(-no_match_vars);
our @EXPORT = qw(require_root_capability
- ask_for_authentication
- $USE_SUDO
- $USE_PKIT
- $USE_CHLP);
+ ask_for_authentication);
-our $USE_SUDO = 1;
-our $USE_PKIT = 2;
-our $USE_CHLP = 3;
-
-my $wrappers = { $USE_SUDO => "sudo",
- $USE_PKIT => "pkexec",
- $USE_CHLP => "consolehelper"
+my $wrappers = { "sudo" => "sudo",
+ "pkit" => "pkexec",
+ "chlp" => "consolehelper"
};
my $wrapper = 0;
@@ -51,7 +44,7 @@ sub ask_for_authentication {
$wrapper = $wrappers->{$wrapper_id} if(defined($wrappers->{$wrapper_id}));
my ($command, @args) = wrap_command($0, @ARGV);
unshift(@args,$command->[1]);
- unshift(@args, '-n') if($wrapper_id == $USE_SUDO); # let sudo die if password is needed
+ unshift(@args, '-n') if($wrapper_id eq "sudo"); # let sudo die if password is needed
exec { $command->[0] } $command->[1], @args or die ("command %s missing", $command->[0]);
}