[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.3-39-g14eb138

Alex Vandiver alexmv at bestpractical.com
Tue Nov 8 15:18:23 EST 2011


The branch, 4.0-trunk has been updated
       via  14eb138a28a7372e0a639d78e2956f18f332db67 (commit)
       via  e9875cb7753ebfc72a59e41bae605721af1a6c6c (commit)
       via  95b76188bedaf7a65cf8985348c1c087100e8f33 (commit)
       via  1d8b7436e1338b356fa06561462b3f2682789a43 (commit)
       via  005d353e82908970614dd17963c77a90ceb3d0d1 (commit)
       via  4628a2bbe51adbe7e41b392b908c64265314c0a4 (commit)
       via  27677dd7bd4d108e19428ef386208f21008b2af1 (commit)
       via  dea1d879c2e1c3941b5b8a5b57ce5afa34ad81f4 (commit)
       via  8acc918d1854e9852aee555467d8a97dd7f06f3e (commit)
       via  7349f99d1bd1035421ccb1b843ad3f958b8168f3 (commit)
       via  8064158c0ce71f52b59d667a30baebd3873604e3 (commit)
       via  f5beed2515bab7eb46c4bbc7015ffb552ba269f4 (commit)
       via  3bee486f0eefbae63b5ac462f0fce093d3c6428a (commit)
       via  46a287994c49f69bc0d87114ca24c99f0b468ce5 (commit)
       via  bb1efa5fa5dfc4aa4bdb86dad30d6296530b88e8 (commit)
       via  2d97931d2f9157cbedbc282f52f0cd6a4da3dc48 (commit)
       via  f6bc4bd23c767a5db3187ae6956bdf0f8b4a0432 (commit)
       via  ae984654211e9e2797b3b6f2015a2cfb9f91f7ea (commit)
       via  5608ead60dede31a10ce8f8c18317f41901eb147 (commit)
       via  d3b6227b03b494d1286ec717bf871e6f34a88f0c (commit)
       via  06ace555d8c426c3fba833576b766aa886fcdb00 (commit)
       via  a740e98751ce11d3a5d80d3cd21cf2b83efacae4 (commit)
      from  e1d65fd695bd97613eff87489248f2fc49ccd581 (commit)

Summary of changes:
 etc/RT_Config.pm.in                                |   13 +++++
 lib/RT/Crypt/GnuPG.pm                              |   23 ++++++--
 lib/RT/Interface/Web.pm                            |    9 ++--
 .../binary-asc-attach-marked-plain-text.txt}       |   42 +++------------
 .../special/inline-binary-attachment-with-wrap.txt |   54 ++++++++++++++++++++
 t/mail/gnupg-special.t                             |   44 ++++++++++++++++-
 6 files changed, 140 insertions(+), 45 deletions(-)
 copy t/data/gnupg/emails/{12-encrypted-inline-binary.txt => special/binary-asc-attach-marked-plain-text.txt} (58%)
 create mode 100644 t/data/gnupg/emails/special/inline-binary-attachment-with-wrap.txt

- Log -----------------------------------------------------------------
commit 14eb138a28a7372e0a639d78e2956f18f332db67
Merge: e1d65fd e9875cb
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Nov 8 15:02:00 2011 -0500

    Merge branch '3.8-trunk' into 4.0-trunk
    
    Conflicts:
    	etc/RT_Config.pm.in
    	sbin/rt-test-dependencies.in
    	share/html/NoAuth/js/prototype/prototype.js
    	t/mail/gnupg-special.t

diff --cc etc/RT_Config.pm.in
index c302460,1df9c66..d3855a1
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@@ -1829,12 -1603,15 +1829,25 @@@ connections
  
  =cut
  
 -#Set($StandaloneMaxRequests, 50);
 +Set($WebSecureCookies, 0);
 +
++=item C<$WebHttpOnlyCookies>
++
++Default RT's session cookie to not being directly accessible to
++javascript.  The content is still sent during regular and AJAX requests,
++and other cookies are unaffected, but the session-id is less
++programmatically accessible to javascript.  Turning this off should only
++be necessary in situations with odd client-side authentication
++requirements.
++
++=cut
+ 
 -=item C<%NetServerOptions>
