You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2018/04/17 16:34:50 UTC

[geode] branch feature/GEODE-5085 updated: GEODE-5085 authentication failure when auto-reconnecting

This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-5085
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-5085 by this push:
     new 2c28e0a  GEODE-5085 authentication failure when auto-reconnecting
2c28e0a is described below

commit 2c28e0a4b894611e0c61a742030e0eb1d377e462
Author: Bruce Schuchardt <bs...@pivotal.io>
AuthorDate: Tue Apr 17 09:32:08 2018 -0700

    GEODE-5085 authentication failure when auto-reconnecting
    
    Reverting getSecurityProps() to return the converted internal form of
    property values.  The security service expects these to be in this form
    and not the external form.  My change caused a handful of security tests
    to fail.
    
    Added toSecurityProperties() in Config.java and converted
    InternalDistributedSystem.reconnect() to use this and toProperties()
    to get the external form of properties in order to build the new
    DistributionConfig to feed the reconnecting system.
---
 .../geode/distributed/internal/DistributionConfigImpl.java       | 7 +++++++
 .../geode/distributed/internal/InternalDistributedSystem.java    | 4 ++--
 geode-core/src/main/java/org/apache/geode/internal/Config.java   | 9 ++++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java
index e146c05..f5b2171 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java
@@ -2340,6 +2340,13 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
   @Override
   public Properties getSecurityProps() {
     Properties result = new Properties();
+    result.putAll(security);
+    return result;
+  }
+
+  @Override
+  public Properties toSecurityProperties() {
+    Properties result = new Properties();
     for (Object attName : security.keySet()) {
       if (attName instanceof String) {
         result.put(attName, getAttribute((String) attName));
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index 371c556..f9772a2 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -2609,8 +2609,8 @@ public class InternalDistributedSystem extends DistributedSystem
     }
 
     DistributionConfig oldConfig = ids.getConfig();
-    Properties configProps = getProperties();
-    configProps.putAll(getSecurityProperties());
+    Properties configProps = this.config.toProperties();
+    configProps.putAll(this.config.toSecurityProperties());
 
     int timeOut = oldConfig.getMaxWaitTimeForReconnect();
     int maxTries = oldConfig.getMaxNumReconnectTries();
diff --git a/geode-core/src/main/java/org/apache/geode/internal/Config.java b/geode-core/src/main/java/org/apache/geode/internal/Config.java
index 1f69f64..890eb2a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/Config.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/Config.java
@@ -105,13 +105,20 @@ public interface Config {
   boolean sameAs(Config v);
 
   /**
-   * Converts the contents of this config to a property instance.
+   * Converts the non-secure contents of this config to a property instance.
    *
    * @since GemFire 3.5
    */
   Properties toProperties();
 
   /**
+   * Converts the secure contents of this config to a property instance.
+   *
+   * @since Geode 1.6
+   */
+  Properties toSecurityProperties();
+
+  /**
    * Writes this config to the specified file.
    *
    * @since GemFire 3.5

-- 
To stop receiving notification emails like this one, please contact
bschuchardt@apache.org.