aboutsummaryrefslogtreecommitdiffstats
path: root/Auth.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Auth.pm')
-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);
}