diff options
Diffstat (limited to 'multimedia/zoneminder')
-rw-r--r-- | multimedia/zoneminder/Makefile | 3 | ||||
-rw-r--r-- | multimedia/zoneminder/files/patch-scripts_zmupdate.pl.in | 39 |
2 files changed, 41 insertions, 1 deletions
diff --git a/multimedia/zoneminder/Makefile b/multimedia/zoneminder/Makefile index d6eecca9761e..47ba2e280d88 100644 --- a/multimedia/zoneminder/Makefile +++ b/multimedia/zoneminder/Makefile @@ -1,5 +1,6 @@ PORTNAME= zoneminder DISTVERSION= 1.36.35 +PORTREVISION= 1 CATEGORIES= multimedia PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} @@ -35,7 +36,7 @@ RUN_DEPENDS= ${ZM_DEPENDS} \ sudo:security/sudo \ p5-Device-SerialPort>=0:comms/p5-Device-SerialPort \ p5-Crypt-Eksblowfish>=0:security/p5-Crypt-Eksblowfish \ - p5-Data-Entropy>=0:security/p5-Data-Entropy \ + p5-Bytes-Random-Secure>=0:security/p5-Bytes-Random-Secure \ p5-XML-LibXML>=0:textproc/p5-XML-LibXML \ zip:archivers/zip diff --git a/multimedia/zoneminder/files/patch-scripts_zmupdate.pl.in b/multimedia/zoneminder/files/patch-scripts_zmupdate.pl.in new file mode 100644 index 000000000000..8bd3db5ac6ec --- /dev/null +++ b/multimedia/zoneminder/files/patch-scripts_zmupdate.pl.in @@ -0,0 +1,39 @@ +--- scripts/zmupdate.pl.in.orig 2025-06-13 23:01:03 UTC ++++ scripts/zmupdate.pl.in +@@ -52,8 +52,6 @@ use version; + use strict; + use bytes; + use version; +-use Crypt::Eksblowfish::Bcrypt; +-use Data::Entropy::Algorithms qw(rand_bits); + + # ========================================================================== + # +@@ -1035,6 +1033,18 @@ sub migratePasswords { + } # end sub patchDB + + sub migratePasswords { ++ use Crypt::Eksblowfish::Bcrypt; ++ my $random; ++ eval { ++ require Bytes::Random::Secure; ++ $random = Bytes::Random::Secure->new( Bits => 16*8); ++ }; ++ if ($@ or !$random) { ++ eval { ++ require Data::Entropy::Algorithms; ++ $random = Data::Entropy::Algorithms::rand_bits(16*8); ++ }; ++ } + print ("Migratings passwords, if any...\n"); + my $sql = 'SELECT * FROM `Users`'; + my $sth = $dbh->prepare_cached($sql) or die( "Can't prepare '$sql': ".$dbh->errstr() ); +@@ -1043,7 +1053,7 @@ sub migratePasswords { + my $scheme = substr($user->{Password}, 0, 1); + if ($scheme eq '*') { + print ('-->'.$user->{Username}." password will be migrated\n"); +- my $salt = Crypt::Eksblowfish::Bcrypt::en_base64(rand_bits(16*8)); ++ my $salt = Crypt::Eksblowfish::Bcrypt::en_base64($random); + my $settings = '$2a$10$'.$salt; + my $pass_hash = Crypt::Eksblowfish::Bcrypt::bcrypt($user->{Password},$settings); + my $new_pass_hash = '-ZM-'.$pass_hash; |