From: justdave%bugzilla.org <> Date: Thu, 17 Apr 2008 04:15:33 +0000 (+0000) Subject: Bug 429378: collectstats.pl fails if ./graphs is a symlink X-Git-Tag: bugzilla-3.0.4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c4cb947fec888b5e79359f6820e281d3af72235;p=thirdparty%2Fbugzilla.git Bug 429378: collectstats.pl fails if ./graphs is a symlink r=mkanat, a=mkanat --- diff --git a/collectstats.pl b/collectstats.pl index 80c70fe2be..e9aad392f0 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -33,6 +33,7 @@ use AnyDBM_File; use strict; use IO::Handle; +use Cwd; use lib "."; @@ -50,10 +51,12 @@ use Bugzilla::Field; $| = 1; # Tidy up after graphing module +my $cwd = Cwd::getcwd(); if (chdir("graphs")) { unlink <./*.gif>; unlink <./*.png>; - chdir(".."); + # chdir("..") doesn't work if graphs is a symlink, see bug 429378 + chdir($cwd); } # This is a pure command line script. @@ -61,6 +64,7 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE); my $dbh = Bugzilla->switch_to_shadow_db(); + # To recreate the daily statistics, run "collectstats.pl --regenerate" . my $regenerate = 0; if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") { diff --git a/post_bug.cgi b/post_bug.cgi index 82317483b2..ea1b30b82a 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -53,6 +53,9 @@ my $vars = {}; # Main Script ###################################################################### +# redirect to enter_bug if no field is passed. +print $cgi->redirect(correct_urlbase() . 'enter_bug.cgi') unless $cgi->param(); + # Detect if the user already used the same form to submit a bug my $token = trim($cgi->param('token')); if ($token) {