X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FWebDAV.pm;h=08f4c7ba57ca34b7e5eb53b201acc8a8c8ce5aa9;hp=2a974e2a9eed47f47dbbdadcc0ca77701786fd76;hb=1b419e82260d4c5135c1f6a202e2dccd9cfbde43;hpb=2698077b60939a858ecaaf1ccde01591170f0a2c diff --git a/perl/Sesse/pr0n/WebDAV.pm b/perl/Sesse/pr0n/WebDAV.pm index 2a974e2..08f4c7b 100644 --- a/perl/Sesse/pr0n/WebDAV.pm +++ b/perl/Sesse/pr0n/WebDAV.pm @@ -456,8 +456,8 @@ EOF { # Enable transactions and error raising temporarily local $dbh->{AutoCommit} = 0; - local $dbh->{RaiseError} = 1; + my $fname; # Try to insert this new file eval { @@ -468,7 +468,7 @@ EOF undef, $newid, $event, $user, $takenby, $filename); # Now save the file to disk - my $fname = Sesse::pr0n::Common::get_disk_location($r, $newid); + $fname = Sesse::pr0n::Common::get_disk_location($r, $newid); open NEWFILE, ">$fname" or die "$fname: $!"; @@ -499,6 +499,7 @@ EOF # Some error occurred, rollback and bomb out $dbh->rollback; dberror($r, "Transaction aborted because $@"); + unlink($fname); } }