[Rt-commit] rt branch, 4.4/config-error, created. rt-4.4.2-1-g937da29

Shawn Moore shawn at bestpractical.com
Tue Sep 19 11:46:16 EDT 2017


The branch, 4.4/config-error has been created
        at  937da297c39540a5f21b0456ba7d6dcbc5d646d4 (commit)

- Log -----------------------------------------------------------------
commit 937da297c39540a5f21b0456ba7d6dcbc5d646d4
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Sep 19 15:39:41 2017 +0000

    Avoid throwing errors on System Configuration page
    
    The GetObfuscated routine began using Storable::dclone in
    cd9bb5215bf935dd53db1b3023d0ee033af0110c to avoid inadvertently updating
    the config data structure in memory when obfuscating passwords for the
    System Configuration page. That introduced a regression when the
    config to be obfuscated included a code reference (which is entirely
    reasonable for $ExternalSettings). Storable refuses to serialize code
    references, leading to this error when viewing System Configuration:
    
        Can't store CODE items
    
    This commit fixes the regression by permitting Storable to handle code
    references.
    
    Another fix may be to use Storable::forgive_me, but that, according to
    the documentation, produces "some meaningless string", which is less
    than ideal. Another fix still may be to migrate away from using
    Storable::dclone for this purpose, as we are just visualizing.
    
    Fixes: I#33019

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index e732730..0fbd38b 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1518,6 +1518,8 @@ sub GetObfuscated {
 
     return $self->Get(@_) unless $obfuscate;
 
+    local $Storable::Deparse = 1;
+    local $Storable::Eval = 1;
     my $res = Storable::dclone($self->Get(@_));
     $res = $obfuscate->( $self, $res, $user );
     return $self->_ReturnValue( $res, $META{$name}->{'Type'} || 'SCALAR' );

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


More information about the rt-commit mailing list