diff options
author | Matteo Pasotti <matteo@mageia.org> | 2012-11-07 15:53:18 +0000 |
---|---|---|
committer | Matteo Pasotti <matteo@mageia.org> | 2012-11-07 15:53:18 +0000 |
commit | b91c64b1dad5fc5141373890e478ce915ded987c (patch) | |
tree | 5d30447ae1296c32ef0866b6a24ec7d42198ae6b | |
parent | 3710241ae71c43bda5281a0b118888e0ed4d526e (diff) | |
download | colin-keep-b91c64b1dad5fc5141373890e478ce915ded987c.tar colin-keep-b91c64b1dad5fc5141373890e478ce915ded987c.tar.gz colin-keep-b91c64b1dad5fc5141373890e478ce915ded987c.tar.bz2 colin-keep-b91c64b1dad5fc5141373890e478ce915ded987c.tar.xz colin-keep-b91c64b1dad5fc5141373890e478ce915ded987c.zip |
- removed unaccessed code (code after exec)
- removed env parameter not required
- fixed exec arguments
-rw-r--r-- | Auth.pm | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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); } |