Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 306553 Details for
Bug 447765
Sanitize email addresses from bug reports, attachments, activity for non-logged-in users
[?]
New
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.rh83 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]
Patch to sanitize email addresses for anonymous users (v2)
sanitize_email.patch (text/plain), 20.28 KB, created by
David Lawrence
on 2008-05-23 21:54:20 UTC
(
hide
)
Description:
Patch to sanitize email addresses for anonymous users (v2)
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-05-23 21:54:20 UTC
Size:
20.28 KB
patch
obsolete
>? bugzilla-3.2rh-20080523.1.tar.gz >? bugzilla.spec >? patches >Index: buglist.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/buglist.cgi,v >retrieving revision 1.15 >diff -u -r1.15 buglist.cgi >--- buglist.cgi 14 May 2008 03:30:09 -0000 1.15 >+++ buglist.cgi 23 May 2008 21:47:30 -0000 >@@ -813,6 +813,14 @@ > do { > my @order; > my @columnnames = map($columns->{lc($_)}->{'name'}, keys(%$columns)); >+ >+ # REDHAT EXTENSION START 447765 >+ # Map map_*.login_name to map_*.realname if not logged in >+ if (!Bugzilla->user->id) { >+ $order =~ s/map_(assigned_to|qa_contact|reporter)\.login_name/map_$1\.realname/; >+ } >+ # REDHAT EXTENSION END 447765 >+ > # A custom list of columns. Make sure each column is valid. > foreach my $fragment (split(/,/, $order)) { > $fragment = trim($fragment); >@@ -847,6 +855,13 @@ > $order = "bugs.bug_status, bugs.priority, map_assigned_to.login_name, bugs.bug_id"; > } > >+# REDHAT EXTENSION START 447765 >+# Map map_*.login_name to map_*.realname if not logged in >+if (!Bugzilla->user->id) { >+ $order =~ s/map_(assigned_to|qa_contact|reporter)\.login_name/map_$1\.realname/; >+} >+# REDHAT EXTENSION END 447765 >+ > # Make sure ORDER BY columns are included in the field list. > foreach my $fragment (split(/,/, $order)) { > $fragment = trim($fragment); >Index: request.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/request.cgi,v >retrieving revision 1.5 >diff -u -r1.5 request.cgi >--- request.cgi 23 Apr 2008 04:00:08 -0000 1.5 >+++ request.cgi 23 May 2008 21:47:31 -0000 >@@ -333,10 +333,20 @@ > 'category' => "$data[5]: $data[6]" , > 'attach_id' => $data[7] , > 'attach_summary' => $data[8] , >- 'requester' => ($data[9] ? "$data[9] <$data[10]>" : $data[10]) , >- 'requestee' => ($data[11] ? "$data[11] <$data[12]>" : $data[12]) , > 'created' => $data[13] > }; >+ >+ # REDHAT EXTENSION START 447765 >+ if (Bugzilla->user->id) { >+ $request->{requester} = ($data[9] ? "$data[9] <$data[10]>" : $data[10]); >+ $request->{requestee} = ($data[11] ? "$data[11] <$data[12]>" : $data[12]); >+ } >+ else { >+ $request->{requester} = $data[9]; >+ $request->{requestee} = $data[11]; >+ } >+ # REDHAT EXTENSION END 447765 >+ > push(@requests, $request); > } > >Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Bug.pm,v >retrieving revision 1.39 >diff -u -r1.39 Bug.pm >--- Bugzilla/Bug.pm 16 May 2008 19:45:56 -0000 1.39 >+++ Bugzilla/Bug.pm 23 May 2008 21:47:34 -0000 >@@ -3073,7 +3073,18 @@ > . $dbh->sql_string_concat('bugs_activity.fieldid', q{''}) . > "), fielddefs.name, bugs_activity.attach_id, " . > $dbh->sql_date_format('bugs_activity.bug_when', '%Y.%m.%d %H:%i:%s') . >- ", bugs_activity.removed, bugs_activity.added, profiles.login_name >+ ", bugs_activity.removed, bugs_activity.added"; >+ >+ # REDHAT EXTENSION START 447765 >+ if (Bugzilla->user->id) { >+ $query .= ", profiles.login_name"; >+ } >+ else { >+ $query .= ", profiles.realname"; >+ } >+ # REDHAT EXTENSION END 447765 >+ >+ $query .= " > FROM bugs_activity > $suppjoins > LEFT JOIN fielddefs >Index: Bugzilla/Search.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Search.pm,v >retrieving revision 1.25 >diff -u -r1.25 Search.pm >--- Bugzilla/Search.pm 9 May 2008 14:29:52 -0000 1.25 >+++ Bugzilla/Search.pm 23 May 2008 21:47:36 -0000 >@@ -1072,9 +1072,6 @@ > bug_severity => { name => "bugs.bug_severity", title => "Severity" }, > priority => { name => "bugs.priority", title => "Priority" }, > rep_platform => { name => "bugs.rep_platform", title => "Hardware" }, >- assigned_to => { name => "map_assigned_to.login_name", title => "Assignee" }, >- reporter => { name => "map_reporter.login_name", title => "Reporter" }, >- qa_contact => { name => "map_qa_contact.login_name", title => "QA Contact" }, > bug_status => { name => "bugs.bug_status", title => "Status" }, > resolution => { name => "bugs.resolution", title => "Resolution" }, > short_short_desc => { name => "bugs.short_desc", title => "Summary" }, >@@ -1119,6 +1116,19 @@ > # REDHAT EXTENSION END 406371 > }; > >+ # REDHAT EXTENSION START 447765 >+ if (Bugzilla->user->id) { >+ $columns->{assigned_to} = { name => "map_assigned_to.login_name", title => "Assignee" }; >+ $columns->{reporter} = { name => "map_reporter.login_name", title => "Reporter" }; >+ $columns->{qa_contact} = { name => "map_qa_contact.login_name", title => "QA Contact" }; >+ } >+ else { >+ $columns->{assigned_to} = { name => "map_assigned_to.realname", title => "Assignee" }; >+ $columns->{reporter} = { name => "map_reporter.realname", title => "Reporter" }; >+ $columns->{qa_contact} = { name => "map_qa_contact.realname", title => "QA Contact" }; >+ } >+ # REDHAT EXTENSION END 447765 >+ > if ($format->{'extension'} eq 'html') { > $columns->{"assigned_to_realname"} = > { name => "CASE WHEN map_assigned_to.realname = '' THEN map_assigned_to.login_name " . >Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.12 >diff -u -r1.12 Bug.pm >--- Bugzilla/WebService/Bug.pm 15 May 2008 18:57:14 -0000 1.12 >+++ Bugzilla/WebService/Bug.pm 23 May 2008 21:47:37 -0000 >@@ -122,6 +122,25 @@ > $item{'alias'} = undef; > } > >+ # REDHAT EXTENSION START 447765 >+ if (Bugzilla->user->id) { >+ $item->{internals}->{reporter} = type('string')->value($bug->reporter->login) >+ if $item->{internals}->reporter; >+ $item->{internals}->{assigned_to} = type('string')->value($bug->assigned_to->login) >+ if $item->{internals}->assigned_to; >+ $item->{internals}->{qa_contact} = type('string')->value($bug->qa_contact->login) >+ if $item->{internals}->qa_contact; >+ } >+ else { >+ $item->{internals}->{reporter} = type('string')->value($bug->reporter->name) >+ if $item->{internals}->reporter; >+ $item->{internals}->{assigned_to} = type('string')->value($bug->assigned_to->name) >+ if $item->{internals}->assigned_to; >+ $item->{internals}->{qa_contact} = type('string')->value($bug->qa_contact->name) >+ if $item->{internals}->qa_contact; >+ } >+ # REDHAT EXTENSION END 447765 >+ > push(@return, \%item); > } > >@@ -433,6 +452,13 @@ > my $order = $params->{order} > || "bugs.bug_status, bugs.priority, map_assigned_to.login_name, bugs.bug_id"; > >+ # REDHAT EXTENSION START 447765 >+ # Map map_*.login_name to map_*.realname if not logged in >+ if (!Bugzilla->user->id) { >+ $order =~ s/map_(assigned_to|qa_contact|reporter)\.login_name/map_$1\.realname/; >+ } >+ # REDHAT EXTENSION END 447765 >+ > # Make sure ORDER BY columns are included in the field list. > foreach my $fragment (split(/,/, $order)) { > $fragment = trim($fragment); >Index: extensions/compat_xmlrpc/code/webservice.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/extensions/compat_xmlrpc/code/webservice.pl,v >retrieving revision 1.35 >diff -u -r1.35 webservice.pl >--- extensions/compat_xmlrpc/code/webservice.pl 23 May 2008 21:38:58 -0000 1.35 >+++ extensions/compat_xmlrpc/code/webservice.pl 23 May 2008 21:47:41 -0000 >@@ -251,19 +251,30 @@ > $bug->{actual_time} = $bug->actual_time; > $bug->{milestone_url} = $bug->milestoneurl; > >- $bug->{qa_contact} = type('string')->value($bug->qa_contact->login) >- if $bug->qa_contact; >- $bug->{assigned_to} = type('string')->value($bug->assigned_to->login) >- if $bug->assigned_to; >- $bug->{reporter} = type('string')->value($bug->reporter->login) >- if $bug->reporter; >- $bug->{product} = type('string')->value($bug->product) >+ if (Bugzilla->user->id) { >+ $bug->{reporter} = type('string')->value($bug->reporter->email) >+ if $bug->reporter; >+ $bug->{assigned_to} = type('string')->value($bug->assigned_to->email) >+ if $bug->assigned_to; >+ $bug->{qa_contact} = type('string')->value($bug->qa_contact->email) >+ if $bug->qa_contact; >+ } >+ else { >+ $bug->{reporter} = type('string')->value($bug->reporter->name) >+ if $bug->reporter; >+ $bug->{assigned_to} = type('string')->value($bug->assigned_to->name) >+ if $bug->assigned_to; >+ $bug->{qa_contact} = type('string')->value($bug->qa_contact->name) >+ if $bug->qa_contact; >+ } >+ >+ $bug->{product} = type('string')->value($bug->product) > if $bug->product_id; >- $bug->{component} = type('string')->value($bug->component) >+ $bug->{component} = type('string')->value($bug->component) > if $bug->component_id; > > if (Bugzilla->params->{'usebugaliases'}) { >- $item{'alias'} = type('string')->value($bug->alias); >+ $item{'alias'} = type('string')->value($bug->alias); > } > else { > # For API reasons, we always want the value to appear, we just >@@ -1091,6 +1102,13 @@ > my $order = $params->{order} > || "bugs.bug_status, bugs.priority, map_assigned_to.login_name, bugs.bug_id"; > >+ # REDHAT EXTENSION START 447765 >+ # Map map_*.login_name to map_*.realname if not logged in >+ if (!Bugzilla->user->id) { >+ $order =~ s/map_(assigned_to|qa_contact|reporter)\.login_name/map_$1\.realname/; >+ } >+ # REDHAT EXTENSION END 447765 >+ > # Make sure ORDER BY columns are included in the field list. > foreach my $fragment (split(/,/, $order)) { > $fragment = trim($fragment); >@@ -2969,16 +2987,28 @@ > foreach my $item (@components){ > foreach my $c (@$item){ > my $component_obj = new Bugzilla::Component($c->{id}); >- push @comps, >- { component => type('string')->value( $component_obj->name ), >- description => type('string')->value( $component_obj->description ), >- initialowner => >- type('string')->value( $component_obj->default_assignee->{login_name} ), >- initialqacontact => >- type('string')->value( $component_obj->default_qa_contact->{login_name} ), >- initialcclist => [ map $_->login, @{ $component_obj->initial_cc } ], >- }; >+ my %component_hash = ( >+ component => type('string')->value( $component_obj->name ), >+ description => type('string')->value( $component_obj->description ) >+ ); >+ >+ if (Bugzilla->user->id) { >+ $component_hash{initialowner} >+ = type('string')->value( $component_obj->default_assignee->{login_name} ); >+ $component_hash{initialqacontact} >+ = type('string')->value( $component_obj->default_qa_contact->{login_name} ); >+ $component_hash{initialcclist} >+ = [ map $_->login, @{ $component_obj->initial_cc } ]; >+ } >+ else { >+ $component_hash{initialowner} >+ = type('string')->value( $component_obj->default_assignee->{name} ); >+ $component_hash{initialqacontact} >+ = type('string')->value( $component_obj->default_qa_contact->{name} ); > } >+ >+ push @comps, \%component_hash; >+ } > } > > return \@comps; >Index: template/en/default/attachment/list.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/attachment/list.html.tmpl,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 list.html.tmpl >--- template/en/default/attachment/list.html.tmpl 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ template/en/default/attachment/list.html.tmpl 23 May 2008 21:47:41 -0000 >@@ -95,10 +95,16 @@ > title="Go to the comment associated with the attachment"> > [%- attachment.attached FILTER time %]</a>, > >- <a href="mailto:[% attachment.attacher.email FILTER html %]" >- title="Write an email to the creator of the attachment"> >- [% attachment.attacher.name || attachment.attacher.login FILTER html %] >- </a> >+ [%# REDHAT EXTENSION START 447765 %] >+ [% IF user.login %] >+ <a href="mailto:[% attachment.attacher.email FILTER html %]" >+ title="Write an email to the creator of the attachment"> >+ [% attachment.attacher.name || attachment.attacher.login FILTER html %] >+ </a> >+ [% ELSE %] >+ [% attachment.attacher.name FILTER html %] >+ [% END %] >+ [%# REDHAT EXTENSION END 447765 %] > </span> > </td> > >Index: template/en/default/bug/comments.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/bug/comments.html.tmpl,v >retrieving revision 1.3 >diff -u -r1.3 comments.html.tmpl >--- template/en/default/bug/comments.html.tmpl 11 Feb 2008 03:20:54 -0000 1.3 >+++ template/en/default/bug/comments.html.tmpl 23 May 2008 21:47:42 -0000 >@@ -167,9 +167,15 @@ > <a name="c[% count %]" href="show_bug.cgi?id=[% bug.bug_id %]#c[% count %]"> > [% comment_link FILTER html %]</a> From > <span class="vcard"> >- <a class="fn email" href="mailto:[% comment.author.email FILTER html %]"> >- [% (comment.author.name || comment.author.login) FILTER html %] >- </a> >+ [%# REDHAT EXTENSION START 447765 %] >+ [% IF user.login %] >+ <a class="fn email" href="mailto:[% comment.author.email FILTER html %]"> >+ [% (comment.author.name || comment.author.login) FILTER html %] >+ </a> >+ [% ELSE %] >+ [% (comment.author.name || "Need Real Name") %] >+ [% END %] >+ [%# REDHAT EXTENSION END 447765 %] > </span> > [% FOREACH group = comment.author.direct_group_membership %] > [% NEXT UNLESS group.icon_url %] >Index: template/en/default/bug/edit.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/bug/edit.html.tmpl,v >retrieving revision 1.32 >diff -u -r1.32 edit.html.tmpl >--- template/en/default/bug/edit.html.tmpl 23 May 2008 20:03:07 -0000 1.32 >+++ template/en/default/bug/edit.html.tmpl 23 May 2008 21:47:43 -0000 >@@ -580,7 +580,7 @@ > [% IF bug.check_can_change_field("assigned_to", 0, 1) %] > <div id="bz_assignee_edit_container" class="bz_default_hidden"> > <span> >- [% INCLUDE user_identity user=> bug.assigned_to %] >+ [% INCLUDE user_identity bug_user=> bug.assigned_to %] > (<a href="#" id="bz_assignee_edit_action">edit</a>) > </span> > </div> >@@ -603,7 +603,7 @@ > '[% bug.assigned_to.login FILTER js %]' ); > </script> > [% ELSE %] >- [% INCLUDE user_identity user => bug.assigned_to %] >+ [% INCLUDE user_identity bug_user => bug.assigned_to %] > [% END %] > </td> > </tr> >@@ -620,7 +620,7 @@ > <div id="bz_qa_contact_edit_container" class="bz_default_hidden"> > <span> > <span id="bz_qa_contact_edit_display"> >- [% INCLUDE user_identity user=> bug.qa_contact %]</span> >+ [% INCLUDE user_identity bug_user=> bug.qa_contact %]</span> > (<a href="#" id="bz_qa_contact_edit_action">edit</a>) > </span> > </div> >@@ -648,7 +648,7 @@ > initDefaultCheckbox('qa_contact'); > </script> > [% ELSE %] >- [% INCLUDE user_identity user => bug.qa_contact %] >+ [% INCLUDE user_identity bug_user => bug.qa_contact %] > [% END %] > </td> > </tr> >@@ -881,7 +881,7 @@ > <b>Reported</b>: > </td> > <td> >- [% bug.creation_ts FILTER time %] by [% INCLUDE user_identity user => bug.reporter %] >+ [% bug.creation_ts FILTER time %] by [% INCLUDE user_identity bug_user => bug.reporter %] > </td> > </tr> > >@@ -920,7 +920,7 @@ > || (!has_role > && user.settings.state_addselfcc.value == 'cc_unless_role') %]> > <label for="addselfcc"> >- Myself ([% INCLUDE user_identity user=> user FILTER collapse %]) >+ Myself ([% INCLUDE user_identity bug_user=> user FILTER collapse %]) > </label> > <br> > [% END %] >@@ -933,7 +933,7 @@ > [% END %] > [% IF user.id %] > [% IF bug.cc.contains( user.email ) %] >- including you ([% INCLUDE user_identity user=> user FILTER collapse %]) >+ including you ([% INCLUDE user_identity bug_user=> user FILTER collapse %]) > [% END %] > [% END %] > <span id="cc_edit_area_showhide_container" class="bz_default_hidden"> >@@ -1263,15 +1263,21 @@ > [% BLOCK user_identity %] > <span class="vcard"> > [% FILTER collapse %] >- [% IF user.name %] >- <a class="email" href="mailto:[% user.email FILTER html %]" >- title="[% user.email FILTER html %]" >- ><span class="fn">[% user.name FILTER html %]</span >- ></a> >+ [%# REDHAT EXTENSION START 447765 %] >+ [% IF user.login %] >+ [% IF bug_user.name %] >+ <a class="email" href="mailto:[% bug_user.email FILTER html %]" >+ title="[% user.email FILTER html %]" >+ ><span class="fn">[% bug_user.name FILTER html %]</span >+ ></a> >+ [% ELSE %] >+ <a class="fn email" href="mailto:[% bug_user.email FILTER html %]"> >+ [% bug_user.email FILTER html %]</a> >+ [% END %] > [% ELSE %] >- <a class="fn email" href="mailto:[% user.email FILTER html %]"> >- [% user.email FILTER html %]</a> >+ <span class="fn">[% bug_user.name FILTER html %]</span> > [% END %] >+ [%# REDHAT EXTENSION END 447765 %] > [% END %]</span> > [% END %] > >Index: template/en/default/reports/components.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/reports/components.html.tmpl,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 components.html.tmpl >--- template/en/default/reports/components.html.tmpl 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ template/en/default/reports/components.html.tmpl 23 May 2008 21:47:43 -0000 >@@ -74,13 +74,25 @@ > <a name="[% comp.name FILTER html %]">[% comp.name FILTER html %]</a> > </td> > <td> >- <a href="mailto:[% comp.default_assignee.email FILTER html %]"> >- [% comp.default_assignee.login FILTER html %]</a> >+ [%# REDHAT EXTENSION START 447765 %] >+ [% IF user.login %] >+ <a href="mailto:[% comp.default_assignee.email FILTER html %]"> >+ [% comp.default_assignee.login FILTER html %]</a> >+ [% ELSE %] >+ [% comp.default_assignee.name FILTER html %] >+ [% END %] >+ [%# REDHAT EXTENSION END 447765 %] > </td> > [% IF Param("useqacontact") %] > <td> >- <a href="mailto:[% comp.default_qa_contact.email FILTER html %]"> >- [% comp.default_qa_contact.login FILTER html %]</a> >+ [%# REDHAT EXTENSION START 447765 %] >+ [% IF user.login %] >+ <a href="mailto:[% comp.default_qa_contact.email FILTER html %]"> >+ [% comp.default_qa_contact.login FILTER html %]</a> >+ [% ELSE %] >+ [% comp.default_qa_contact.name FILTER html %] >+ [% END %] >+ [%# REDHAT EXTENSION END 447765 %] > </td> > [% END %] > </tr>
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:
nelhawar
: review+
dkl
: review? (
kbaker
)
Actions:
View
|
Diff
Attachments on
bug 447765
:
306312
| 306553 |
307006