]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Fix heimdal-history with the default DB_File::Lock
authorRuss Allbery <eagle@eyrie.org>
Thu, 15 May 2014 05:03:42 +0000 (22:03 -0700)
committerRuss Allbery <eagle@eyrie.org>
Thu, 15 May 2014 05:03:42 +0000 (22:03 -0700)
Change the DB_File::Lock calling method in heimdal-history to work
properly with the (buggy) CPAN version of DB_File::Lock, instead of
relying on Debian's patched version.  Thanks to Bernt Jernberg for the
report.

NEWS
tools/heimdal-history

diff --git a/NEWS b/NEWS
index f8b8be46841b517506e7f7776584c9a1833202a5..8229d5fb1d1843413fd2c4368aab8bd39e5f1bb1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,11 @@ krb5-strength 3.1 (unreleased)
     checking to start with a capital letter.  This appears to be more
     consistent with the error message conventions used inside Heimdal.
 
+    Change the DB_File::Lock calling method in heimdal-history to work
+    properly with the (buggy) CPAN version of DB_File::Lock, instead of
+    relying on Debian's patched version.  Thanks to Bernt Jernberg for the
+    report.
+
 krb5-strength 3.0 (2014-03-25)
 
     The krb5-strength plugin and heimdal-strength program now support a
index 6c17469101cbd4e915441eba9f9a5052ecbc59a6..840f999853a733bf0ad26a938513dbbf9dad2245 100755 (executable)
@@ -377,7 +377,8 @@ sub check_history {
     {
         my %history;
         my $mode = O_CREAT | O_RDWR;
-        tie(%history, 'DB_File::Lock', [$path, $mode, oct(600)], 'write')
+        tie(%history, 'DB_File::Lock', $path, $mode, oct(600), $DB_HASH,
+            'write')
           or die "$0: cannot open $path: $!\n";
         $history_json = $history{$principal};
     }
@@ -415,7 +416,7 @@ sub write_history {
     # Open and lock the database for write.
     my %history;
     my $mode = O_CREAT | O_RDWR;
-    tie(%history, 'DB_File::Lock', [$path, $mode, oct(600)], 'write')
+    tie(%history, 'DB_File::Lock', $path, $mode, oct(600), $DB_HASH, 'write')
       or die "$0: cannot open $path: $!\n";
 
     # Read the existing history.  If the existing history is corrupt, treat
@@ -464,7 +465,7 @@ sub update_length_counts {
     # Open and lock the database for write.
     my %lengths;
     my $mode = O_CREAT | O_RDWR;
-    tie(%lengths, 'DB_File::Lock', [$path, $mode, oct(600)], 'write')
+    tie(%lengths, 'DB_File::Lock', $path, $mode, oct(600), $DB_HASH, 'write')
       or return;
 
     # Write each of the hashes.