On Mon, 22 Mar 2004, Matt Sergeant wrote:
> It probably has to be re-written with locking (though I haven't read
> the code for the plugin - does it lock?)
Yes, it does lock. I didn't check that it will always remove the lock.
Behaviour probably depends on which form of the command is run - Sam, are
you using select server, or running under tcpserver?
I note that it returns DECLINED on various failure conditions. Shouldn't
that be DENYSOFT (so admin has a chance to fix the problem)?
...
# Check denysoft db
unless (open LOCK, ">$db.lock") {
$self->log(2, "opening lockfile failed: $!");
return DECLINED;
}
unless (flock LOCK, LOCK_EX) {
$self->log(2, "flock of lockfile failed: $!");
close LOCK;
return DECLINED;
}
my %db = ();
unless (tie %db, 'AnyDBM_File', $db, O_CREAT|O_RDWR, 0600) {
$self->log(2, "tie to database $db failed: $!");
close LOCK;
return DECLINED;
}
...
---
Charlie