aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo@mageia.org>2012-11-07 15:53:18 +0000
committerMatteo Pasotti <matteo@mageia.org>2012-11-07 15:53:18 +0000
commitb91c64b1dad5fc5141373890e478ce915ded987c (patch)
tree5d30447ae1296c32ef0866b6a24ec7d42198ae6b
parent3710241ae71c43bda5281a0b118888e0ed4d526e (diff)
downloadmanatools-b91c64b1dad5fc5141373890e478ce915ded987c.tar
manatools-b91c64b1dad5fc5141373890e478ce915ded987c.tar.gz
manatools-b91c64b1dad5fc5141373890e478ce915ded987c.tar.bz2
manatools-b91c64b1dad5fc5141373890e478ce915ded987c.tar.xz
manatools-b91c64b1dad5fc5141373890e478ce915ded987c.zip
- removed unaccessed code (code after exec)
- removed env parameter not required - fixed exec arguments
-rw-r--r--Auth.pm12
1 files changed, 4 insertions, 8 deletions
diff --git a/Auth.pm b/Auth.pm
index a3dde6af..7a269ec7 100644
--- a/Auth.pm
+++ b/Auth.pm
@@ -34,17 +34,13 @@ sub require_root_capability {
}
sub ask_for_authentication {
- my @args = @ARGV;
- my $command = wrap_command($0);
- unshift(@args, $command->[2]);
+ my ($command, @args) = wrap_command($0, @ARGV);
+ unshift(@args,$command->[1]);
exec { $command->[0] } $command->[1], @args or die ("command %s missing", $command->[0]);
- die "You must be root to run this program" if $>;
}
sub wrap_command {
- my $currenv = "env";
my $wrapper = "pkexec";
- my $app = $0;
- my $command = [$wrapper, $currenv, $app];
- ($command);
+ my ($app, @args) = @_;
+ return ([$wrapper, $app], @args);
}