Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 299881 Details for
Bug 406301
3.20: Log4perl support (keys added to data/params as well) Bugzilla/RH.pm
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
v2 for log4perl logging code added to BZ 3.2
logging_patch (text/plain), 36.66 KB, created by
Noura El hawary
on 2008-04-01 12:27:44 UTC
(
hide
)
Description:
v2 for log4perl logging code added to BZ 3.2
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-04-01 12:27:44 UTC
Size:
36.66 KB
patch
obsolete
>Index: Bugzilla.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla.pm,v >retrieving revision 1.8 >diff -p -u -r1.8 Bugzilla.pm >--- Bugzilla.pm 17 Mar 2008 21:41:30 -0000 1.8 >+++ Bugzilla.pm 1 Apr 2008 06:46:32 -0000 >@@ -53,6 +53,24 @@ use File::Basename; > use File::Spec::Functions; > use Safe; > >+# REDHAT EXTENSION BEGIN 406301 >+# add Log4perl support >+use Log::Log4perl; >+use Log::Log4perl::MDC; >+use Time::HiRes; >+ >+sub logger { >+ Log::Log4perl::get_logger(""); >+} >+ >+sub log_filename { >+ Log::Log4perl::appender_by_name('LOGFILE')->filename; >+} >+ >+my $t0; >+# REDHAT EXTENSION END 406301 >+ >+ > # This creates the request cache for non-mod_perl installations. > our $_request_cache = {}; > >@@ -175,6 +193,28 @@ sub init_page { > print $t_output . "\n"; > exit; > } >+ >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ # add Log4perl support >+ $t0 = [Time::HiRes::gettimeofday]; >+ eval { >+ my $conf = Bugzilla->params->{log4perl_config}; >+ Log::Log4perl::init_once(\$conf) >+ }; >+ if (my $e = $@) { >+ warn "config failed to load: $e"; >+ my $conf = Bugzilla::Constants::LOG4PERL_DEFAULT_CONFIG; >+ Log::Log4perl::init_once(\$conf); # should _always_ work >+ } >+ # code these in the log layout pattern as %X{<key>} >+ Log::Log4perl::MDC->put( script => $0 ); >+ Log::Log4perl::MDC->put( http_x_forwarded_for => $ENV{HTTP_X_FORWARDED_FOR} ); >+ Log::Log4perl::MDC->put( remote_addr => $ENV{REMOTE_ADDR} ); >+ # start a log message. the begin section should ensure >+ # that the config is loaded >+ Log::Log4perl::get_logger("")->debug("START"); >+ # REDHAT EXTENSION END 406301 > } > > init_page() if !$ENV{MOD_PERL}; >@@ -282,7 +322,15 @@ sub login { > else { > $class->set_user($authenticated_user); > } >- >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ # Log4perl support >+ # code these in the log layout pattern as %X{<key>} >+ Log::Log4perl::MDC->put( user_id => $class->user->id ); >+ Log::Log4perl::MDC->put( user_name => $class->user->name ); >+ Log::Log4perl::MDC->put( user_login => $class->user->login ); >+ # REDHAT EXTENSION END 406301 >+ > return $class->user; > } > >@@ -496,6 +544,13 @@ sub _cleanup { > $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction; > $dbh->disconnect; > } >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ # Log4perl support >+ my $elapsed = Time::HiRes::tv_interval ( $t0, [Time::HiRes::gettimeofday]); >+ Log::Log4perl::get_logger("")->debug(sprintf("FINISH ELAPSED=%8.4f", $elapsed)); >+ # REDHAT EXTENSION END 406301 >+ > undef $_request_cache; > } > >Index: Bugzilla/Constants.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Constants.pm,v >retrieving revision 1.8 >diff -p -u -r1.8 Constants.pm >--- Bugzilla/Constants.pm 17 Mar 2008 21:48:07 -0000 1.8 >+++ Bugzilla/Constants.pm 1 Apr 2008 06:46:55 -0000 >@@ -426,6 +426,18 @@ use constant MAX_COMPONENT_SIZE => 64; > # Maximum length allowed for free text fields. > use constant MAX_FREETEXT_LENGTH => 255; > >+# REDHAT EXTENSION BEGIN 406301 >+# default log4perl config >+use constant LOG4PERL_DEFAULT_CONFIG => q( >+log4perl.rootLogger=DEBUG, LOGFILE >+log4perl.appender.LOGFILE=Log::Log4perl::Appender::File >+log4perl.appender.LOGFILE.filename=/tmp/bz.log >+log4perl.appender.LOGFILE.mode=append >+log4perl.appender.LOGFILE.layout=PatternLayout >+log4perl.appender.LOGFILE.layout.ConversionPattern=[%d.%r] [%H;%P] [%p] [%X{script}:%X{userid}:%X{username}:%X{userlogin}] [%l] - %m%n >+); >+# REDHAT EXTENSION END 406301 >+ > sub bz_locations { > # We know that Bugzilla/Constants.pm must be in %INC at this point. > # So the only question is, what's the name of the directory >Index: Bugzilla/Config/Admin.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Config/Admin.pm,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 Admin.pm >--- Bugzilla/Config/Admin.pm 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ Bugzilla/Config/Admin.pm 1 Apr 2008 06:47:16 -0000 >@@ -34,6 +34,7 @@ package Bugzilla::Config::Admin; > use strict; > > use Bugzilla::Config::Common; >+use Bugzilla::Constants; > > $Bugzilla::Config::Admin::sortkey = "01"; > >@@ -62,7 +63,17 @@ sub get_param_list { > name => 'supportwatchers', > type => 'b', > default => 0 >- } ); >+ }, >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ # Log4perl param >+ { >+ name => 'log4perl_config', >+ type => 'l', >+ default => Bugzilla::Constants::LOG4PERL_DEFAULT_CONFIG, >+ } >+ # REDHAT EXTENSION END 406301 >+ ); > return @param_list; > } > >Index: template/en/default/admin/params/admin.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/admin/params/admin.html.tmpl,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 admin.html.tmpl >--- template/en/default/admin/params/admin.html.tmpl 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ template/en/default/admin/params/admin.html.tmpl 1 Apr 2008 06:47:34 -0000 >@@ -23,6 +23,9 @@ > desc = "Set up account policies" > %] > >+[%# REDHAT EXTENSION 406301 >+ log4perl_config param description >+%] > [% param_descs = { > allowbugdeletion => "The pages to edit products and components can delete all " _ > "associated $terms.bugs when you delete a product (or component). " _ >@@ -41,5 +44,8 @@ > > supportwatchers => "Support one user watching (ie getting copies of all related " _ > "email about) another's ${terms.bugs}. Useful for people going on " _ >- "vacation, and QA folks watching particular developers' ${terms.bugs}." } >-%] >\ No newline at end of file >+ "vacation, and QA folks watching particular developers' ${terms.bugs}.", >+ >+ log4perl_config => "Enable logging of Web UI and XMLRPC requests by entering the log4perl " _ >+ "conf file in the text box."} >+%] >Index: show_bug.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/show_bug.cgi,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 show_bug.cgi >--- show_bug.cgi 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ show_bug.cgi 1 Apr 2008 06:47:59 -0000 >@@ -37,6 +37,11 @@ my $vars = {}; > > my $user = Bugzilla->login(); > >+# REDHAT EXTENSION BEGIN 406301 >+my $logger = Bugzilla->logger; >+$logger->debug("starting. CGI input parameters: ". $cgi->query_string); >+# REDHAT EXTENSION END 406301 >+ > # Editable, 'single' HTML bugs are treated slightly specially in a few places > my $single = !$cgi->param('format') > && (!$cgi->param('ctype') || $cgi->param('ctype') eq 'html'); >@@ -46,6 +51,9 @@ if (!$cgi->param('id') && $single) { > print Bugzilla->cgi->header(); > $template->process("bug/choose.html.tmpl", $vars) || > ThrowTemplateError($template->error()); >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("done. calling bug/choose.html.tmpl"); >+ # REDHAT EXTENSION END 406301 > exit; > } > >@@ -141,3 +149,8 @@ print $cgi->header($format->{'ctype'}); > > $template->process("$format->{'template'}", $vars) > || ThrowTemplateError($template->error()); >+ >+# REDHAT EXTENSION BEGIN 406301 >+$logger->debug("done"); >+# REDHAT EXTENSION END 406301 >+ >Index: process_bug.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/process_bug.cgi,v >retrieving revision 1.20 >diff -p -u -r1.20 process_bug.cgi >--- process_bug.cgi 26 Mar 2008 19:07:33 -0000 1.20 >+++ process_bug.cgi 1 Apr 2008 06:48:25 -0000 >@@ -62,6 +62,11 @@ use Bugzilla::Status; > > use Storable qw(dclone); > >+# REDHAT EXTENSION BEGIN 406301 >+my $logger = Bugzilla->logger; >+$logger->debug("starting"); >+# REDHAT EXTENSION END 406301 >+ > my $user = Bugzilla->login(LOGIN_REQUIRED); > > my $cgi = Bugzilla->cgi; >@@ -196,6 +201,9 @@ if (defined $cgi->param('delta_ts') > # Warn the user about the mid-air collision and ask them what to do. > $template->process("bug/process/midair.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("done. calling bug/process/midair.html.tmpl"); >+ # REDHAT EXTENSION END 406301 > exit; > } > >@@ -480,6 +488,9 @@ if ($move_action eq Bugzilla->params->{' > $template->process("global/footer.html.tmpl", $vars) > || ThrowTemplateError($template->error()); > } >+ # REDHAT EXTENSION END 406301 >+ $logger->debug("done. calling bug/show.xml.tmpl"); >+ # REDHAT EXTENSION END 406301 > exit; > } > >@@ -641,7 +652,9 @@ elsif ($action eq 'next_bug') { > > $template->process("bug/show.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >- >+ # REDHAT EXTENSION END 406301 >+ $logger->debug("done. calling bug/show.html.tmpl"); >+ # REDHAT EXTENSION END 406301 > exit; > } > } >@@ -654,7 +667,9 @@ elsif ($action eq 'next_bug') { > > $template->process("bug/show.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >- >+ # REDHAT EXTENSION END 406301 >+ $logger->debug("done. calling bug/show.html.tmpl"); >+ # REDHAT EXTENSION END 406301 > exit; > } > } elsif ($action ne 'nothing') { >@@ -668,5 +683,8 @@ unless (Bugzilla->usage_mode == USAGE_MO > $template->process("global/footer.html.tmpl", $vars) > || ThrowTemplateError($template->error()); > } >+# REDHAT EXTENSION BEGIN 406301 >+$logger->debug("done."); >+# REDHAT EXTENSION END 406301 > > 1; >Index: buglist.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/buglist.cgi,v >retrieving revision 1.12 >diff -p -u -r1.12 buglist.cgi >--- buglist.cgi 18 Mar 2008 14:16:08 -0000 1.12 >+++ buglist.cgi 1 Apr 2008 06:48:42 -0000 >@@ -56,6 +56,11 @@ my $template = Bugzilla->template; > my $vars = {}; > my $buffer = $cgi->query_string(); > >+# REDHAT EXTENSION BEGIN 406301 >+my $logger = Bugzilla->logger; >+$logger->debug("CGI input parameters: $buffer"); >+# REDHAT EXTENSION END 406301 >+ > # We have to check the login here to get the correct footer if an error is > # thrown and to prevent a logged out user to use QuickSearch if 'requirelogin' > # is turned 'on'. >@@ -947,10 +952,17 @@ $dbh = Bugzilla->switch_to_shadow_db(); > $::SIG{TERM} = 'DEFAULT'; > $::SIG{PIPE} = 'DEFAULT'; > >+# REDHAT EXTENSION BEGIN 406301 >+$logger->debug("sql query before execution: [ $query ]"); >+# REDHAT EXTENSION END 406301 >+ > # Execute the query. > my $buglist_sth = $dbh->prepare($query); > $buglist_sth->execute(); > >+# REDHAT EXTENSION BEGIN 406301 >+$logger->debug("sql query executed"); >+# REDHAT EXTENSION END 406301 > > ################################################################################ > # Results Retrieval >Index: request.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/request.cgi,v >retrieving revision 1.3 >diff -p -u -r1.3 request.cgi >--- request.cgi 14 Feb 2008 03:17:47 -0000 1.3 >+++ request.cgi 1 Apr 2008 06:49:36 -0000 >@@ -111,6 +111,11 @@ sub queue { > my $status = validateStatus($cgi->param('status')); > my $form_group = validateGroup($cgi->param('group')); > >+ # REDHAT EXTENSION BEGIN 406301 >+ my $logger = Bugzilla->logger; >+ $logger->debug("CGI input parameters: " . $cgi->query_string); >+ # REDHAT EXTENSION END 406301 >+ > my $query = > # Select columns describing each flag, the bug/attachment on which > # it has been set, who set it, and of whom they are requesting it. >@@ -296,8 +301,17 @@ sub queue { > # Pass the query to the template for use when debugging this script. > $vars->{'query'} = $query; > $vars->{'debug'} = $cgi->param('debug') ? 1 : 0; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("sql query before execution: [ $query ]"); >+ # REDHAT EXTENSION END 406301 > > my $results = $dbh->selectall_arrayref($query); >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("sql query executed"); >+ # REDHAT EXTENSION END 406301 >+ > my @requests = (); > foreach my $result (@$results) { > my @data = @$result; >Index: Bugzilla/BugMail.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/BugMail.pm,v >retrieving revision 1.12 >diff -p -u -r1.12 BugMail.pm >--- Bugzilla/BugMail.pm 17 Mar 2008 21:48:07 -0000 1.12 >+++ Bugzilla/BugMail.pm 1 Apr 2008 06:49:52 -0000 >@@ -42,6 +42,7 @@ use Bugzilla::Product; > use Bugzilla::Component; > use Bugzilla::Status; > use Bugzilla::Mailer; >+use Bugzilla; > > use Date::Parse; > use Date::Format; >@@ -65,6 +66,10 @@ use constant REL_NAMES => { > REL_GLOBAL_WATCHER, "GlobalWatcher" > }; > >+# REDHAT EXTENSION BEGIN 406301 >+my $logger = Bugzilla->logger; >+# REDHAT EXTENSION END 406301 >+ > # We use this instead of format because format doesn't deal well with > # multi-byte languages. > sub multiline_sprintf { >@@ -112,6 +117,10 @@ sub three_columns { > sub Send { > my ($id, $forced) = (@_); > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("bug_id: $id"); >+ # REDHAT EXTENSION END 406301 >+ > my @headerlist; > my %defmailhead; > my %fielddescription; >@@ -553,6 +562,10 @@ sub sendMail { > $diffRef, $newcomments, $anyprivate, $isnew, > $id, $watchingRef) = @_; > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("user id: " . $user->id); >+ # REDHAT EXTENSION END 406301 >+ > my %values = %$valueRef; > my @headerlist = @$hlRef; > my %mailhead = %$dmhRef; >Index: report.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/report.cgi,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 report.cgi >--- report.cgi 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ report.cgi 1 Apr 2008 06:50:09 -0000 >@@ -35,6 +35,11 @@ my $template = Bugzilla->template; > my $vars = {}; > my $buffer = $cgi->query_string(); > >+# REDHAT EXTENSION BEGIN 406301 >+my $logger = Bugzilla->logger; >+$logger->debug("CGI input parameters: $buffer"); >+# REDHAT EXTENSION END 406301 >+ > # Go straight back to query.cgi if we are adding a boolean chart. > if (grep(/^cmd-/, $cgi->param())) { > my $params = $cgi->canonicalise_query("format", "ctype"); >@@ -146,8 +151,16 @@ my $query = $search->getSQL(); > $::SIG{TERM} = 'DEFAULT'; > $::SIG{PIPE} = 'DEFAULT'; > >+# REDHAT EXTENSION BEGIN 406301 >+$logger->debug("sql query before execution: [ $query ]"); >+# REDHAT EXTENSION END 406301 >+ > my $results = $dbh->selectall_arrayref($query); > >+# REDHAT EXTENSION BEGIN 406301 >+$logger->debug("sql query executed"); >+# REDHAT EXTENSION END 406301 >+ > # We have a hash of hashes for the data itself, and a hash to hold the > # row/col/table names. > my %data; >Index: Bugzilla/Error.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Error.pm,v >retrieving revision 1.2 >diff -p -u -r1.2 Error.pm >--- Bugzilla/Error.pm 28 Jan 2008 04:46:17 -0000 1.2 >+++ Bugzilla/Error.pm 1 Apr 2008 06:50:30 -0000 >@@ -114,10 +114,26 @@ sub _throw_error { > } > > sub ThrowUserError { >+ # REDHAT EXTENSION BEGIN 406301 >+ eval { >+ # eval so that the error logging doesn't >+ # impede the error reporting to UI >+ local $" = ', '; >+ Bugzilla->logger()->error("@_"); >+ }; >+ # REDHAT EXTENSION END 406301 > _throw_error("global/user-error.html.tmpl", @_); > } > > sub ThrowCodeError { >+ # REDHAT EXTENSION BEGIN 406301 >+ eval { >+ # eval so that the error logging doesn't >+ # impede the error reporting to UI >+ local $" = ', '; >+ Bugzilla->logger()->error("@_"); >+ }; >+ # REDHAT EXTENSION END 406301 > _throw_error("global/code-error.html.tmpl", @_); > } > >@@ -125,6 +141,15 @@ sub ThrowTemplateError { > my ($template_err) = @_; > my $dbh = Bugzilla->dbh; > >+ # REDHAT EXTENSION BEGIN 406301 >+ eval { >+ # eval so that the error logging doesn't >+ # impede the error reporting to UI >+ local $" = ', '; >+ Bugzilla->logger()->error("@_"); >+ }; >+ # REDHAT EXTENSION END 406301 >+ > # Make sure the transaction is rolled back (if supported). > $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction(); > >Index: Bugzilla/Mailer.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Mailer.pm,v >retrieving revision 1.8 >diff -p -u -r1.8 Mailer.pm >--- Bugzilla/Mailer.pm 19 Mar 2008 03:13:24 -0000 1.8 >+++ Bugzilla/Mailer.pm 1 Apr 2008 06:50:47 -0000 >@@ -54,6 +54,12 @@ use Email::Send; > sub MessageToMTA { > my ($msg) = (@_); > my $method = Bugzilla->params->{'mail_delivery_method'}; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ my $logger = Bugzilla->logger; >+ $logger->debug("Starting: mail delivery with $method method"); >+ # REDHAT EXTENSION END 406301 >+ > return if $method eq 'None'; > > my $email = ref($msg) ? $msg : Email::MIME->new($msg); >@@ -146,6 +152,10 @@ sub MessageToMTA { > ThrowCodeError('mail_send_error', { msg => $retval, mail => $email }) > if !$retval; > } >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("done."); >+ # REDHAT EXTENSION END 406301 > } > > 1; >Index: extensions/compat_xmlrpc/code/webservice.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/extensions/compat_xmlrpc/code/webservice.pl,v >retrieving revision 1.21 >diff -p -u -r1.21 webservice.pl >--- extensions/compat_xmlrpc/code/webservice.pl 27 Mar 2008 17:10:08 -0000 1.21 >+++ extensions/compat_xmlrpc/code/webservice.pl 1 Apr 2008 06:51:22 -0000 >@@ -43,6 +43,8 @@ use Bugzilla::User; > use Bugzilla::Util; > use Bugzilla::Flag; > >+my $logger = Bugzilla->logger; >+ > =head1 NAME > > Bugzilla::RPC::Bug - XMLRPC Methods for obtaining and setting Bugzilla report attributes. >@@ -127,6 +129,8 @@ sub getBugSimple { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $id, $username"); >+ > # Connect to the shadow database if this installation is using one to improve performance > Bugzilla->switch_to_shadow_db(); > >@@ -206,6 +210,8 @@ sub getBug { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $id, $username"); >+ > ValidateBugID($id); > my $bug = new Bugzilla::Bug($id); > ThrowCodeError("bug_error", { bug => $bug }) if $bug->error; >@@ -308,6 +314,8 @@ sub getBugCVS { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $id, $username"); >+ > Bugzilla->user->login eq 'cvs@redhat.com' > || ThrowUserError("invalid_username_or_password"); > >@@ -399,6 +407,8 @@ sub createBug { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $username"); >+ > # Remap custom field names from normal names > my %custom_field_map = ( > 'cust_facing' => 'cf_cust_facing', >@@ -495,6 +505,8 @@ sub addComment { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $id, $username"); >+ > # Check parameters > defined $id || ThrowCodeError( 'param_required', { param => 'id' } ); > ValidateBugID($id); >@@ -567,6 +579,8 @@ sub changeStatus { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $id, $newvalue, $username"); >+ > ValidateBugID($id); > > my $bug = new Bugzilla::Bug($id); >@@ -650,6 +664,8 @@ sub closeBug { > > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); >+ >+ $logger->debug("Starting: $id, $newresolution, $username"); > > ValidateBugID($id); > >@@ -738,6 +754,8 @@ sub changeAssignment { > > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); >+ >+ $logger->debug("Starting: $id, $username"); > > ValidateBugID($id); > >@@ -816,6 +834,8 @@ sub updateDepends { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $bug_id, $username"); >+ > ValidateBugID($bug_id); > my $bug = Bugzilla::Bug->new($bug_id); > >@@ -900,6 +920,8 @@ sub runQuery { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $username"); >+ > # HACK: We need to do this otherwise CGI always treats as POST > delete $ENV{CONTENT_TYPE}; > >@@ -1225,6 +1247,8 @@ sub getBugModified { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: " . join(',', @{$bugsref}) . ", $username"); >+ > foreach my $id (@{$bugsref}) { > my $bug = new Bugzilla::Bug($id); > if ($bug->{error}) { >@@ -1254,6 +1278,8 @@ sub updateFlags { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $bug_id, $username"); >+ > ValidateBugID($bug_id); > my $bug = new Bugzilla::Bug($bug_id); > >@@ -1444,6 +1470,8 @@ sub getBugActivity { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $bug_id, $username"); >+ > ValidateBugID($bug_id); > $item{id} = $bug_id; > >@@ -1608,6 +1636,8 @@ sub updateMilestone { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $bug_id, $username"); >+ > ValidateBugID($bug_id); > my $bug = new Bugzilla::Bug($bug_id); > >@@ -1670,6 +1700,8 @@ sub updateCC { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $data_ref->{'id'}, $username"); >+ > my $action > = ( $data_ref->{'action'} eq 'add' > || $data_ref->{'action'} eq 'remove' >@@ -1906,6 +1938,8 @@ sub updatePriority { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $data_ref->{bug_id}, $username"); >+ > # Validate if can see this bug and if exists > ValidateBugID($id); > my $bug = new Bugzilla::Bug($id); >@@ -1956,6 +1990,8 @@ sub updateSeverity { > > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); >+ >+ $logger->debug("Starting: $data_ref->{bug_id}, $username"); > > # Validate if can see this bug and if exists > ValidateBugID($id); >@@ -1997,6 +2033,8 @@ sub getBugFields { > # Try to login if $username and $password provided. > xmlrpc_client_login( $username, $password ); > >+ $logger->debug("Starting: $username"); >+ > foreach my $field( Bugzilla->get_fields() ) { > my $name = $field->name; > $name =~ s/^cf_//; # Remove custom field designation >@@ -2175,6 +2213,8 @@ a string the contains list of the keywor > sub login { > my ( $self, $username, $password, $remember ) = @_; > >+ $logger->debug("Starting: $username"); >+ > # Convert $remember from a boolean 0/1 value to a CGI-compatible one. > if ( defined($remember) ) { > $remember = $remember ? 'on' : ''; >@@ -2204,6 +2244,8 @@ sub userInfo { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $user, $login"); >+ > if ( !Bugzilla->user or !Bugzilla->user->in_group('editusers') ) { > ThrowUserError("authorization_failure", { action => "edit user accounts" }); > } >@@ -2229,6 +2271,8 @@ sub nameToId { > > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); >+ >+ $logger->debug("Starting: $login, $username"); > > Bugzilla->user->in_group('editusers') > || ThrowUserError("auth_failure", { group => "editusers", >@@ -2244,6 +2288,8 @@ sub idToName { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $userid, $username"); >+ > Bugzilla->user->in_group('editusers') > || ThrowUserError("auth_failure", { group => "editusers", > action => "use", >@@ -2345,6 +2391,8 @@ sub addUser { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $login, $realname, $username"); >+ > Bugzilla->user->in_group('editusers') > || ThrowUserError("auth_failure", { group => "editusers", > action => "add", >@@ -2464,6 +2512,8 @@ sub editComponent { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $data_ref->{component}, $username"); >+ > Bugzilla->user->in_group('editcomponents') > || scalar(@{Bugzilla->user->get_products_by_permission('editcomponents')}) > || ThrowUserError("auth_failure", {group => "editcomponents", >@@ -2617,6 +2667,8 @@ sub addComponent { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); > >+ $logger->debug("Starting: $data_ref->{component}, $username"); >+ > Bugzilla->user->in_group('editcomponents') > || scalar(@{Bugzilla->user->get_products_by_permission('editcomponents')}) > || ThrowUserError("auth_failure", {group => "editcomponents", >@@ -2764,6 +2816,8 @@ sub getCompInfo { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $component, $username"); >+ > my @accessible_components; > > # Connect to the shadow database to improve performance. >@@ -2829,6 +2883,8 @@ sub getProdInfo { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $username"); >+ > my $dbh = Bugzilla->switch_to_shadow_db(); > > my $sth = $dbh->prepare("SELECT name, description FROM products " >@@ -2876,6 +2932,8 @@ sub getProdCompDetails { > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password); > >+ $logger->debug("Starting: $product, $username"); >+ > my $product_obj = Bugzilla::Product->check($product) > if Bugzilla->user->can_enter_product($product, THROW_ERROR); > >@@ -2910,6 +2968,8 @@ sub getProductDetails { > > # Try to login if $username and $password provided. > xmlrpc_client_login($username, $password, LOGIN_REQUIRED); >+ >+ $logger->debug("Starting: $product, $username"); > > my $product_obj = Bugzilla::Product->check($product) > if Bugzilla->user->can_enter_product($product, THROW_ERROR); >Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.9 >diff -p -u -r1.9 Bug.pm >--- Bugzilla/WebService/Bug.pm 14 Mar 2008 04:33:20 -0000 1.9 >+++ Bugzilla/WebService/Bug.pm 1 Apr 2008 06:51:42 -0000 >@@ -38,6 +38,11 @@ use Bugzilla::Search::Saved; > use Bugzilla::Util; > use Bugzilla::Status; > >+# REDHAT EXTENSION BEGIN 406301 >+use Bugzilla; >+my $logger = Bugzilla->logger; >+# REDHAT EXTENSION END 406301 >+ > ############# > # Constants # > ############# >@@ -77,6 +82,11 @@ BEGIN { *get_bugs = \&get } > sub get { > my ($self, $params) = @_; > my $ids = $params->{ids}; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: @$ids, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > defined $ids || ThrowCodeError('param_required', { param => 'ids' }); > > my @return; >@@ -124,6 +134,10 @@ sub get { > sub get_activity { > my ($self, $params) = @_; > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: @{$params->{ids}}, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my @ids = ref($params->{ids}) ? @{$params->{ids}} : ($params->{ids}); > @ids || ThrowCodeError('param_required', { param => 'ids' }); > >@@ -156,6 +170,10 @@ sub create { > > Bugzilla->login(LOGIN_REQUIRED); > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my %field_values; > foreach my $field (keys %$params) { > my $field_name = FIELD_MAP->{$field} || $field; >@@ -174,6 +192,11 @@ sub create { > > sub legal_values { > my ($self, $params) = @_; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: product => $params->{product_id}, field => $params->{field}, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my $field = FIELD_MAP->{$params->{field}} || $params->{field}; > > my @custom_select = >@@ -223,6 +246,10 @@ sub add_comment { > > #The user must login in order add a comment > Bugzilla->login(LOGIN_REQUIRED); >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: $params->{id}, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 > > # Check parameters > defined $params->{id} >@@ -250,6 +277,11 @@ sub add_comment { > > sub search { > my ($self, $params) = @_; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: ", Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my $dbh = Bugzilla->dbh; > my $search_params; > >@@ -480,10 +512,18 @@ sub search { > # a large number of times. > $::SIG{TERM} = 'DEFAULT'; > $::SIG{PIPE} = 'DEFAULT'; >- >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("sql query before execution: [ $query ]"); >+ # REDHAT EXTENSION END 406301 >+ > # Execute the query. > my $buglist_sth = $dbh->prepare($query); > $buglist_sth->execute(); >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("sql query executed"); >+ # REDHAT EXTENSION END 406301 > > my @bugs; > my @bugidlist; >@@ -549,6 +589,10 @@ sub update { > my ($self, $params) = @_; > my $user = Bugzilla->login(LOGIN_REQUIRED); > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: ids => @{$params->{ids}}, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > $params->{ids} || ThrowCodeError('param_required', { param => 'ids' }); > my $updates = $params->{updates} || ThrowCodeError('param_required', { param => 'updates' }); > >Index: Bugzilla/WebService/Component.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Component.pm,v >retrieving revision 1.2 >diff -p -u -r1.2 Component.pm >--- Bugzilla/WebService/Component.pm 11 Mar 2008 04:31:26 -0000 1.2 >+++ Bugzilla/WebService/Component.pm 1 Apr 2008 06:52:01 -0000 >@@ -32,6 +32,11 @@ use Bugzilla::Error; > use Bugzilla::Util qw(trim); > import SOAP::Data qw(type); > >+# REDHAT EXTENSION BEGIN 406301 >+use Bugzilla; >+my $logger = Bugzilla->logger; >+# REDHAT EXTENSION END 406301 >+ > > # function to return component information when passed either, > # component ids or component and product names or both togther. >@@ -46,6 +51,10 @@ import SOAP::Data qw(type); > sub get { > my ($self, $params) = @_; > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my $accessible_components = _get_accessible_components($params); > > my @components; >@@ -103,6 +112,10 @@ sub update { > > my $user = Bugzilla->login(LOGIN_REQUIRED); > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > $user->in_group('editcomponents') > || scalar(@{$user->get_products_by_permission('editcomponents')}) > || ThrowUserError("auth_failure", {group => "editcomponents", >@@ -187,6 +200,10 @@ sub create { > > my $user = Bugzilla->login(LOGIN_REQUIRED); > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > $user->in_group('editcomponents') > || scalar(@{$user->get_products_by_permission('editcomponents')}) > || ThrowUserError("auth_failure", {group => "editcomponents", >Index: Bugzilla/WebService/Product.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Product.pm,v >retrieving revision 1.1.1.1 >diff -p -u -r1.1.1.1 Product.pm >--- Bugzilla/WebService/Product.pm 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ Bugzilla/WebService/Product.pm 1 Apr 2008 06:52:13 -0000 >@@ -23,24 +23,45 @@ use Bugzilla::Product; > use Bugzilla::User; > import SOAP::Data qw(type); > >+# REDHAT EXTENSION BEGIN 406301 >+use Bugzilla; >+my $logger = Bugzilla->logger; >+# REDHAT EXTENSION END 406301 >+ > # Get the ids of the products the user can search > sub get_selectable_products { >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > return {ids => [map {$_->id} @{Bugzilla->user->get_selectable_products}]}; > } > > # Get the ids of the products the user can enter bugs against > sub get_enterable_products { >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > return {ids => [map {$_->id} @{Bugzilla->user->get_enterable_products}]}; > } > > # Get the union of the products the user can search and enter bugs against. > sub get_accessible_products { >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > return {ids => [map {$_->id} @{Bugzilla->user->get_accessible_products}]}; > } > > # Get a list of actual products, based on list of ids > sub get_products { > my ($self, $params) = @_; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: ids => @{$params->{ids}}, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 > > # Only products that are in the users accessible products, > # can be allowed to be returned >Index: Bugzilla/WebService/User.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/User.pm,v >retrieving revision 1.10 >diff -p -u -r1.10 User.pm >--- Bugzilla/WebService/User.pm 11 Mar 2008 05:40:33 -0000 1.10 >+++ Bugzilla/WebService/User.pm 1 Apr 2008 06:52:23 -0000 >@@ -31,12 +31,22 @@ use Bugzilla::User; > use Bugzilla::Util qw(trim); > use Bugzilla::Token; > >+# REDHAT EXTENSION BEGIN 406301 >+use Bugzilla; >+my $logger = Bugzilla->logger; >+# REDHAT EXTENSION END 406301 >+ > ############## > # User Login # > ############## > > sub login { > my ($self, $params) = @_; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: $params->{login}"); >+ # REDHAT EXTENSION END 406301 >+ > my $remember = $params->{remember}; > > # Convert $remember from a boolean 0/1 value to a CGI-compatible one. >@@ -61,6 +71,11 @@ sub login { > > sub logout { > my $self = shift; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > Bugzilla->logout; > return undef; > } >@@ -72,6 +87,11 @@ sub logout { > sub offer_account_by_email { > my $self = shift; > my ($params) = @_; >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: email => $params->{email}" . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my $email = trim($params->{email}) > || ThrowCodeError('param_required', { param => 'email' }); > >@@ -95,6 +115,11 @@ sub create { > my $self = shift; > my ($params) = @_; > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: new login => $params->{email}" . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ >+ > Bugzilla->user->in_group('editusers') > || ThrowUserError("auth_failure", { group => "editusers", > action => "add", >@@ -125,6 +150,10 @@ sub create { > sub get { > my ($self, $params) = @_; > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my @names = ref($params->{names}) ? @{$params->{names}} : > ($params->{names}); > >@@ -199,6 +228,11 @@ sub update { > my ($self, $params) = @_; > > my $user = Bugzilla->login(LOGIN_REQUIRED); >+ >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my $editusers = $user->in_group('editusers'); > > # Reject access if there is no sense in continuing.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dkl
: review+
Actions:
View
|
Diff
Attachments on
bug 406301
:
299688
| 299881