]> git.proxmox.com Git - pve-access-control.git/commitdiff
oathkeygen: code style fixes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 11 Apr 2023 13:13:43 +0000 (15:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 11 Apr 2023 13:15:43 +0000 (15:15 +0200)
we probably should just deprecate this altogether as it could be
worked around by doing a simple

 dd if=/dev/urandom bs=1 count=10 status=none | base32

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/oathkeygen

index 82e4eec48df159e364ef9aef3df58f73cbfed17a..574b0c715882051b6e6e0afcc6754bfd58a6e365 100755 (executable)
@@ -5,7 +5,7 @@ use warnings;
 use MIME::Base32; #libmime-base32-perl
 
 my $test;
-open(RND, "/dev/urandom");
-sysread(RND, $test, 10) == 10 || die "read random data failed\n";
+open(my $RND_FH, '<', "/dev/urandom");
+sysread($RND_FH, $test, 10) == 10 || die "read random data failed - $!\n";
 print MIME::Base32::encode_rfc3548($test) . "\n";