++Set($WebHttpOnlyCookies, 1);
+ 
 -C<%NetServerOptions> is a hash of additional options to use for
 -L<Net::Server/DEFAULT ARGUMENTS>. For example, you could set
 -reverse_lookups to get the hostnames for all users with:
 +=item C<$MinimumPasswordLength>
  
 -C<Set(%NetServerOptions, (reverse_lookups => 1));>
 +C<$MinimumPasswordLength> defines the minimum length for user
 +passwords. Setting it to 0 disables this check.
  
  =cut
  
diff --cc lib/RT/Crypt/GnuPG.pm
index e0cf95b,bb8b2db..d252504
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@@ -351,8 -351,10 +351,10 @@@ my %supported_opt = map { $_ => 1 } qw
         verbose
  );
  
+ our $RE_FILE_EXTENSIONS = qr/pgp|asc/i;
+ 
  # DEV WARNING: always pass all STD* handles to GnuPG interface even if we don't
 -# need them, just pass 'new IO::Handle' and then close it after safe_run_child.
 +# need them, just pass 'IO::Handle->new()' and then close it after safe_run_child.
  # we don't want to leak anything into FCGI/Apache/MP handles, this break things.
  # So code should look like:
  #        my $handles = GnuPG::Handles->new(
@@@ -1469,12 -1473,19 +1473,19 @@@ sub DecryptAttachment 
      );
      return %res unless $res_fh;
  
 -    $args{'Data'}->bodyhandle( new MIME::Body::File $res_fn );
 +    $args{'Data'}->bodyhandle(MIME::Body::File->new($res_fn) );
      $args{'Data'}->{'__store_tmp_handle_to_avoid_early_cleanup'} = $res_fh;
  
-     my $filename = $args{'Data'}->head->recommended_filename;
-     $filename =~ s/\.pgp$//i;
-     $args{'Data'}->head->mime_attr( $_ => $filename )
+     my $head = $args{'Data'}->head;
+ 
+     # we can not trust original content type
+     # TODO: and don't have way to detect, so we just use octet-stream
+     # some clients may send .asc files (encryped) as text/plain
+     $head->mime_attr( "Content-Type" => 'application/octet-stream' );
+ 
+     my $filename = $head->recommended_filename;
+     $filename =~ s/\.${RE_FILE_EXTENSIONS}$//i;
+     $head->mime_attr( $_ => $filename )
          foreach (qw(Content-Type.name Content-Disposition.filename));
  
      return %res;
diff --cc lib/RT/Interface/Web.pm
index 4884fe2,b3f593a..c880115
mode 100644,100755..100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
diff --cc t/mail/gnupg-special.t
index d001091,6a31ef1..7dd6347
--- a/t/mail/gnupg-special.t
+++ b/t/mail/gnupg-special.t
@@@ -2,8 -2,32 +2,10 @@@
  use strict;
  use warnings;
  
- use RT::Test::GnuPG tests => 13, gnupg_options => { passphrase => 'rt-test' };
 -use RT::Test tests => 23;
 -
 -plan skip_all => 'GnuPG required.'
 -    unless eval 'use GnuPG::Interface; 1';
 -plan skip_all => 'gpg executable is required.'
 -    unless RT::Test->find_executable('gpg');
++use RT::Test::GnuPG tests => 25, gnupg_options => { passphrase => 'rt-test' };
+ 
+ use Digest::MD5 qw(md5_hex);
  
 -use File::Temp qw(tempdir);
 -my $homedir = tempdir( CLEANUP => 1 );
 -
 -# catch any outgoing emails
 -RT::Test->set_mail_catcher;
 -
 -RT->Config->Set( 'GnuPG',
 -                 Enable => 1,
 -                 OutgoingMessagesFormat => 'RFC' );
 -
 -RT->Config->Set( 'GnuPGOptions',
 -                 homedir => $homedir,
 -                 'passphrase' => 'rt-test',
 -                 'no-permission-warning' => undef);
 -
 -RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
 -
  RT::Test->import_gnupg_key('rt-recipient at example.com');
  RT::Test->import_gnupg_key('rt-test at example.com', 'public');
  

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


More information about the Rt-commit mailing list