diff options
author | Angelo Naselli <anaselli@mageia.org> | 2012-11-06 20:15:01 +0000 |
---|---|---|
committer | Angelo Naselli <anaselli@mageia.org> | 2012-11-06 20:15:01 +0000 |
commit | 5a547e6b955ea5c655edb3b87b7ff7676ced36fe (patch) | |
tree | 6e3b659c3cc210c6553cdcc4952cb38c6ee1061e /Auth.pm | |
parent | 5a38703a90989bca6a3e2c858c3f9467895316f9 (diff) | |
download | manatools-5a547e6b955ea5c655edb3b87b7ff7676ced36fe.tar manatools-5a547e6b955ea5c655edb3b87b7ff7676ced36fe.tar.gz manatools-5a547e6b955ea5c655edb3b87b7ff7676ced36fe.tar.bz2 manatools-5a547e6b955ea5c655edb3b87b7ff7676ced36fe.tar.xz manatools-5a547e6b955ea5c655edb3b87b7ff7676ced36fe.zip |
change code alignment using
tabstop=4 shiftwidth=4 expandtab
Diffstat (limited to 'Auth.pm')
-rw-r--r-- | Auth.pm | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -1,3 +1,4 @@ +# vim: set et ts=4 sw=4: # Copyright 2012 Matteo Pasotti # # This file is part of AdminPanel @@ -20,7 +21,7 @@ package Auth; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(require_root_capability - ask_for_authentication); + ask_for_authentication); use strict; use warnings; @@ -29,22 +30,22 @@ use Data::Dumper; sub require_root_capability { - return 0 if(!$>); - return 1; + return 0 if(!$>); + return 1; } sub ask_for_authentication { - my @args = @ARGV; - my $command = wrap_command($0); - unshift(@args, $command->[2]); - exec { $command->[0] } $command->[1], @args or die ("command %s missing", $command->[0]); - die "You must be root to run this program" if $>; + my @args = @ARGV; + my $command = wrap_command($0); + unshift(@args, $command->[2]); + 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 $currenv = "env"; + my $wrapper = "pkexec"; + my $app = $0; + my $command = [$wrapper, $currenv, $app]; + ($command); } |