6 our $VERSION = 0.002001;
8 use Apache2
::Authen
::Passphrase qw
/pwset USER_REGEX/;
10 use IO
::Prompter
[qw
/-e* -stdio/];
12 die "Usage: aap-passwd [rootdir] username\n" if @ARGV == 0 || @ARGV > 2;
13 ($Apache2::Authen
::Passphrase
::rootdir
) = (shift =~ /(.*)/s) if @ARGV == 2;
16 die "Invalid username\n" unless $username =~ USER_REGEX
;
17 ($username) = ($username =~ /(.*)/s);
19 my $passwd = prompt
'Enter new Apache2::Authen::Passphrase password: ';
20 my $confirm = prompt
'Retype new Apache2::Authen::Passphrase password: ';
22 die "Sorry, passwords do not match\n" unless $passwd eq $confirm;
23 pwset
$username, $passwd;
24 say 'Password updated successfully'; ## no critic (RequireCheckedSyscalls)
30 aap-passwd - passwd utility for Apache2::Authen::Passphrase
34 user@hostname:~$ aap-passwd /path/to/rootdir marius
35 Enter new Apache2::Authen::Passphrase password: ***
36 Retype new Apache2::Authen::Passphrase password: ***
37 Password updated successfully
41 aap-passwd updates the password of an Apache2::Authen::Passphrase user.
45 aap-passwd /path/to/rootdir username
47 where the C<rootdir> is the first argument and the username whose password is to be changed is the second argument, or like this:
51 where the C<rootdir> is taken from the environment and the username is the only argument.
59 The default Apache2::Authen::Passphrase C<rootdir>, used if the C<rootdir> is not explicitly given.
65 Marius Gavrilescu C<< <marius@ieval.ro> >>
67 =head1 COPYRIGHT AND LICENSE
69 Copyright (C) 2013-2015 by Marius Gavrilescu
71 This library is free software; you can redistribute it and/or modify
72 it under the same terms as Perl itself, either Perl version 5.14.2 or,
73 at your option, any later version of Perl 5 you may have available.
This page took 0.024436 seconds and 4 git commands to generate.