diff options
author | lpsolit%gmail.com <> | 2005-08-05 09:58:59 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-08-05 09:58:59 +0200 |
commit | 72bdf0f920380807b1da4bb5be3523e65f618182 (patch) | |
tree | 13eb1d7e90159e4ce26074b97308782ee658ac3e | |
parent | 0892cf1cd12048a9971ccb29f4fcdc60181aa7d9 (diff) | |
download | bugzilla-72bdf0f920380807b1da4bb5be3523e65f618182.tar.gz bugzilla-72bdf0f920380807b1da4bb5be3523e65f618182.tar.xz |
Bug 288170: importxml.pl and move.pl should not write to $datadir/maillog - Patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org> r=LpSolit a=justdave
-rwxr-xr-x | importxml.pl | 35 | ||||
-rwxr-xr-x | move.pl | 36 |
2 files changed, 0 insertions, 71 deletions
diff --git a/importxml.pl b/importxml.pl index b8e017412..0d9dcb868 100755 --- a/importxml.pl +++ b/importxml.pl @@ -71,7 +71,6 @@ use Bugzilla::User; require "CGI.pl"; require "globals.pl"; -$::lockcount = 0; GetVersionTable(); @@ -117,40 +116,6 @@ sub MailMessage { my $sendmessage = $header . $message . "\n"; Bugzilla::BugMail::MessageToMTA($sendmessage); - - Log($subject . " sent to: $to"); -} - - -sub Log { - my ($str) = (@_); - Lock(); - open(FID, ">>$datadir/maillog") || die "Can't write to $datadir/maillog"; - print FID time2str("%D %H:%M", time()) . ": $str\n"; - close FID; - Unlock(); -} - -sub Lock { - if ($::lockcount <= 0) { - $::lockcount = 0; - open(LOCKFID, ">>$datadir/maillock") || die "Can't open $datadir/maillock: $!"; - my $val = flock(LOCKFID,2); - if (!$val) { # '2' is magic 'exclusive lock' const. - print Bugzilla->cgi->header(); - print "Lock failed: $val\n"; - } - chmod 0666, "$datadir/maillock"; - } - $::lockcount++; -} - -sub Unlock { - $::lockcount--; - if ($::lockcount <= 0) { - flock(LOCKFID,8); # '8' is magic 'unlock' const. - close LOCKFID; - } } @@ -36,8 +36,6 @@ use Bugzilla::Bug; use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::BugMail; -$::lockcount = 0; - unless ( Param("move-enabled") ) { print "\n<P>Sorry. Bug moving is not enabled here. "; print "If you need to move a bug, contact " . Param("maintainer"); @@ -48,37 +46,6 @@ Bugzilla->login(LOGIN_REQUIRED); my $cgi = Bugzilla->cgi; -sub Log { - my ($str) = (@_); - Lock(); - open(FID, ">>$datadir/maillog") || die "Can't write to $datadir/maillog"; - print FID time2str("%D %H:%M", time()) . ": $str\n"; - close FID; - Unlock(); -} - -sub Lock { - if ($::lockcount <= 0) { - $::lockcount = 0; - open(LOCKFID, ">>$datadir/maillock") || die "Can't open $datadir/maillock: $!"; - my $val = flock(LOCKFID,2); - if (!$val) { # '2' is magic 'exclusive lock' const. - print $cgi->header(); - print "Lock failed: $val\n"; - } - chmod 0666, "$datadir/maillock"; - } - $::lockcount++; -} - -sub Unlock { - $::lockcount--; - if ($::lockcount <= 0) { - flock(LOCKFID,8); # '8' is magic 'unlock' const. - close LOCKFID; - } -} - if (!defined $cgi->param('buglist')) { print $cgi->header(); $template->put_header("Move Bugs"); @@ -171,6 +138,3 @@ $template->process("bug/show.xml.tmpl", { bugs => \@bugs, $msg .= "\n"; Bugzilla::BugMail::MessageToMTA($msg); - -my $logstr = "XML: bugs $buglist sent to $to"; -Log($logstr); |