Subject: | Infinite loop bug w/ root user |
multivac-2:~ dmuey$ whoami
dmuey
multivac-2:~ dmuey$ perl db_file_bug.pl
DB_File Version: 1.815
Elapsed: 0.008934
multivac-2:~ dmuey$
multivac-2:~ root# whoami
root
multivac-2:~ root# date;perl /Users/dmuey/db_file_bug.pl;date
Sat Aug 18 12:33:55 CDT 2007
DB_File Version: 1.815
^C
Sat Aug 18 12:35:05 CDT 2007
multivac-2:~ root#
Here's the script:
multivac-2:~ dmuey$ cat db_file_bug.pl
#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes;
use DB_File;
print "DB_File Version: $DB_File::VERSION\n";
my $start = [Time::HiRes::gettimeofday];
use DB_File;
open(my $fake_lock_fh,'>','__db.breakme');
close($fake_lock_fh);
tie my %x, 'DB_File', 'breakme', O_RDWR | O_CREAT, 0600;
print "Elapsed: " . Time::HiRes::tv_interval( $start, [Time::HiRes::gettimeofday] ) . "\n";
multivac-2:~ dmuey$