[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.7-106-gfcb3e2c

Ruslan Zakirov ruz at bestpractical.com
Fri Jan 29 13:38:32 EST 2010


The branch, 3.8-trunk has been updated
       via  fcb3e2cc432cfd60594702016139909c2e906ba1 (commit)
       via  01112af36812aa68dab2bd7f8609d4a56d7fe7d2 (commit)
       via  128cc4389327ad20330ed3fb1ef93fe6111ca076 (commit)
      from  1a9987fa09cbea4b0243e5e0758f68aa14453b5b (commit)

Summary of changes:
 lib/RT/Crypt/GnuPG.pm                  |   23 +++++++-
 share/html/Ticket/Elements/ShowSummary |  107 +++++++++++++++++---------------
 share/html/User/Elements/Tabs          |   66 ++++++++++----------
 3 files changed, 112 insertions(+), 84 deletions(-)

- Log -----------------------------------------------------------------
commit 128cc4389327ad20330ed3fb1ef93fe6111ca076
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Jan 27 12:44:16 2010 +0300

    fix potential information loose on incorrect GnuPG mails
    
    if a GnuPG email with inline ecryption or signature
    has incorrect nesting of markers, for example -----END GPG SIGNATURE-----,
    then we were missing whole text.
    
    Now we try to decrypt/verify it anyway.

diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index f9f6337..449b8ae 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -1306,11 +1306,12 @@ sub DecryptInline {
         die "Entity has no body, never should happen";
     }
 
+    my %res;
+
     my ($had_literal, $in_block) = ('', 0);
     my ($block_fh, $block_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $block_fh, ':raw';
 
-    my %res;
     while ( defined(my $str = $io->getline) ) {
         if ( $in_block && $str =~ /^-----END PGP (?:MESSAGE|SIGNATURE)-----/ ) {
             print $block_fh $str;
@@ -1351,6 +1352,26 @@ sub DecryptInline {
     }
     $io->close;
 
+    if ( $in_block ) {
+        # we're still in a block, this not bad not good. let's try to
+        # decrypt what we have, it can be just missing -----END PGP...
+        seek $block_fh, 0, 0;
+
+        my ($res_fh, $res_fn);
+        ($res_fh, $res_fn, %res) = _DecryptInlineBlock(
+            %args,
+            GnuPG => $gnupg,
+            BlockHandle => $block_fh,
+        );
+        return %res unless $res_fh;
+
+        print $tmp_fh "-----BEGIN OF PGP PROTECTED PART-----\n" if $had_literal;
+        while (my $buf = <$res_fh> ) {
+            print $tmp_fh $buf;
+        }
+        print $tmp_fh "-----END OF PART-----\n" if $had_literal;
+    }
+
     seek $tmp_fh, 0, 0;
     $args{'Data'}->bodyhandle( new MIME::Body::File $tmp_fn );
     $args{'Data'}->{'__store_tmp_handle_to_avoid_early_cleanup'} = $tmp_fh;

commit 01112af36812aa68dab2bd7f8609d4a56d7fe7d2
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Jan 27 12:55:51 2010 +0300

    re-indent tabs file, refactor current tab finder a little

diff --git a/share/html/User/Elements/Tabs b/share/html/User/Elements/Tabs
index 48cf180..7f9aca4 100755
--- a/share/html/User/Elements/Tabs
+++ b/share/html/User/Elements/Tabs
@@ -52,41 +52,43 @@
     Title => $Title &>
 
 <%INIT>
-  my $tabs = {
-  
-	       a => { title => loc('Settings'),
-			   path => 'Prefs/Other.html',
-			 },
-  
-             b => { title => loc('About me'),
-			  path => 'User/Prefs.html',
-			},
-	       g => { title => loc('Personal Groups'),
-			   path => 'User/Groups/',
-			 },
-	       h => { title => loc('Delegation'),
-			   path => 'User/Delegation.html',
-			 },
-	       f => { title => loc('Search options'),
-			   path => 'Prefs/SearchOptions.html',
-			 },
-	       r => { title => loc('RT at a glance'),
-			   path => 'Prefs/MyRT.html',
-			 },
-	     };
+my $tabs = {
+    a => {
+        title => loc('Settings'),
+        path => 'Prefs/Other.html',
+    },
+    b => {
+        title => loc('About me'),
+        path => 'User/Prefs.html',
+    },
+    g => {
+        title => loc('Personal Groups'),
+        path => 'User/Groups/',
+    },
+    h => {
+        title => loc('Delegation'),
+        path => 'User/Delegation.html',
+    },
+    f => {
+        title => loc('Search options'),
+        path => 'Prefs/SearchOptions.html',
+    },
+    r => {
+        title => loc('RT at a glance'),
+        path => 'Prefs/MyRT.html',
+    },
+};
 
-  # Now let callbacks add their extra tabs
-  $m->callback( %ARGS, tabs => $tabs );
-
-  foreach my $tab (sort keys %{$tabs}) {
-    if ($tabs->{$tab}->{'path'} eq $current_tab) {
-      $tabs->{$tab}->{"subtabs"} = $subtabs;
-      $tabs->{$tab}->{"current_subtab"} = $current_subtab;
-    }
-  }
-</%INIT>
+# Now let callbacks add their extra tabs
+$m->callback( %ARGS, tabs => $tabs );
 
+foreach my $tab (values %$tabs) {
+    next unless $tab->{'path'} eq $current_tab;
 
+    $tab->{"subtabs"} = $subtabs;
+    $tab->{"current_subtab"} = $current_subtab;
+}
+</%INIT>
 <%ARGS>
 $subtabs => undef
 $current_tab => undef

commit fcb3e2cc432cfd60594702016139909c2e906ba1
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Jan 27 12:57:11 2010 +0300

    tidy ShowSummary

diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index 4c2d54e..1b8c45e 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -45,73 +45,78 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-      <table width="100%" class="ticket-summary">
-      <tr>
-	<td valign="top" class="boxcontainer">
-	  <&| /Widgets/TitleBox, title => loc('The Basics'), 
-		title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id, 
-		class => 'ticket-info-basics' &>
-	        <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
-	  </&>
+<table width="100%" class="ticket-summary">
+<tr>
+  <td valign="top" class="boxcontainer">
+    <&| /Widgets/TitleBox, title => loc('The Basics'),
+        title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id,
+        class => 'ticket-info-basics',
+    &>
+        <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
+    </&>
 
 % if ($Ticket->CustomFields->First) {
-	  <&| /Widgets/TitleBox, title => loc('Custom Fields'), 
-		title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id, 
-		class => 'ticket-info-cfs'  &> 
-	        <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
-	  </&>
+    <&| /Widgets/TitleBox, title => loc('Custom Fields'),
+        title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id,
+        class => 'ticket-info-cfs',
+    &>
+        <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
+    </&>
 % }
-	  <&| /Widgets/TitleBox, title => loc('People'), 
-		title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id, 
-		class => 'ticket-info-people' &>
-            <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
-	  </&>
 
-      <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
+    <&| /Widgets/TitleBox, title => loc('People'),
+        title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id,
+        class => 'ticket-info-people',
+    &>
+        <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
+    </&>
 
-	  <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
+    <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
+
+    <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
 
 % $m->callback( %ARGS, CallbackName => 'LeftColumn' );
-	</td>
-	<td valign="top" class="boxcontainer">
+
+  </td>
+  <td valign="top" class="boxcontainer">
+
 % if ( RT->Config->Get('EnableReminders') ) {
-	  <&|/Widgets/TitleBox, title => loc("Reminders"),
-		title_href => RT->Config->Get('WebPath')."/Ticket/Reminders.html?id=".$Ticket->Id, 
-		class => 'ticket-info-reminders' &>
-        <table>
-        <tr>
-        <td>
+    <&|/Widgets/TitleBox, title => loc("Reminders"),
+        title_href => RT->Config->Get('WebPath')."/Ticket/Reminders.html?id=".$Ticket->Id,
+        class => 'ticket-info-reminders',
+    &>
+        <table><tr><td>
             <form action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post">
-	      <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &>
-              <div align="right"><input type="submit" class="button" value="<&|/l&>Save</&>" /></div>
+                <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &>
+                <div align="right"><input type="submit" class="button" value="<&|/l&>Save</&>" /></div>
             </form>
-            </td>
-            </tr>
-            </table>
-	  </&>
+        </td></tr></table>
+    </&>
 % }
-	  <&| /Widgets/TitleBox, title => loc("Dates"),
-		title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id, 
-		class => 'ticket-info-dates' &>
-	  <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
-	  </&>
+
+    <&| /Widgets/TitleBox, title => loc("Dates"),
+        title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id,
+        class => 'ticket-info-dates',
+    &>
+        <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
+    </&>
+
 % my (@extra);
 % push @extra, titleright_raw => '<a href="'. RT->Config->Get('WebPath'). '/Ticket/Graphs/index.html?id='.$Ticket->id.'">'.loc('Graph').'</a>' unless RT->Config->Get('DisableGraphViz');
-	  <&| /Widgets/TitleBox, title => loc('Links'), 
-		title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id, 
-		class => 'ticket-info-links', @extra &>
-	        <& /Elements/ShowLinks, Ticket => $Ticket &>
-          </&>
+    <&| /Widgets/TitleBox, title => loc('Links'),
+        title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id,
+        class => 'ticket-info-links',
+        @extra,
+    &>
+        <& /Elements/ShowLinks, Ticket => $Ticket &>
+    </&>
+
 % $m->callback( %ARGS, CallbackName => 'RightColumn' );
 
-	</td>
-      </tr>
-    </table>
+  </td>
+</tr>
+</table>
 <%ARGS>
 $Ticket => undef
 $Attachments => undef
 </%ARGS>
-
-
-
-

-----------------------------------------------------------------------


More information about the Rt-commit mailing list