From b91c64b1dad5fc5141373890e478ce915ded987c Mon Sep 17 00:00:00 2001 From: Matteo Pasotti Date: Wed, 7 Nov 2012 15:53:18 +0000 Subject: - removed unaccessed code (code after exec) - removed env parameter not required - fixed exec arguments --- Auth.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Auth.pm b/Auth.pm index a3dde6a..7a269ec 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); } -- cgit v1.2.1