[Rt-commit] rt branch, 4.4/sys-config-blocks-externalauth, created. rt-4.4.1-156-g2d03cd9

Dustin Collins strega at bestpractical.com
Wed Dec 21 16:41:20 EST 2016


The branch, 4.4/sys-config-blocks-externalauth has been created
        at  2d03cd91a11ebd2c1676fc097778dc192ed74952 (commit)

- Log -----------------------------------------------------------------
commit 2d03cd91a11ebd2c1676fc097778dc192ed74952
Author: Dustin Collins <strega at bestpractical.com>
Date:   Wed Dec 21 16:41:03 2016 -0500

    Fix ExternalAuth failure from viewing System Configuration
    
    A copy of the source hash is created before replacing the pass to prevent modification of the original hash ref.
    
    Fixes: I#32469

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 3407796..41ab4a1 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1051,15 +1051,14 @@ our %META;
     ExternalSettings => {
         Obfuscate => sub {
             # Ensure passwords are obfuscated on the System Configuration page
-            my ($config, $sources, $user) = @_;
+            my ($config, $sourcerefs, $user) = @_;
 
             my $msg = 'Password not printed';
                $msg = $user->loc($msg) if $user and $user->Id;
 
-            for my $source (values %$sources) {
-                $source->{pass} = $msg;
-            }
-            return $sources;
+            #copy source hash and replace pass with msg
+            my @sources = map {my %src = %$_; $src{pass} = $msg; \%src} values %$sourcerefs;
+            return \@sources;
         },
         PostLoadCheck => sub {
             my $self = shift;

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


More information about the rt-commit mailing list