From: Marius Gavrilescu Date: Fri, 1 May 2015 14:48:02 +0000 (+0300) Subject: Fix aap-passwd argument checking X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=7838eb5866e3c056824fd57f212c8e5fc4bf8695;p=apache2-authen-passphrase.git Fix aap-passwd argument checking --- diff --git a/aap-passwd b/aap-passwd index 69d892d..ac6a7e9 100644 --- a/aap-passwd +++ b/aap-passwd @@ -9,8 +9,8 @@ use Apache2::Authen::Passphrase qw/pwset USER_REGEX/; use IO::Prompter [qw/-e* -stdio/]; -die "Usage: aap-passwd [rootdir] username\n" if @ARGV == 0 || @ARGV > 1; -($Apache2::Authen::Passphrase::rootdir) = (shift =~ /(.*)/s) if $#ARGV == 1; +die "Usage: aap-passwd [rootdir] username\n" if @ARGV == 0 || @ARGV > 2; +($Apache2::Authen::Passphrase::rootdir) = (shift =~ /(.*)/s) if @ARGV == 2; my $username = shift; die "Invalid username\n" unless $username =~ USER_REGEX;