Fix previous release 0.001001
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 4 Aug 2013 17:11:17 +0000 (20:11 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 4 Aug 2013 17:11:17 +0000 (20:11 +0300)
Changes
README
lib/Apache2/Authen/Passphrase.pm
lib/Apache2/Authen/pod2htmd.tmp [deleted file]
lib/Apache2/Authen/pod2htmi.tmp [deleted file]
t/Apache2-Authen-Passphrase.t

diff --git a/Changes b/Changes
index ca77758f05248df7a259fe3c1100c8d9fc973729..f93cd705ad72b670814dd13984565a7171bc1303 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,3 +2,5 @@ Revision history for Perl extension Apache2::Authen::Passphrase.
 
 0.001 Sun  4 Aug 19:47:54 EEST 2013
        - Initial Release
+0.001001 Sun  4 Aug 20:10:24 EEST 2013
+       - Fix the broken previous release
\ No newline at end of file
diff --git a/README b/README
index 1149eeb348d1904bc1eba3f10762e22dbcf442e2..26e3bf90e2efb59b8dae54bf86fe40ddc285e965 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-Apache2-Authen-Passphrase version 0.001
-=======================================
+Apache2-Authen-Passphrase version 0.001001
+==========================================
 
 Apache2::Authen::Passphrase is a perl module which provides easy-to-use Apache2 authentication. It exports some utility functions and it contains a PerlAuthenHandler.
 
index 0770f74a72fc879403ff01f910a5d66e4e67b094..4beea0e0e8e10160a55465c48cbbb1ea7a923122 100644 (file)
@@ -1,4 +1,4 @@
-package Apache2::Authen::Passphrase 0.001;
+package Apache2::Authen::Passphrase 0.001001;
 
 use 5.014000;
 use strict;
@@ -40,7 +40,7 @@ sub pwhash{
 sub pwset{
   my ($user, $pass)=@_;
 
-  my $file = "$rootdir/us/$user.yml";
+  my $file = "$rootdir/$user.yml";
   my $conf = eval { LoadFile $file } // undef;
   $conf->{passphrase}=pwhash $pass;
   $conf->{passphrase_version}=PASSPHRASE_VERSION;
@@ -53,7 +53,7 @@ sub pwcheck{
   my ($user, $pass)=@_;
   die INVALID_USER unless $user =~ USER_REGEX;
   $user=${^MATCH};# Make taint shut up
-  my $conf=LoadFile "$rootdir/us/$user.yml";
+  my $conf=LoadFile "$rootdir/$user.yml";
 
   die BAD_PASSWORD unless keys $conf;# Empty hash means no such user
   die BAD_PASSWORD unless Authen::Passphrase->from_rfc2307($conf->{passphrase})->match($pass);
@@ -62,6 +62,7 @@ sub pwcheck{
 
 sub handler{
   my $r=shift;
+  local $rootdir = $r->dir_config('AuthenPassphraseRootdir');
 
   my ($rc, $pass) = $r->get_basic_auth_pw;
   return $rc unless $rc == OK;
@@ -85,6 +86,7 @@ Apache2::Authen::Passphrase - basic authentication with Authen::Passphrase
 =head1 SYNOPSIS
 
   use Apache2::Authen::Passphrase qw/pwcheck pwset pwhash/;
+  $Apache2::Authen::Passphrase::rootdir = "/path/to/user/directory"
   my $hash = pwhash $username, $password;
   pwset $username, "pass123";
   eval { pwcheck $username, "pass123" };
@@ -92,6 +94,7 @@ Apache2::Authen::Passphrase - basic authentication with Authen::Passphrase
   # In Apache2 config
   <Location /secret>
     PerlAuthenHandler Apache2::Authen::Passphrase
+    PerlSetVar AuthenPassphraseRootdir /path/to/user/directory
     AuthName MyAuth
     Require valid-user
   </Location>
diff --git a/lib/Apache2/Authen/pod2htmd.tmp b/lib/Apache2/Authen/pod2htmd.tmp
deleted file mode 100644 (file)
index 61e86d9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-.
diff --git a/lib/Apache2/Authen/pod2htmi.tmp b/lib/Apache2/Authen/pod2htmi.tmp
deleted file mode 100644 (file)
index 61e86d9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-.
index b27498b1921ca5cb1a9b4fceffbcf31eb81db617..0ebf90d4c1419926ddb68a32f7f5c3b3d68ce254 100644 (file)
@@ -6,9 +6,7 @@ use File::Temp qw/tempdir/;
 use Test::More tests => 7;
 BEGIN { use_ok('Apache2::Authen::Passphrase', qw/pwset pwcheck/) };
 
-my $tempdir = tempdir CLEANUP => 1;
-mkdir "$tempdir/us";
-$Apache2::Authen::Passphrase::rootdir = $tempdir;
+$Apache2::Authen::Passphrase::rootdir = tempdir CLEANUP => 1;
 
 sub pw_ok {
   my ($user, $pass, $testname) = @_;
This page took 0.014886 seconds and 4 git commands to generate.