From: Bjoern Schiessle Date: Thu, 14 Jun 2012 10:01:16 +0000 (+0200) Subject: suppress warning if /dev/urandom is not readable (bug #997) X-Git-Tag: v4.5.0beta1~74^2~420^2~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6c7e10245c310b8945b90e50aceb0cd3a123b9bd;p=nextcloud-server.git suppress warning if /dev/urandom is not readable (bug #997) --- diff --git a/3rdparty/phpass/PasswordHash.php b/3rdparty/phpass/PasswordHash.php index 12958c7f19e..84447b277df 100644 --- a/3rdparty/phpass/PasswordHash.php +++ b/3rdparty/phpass/PasswordHash.php @@ -48,7 +48,7 @@ class PasswordHash { function get_random_bytes($count) { $output = ''; - if (is_readable('/dev/urandom') && + if (@is_readable('/dev/urandom') && ($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh);