Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2275#discussion_r79154968
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/security/SecurityContext.java
 ---
    @@ -155,6 +157,58 @@ public static void install(SecurityConfiguration 
config) throws Exception {
                installedContext = new SecurityContext(loginUser);
        }
     
    +   /*
    +    * This is a temporary fix to support both Kafka and ZK client libraries
    +    * that are expecting the system variable to determine secure cluster
    +    */
    +   private static void populateJaasConfigSystemProperty(Configuration 
configuration) {
    +
    +           //hack since Kafka Login Handler explicitly looks for the 
property or else it throws an exception
    +           
//https://github.com/apache/kafka/blob/0.9.0/clients/src/main/java/org/apache/kafka/common/security/kerberos/Login.java#L289
    +           if(null == configuration) {
    +                   System.setProperty("java.security.auth.login.config", 
"");
    +                   return;
    +           }
    +
    +           String baseDir = 
configuration.getString(ConfigConstants.FLINK_BASE_DIR_PATH_KEY, null);
    +           if(baseDir == null) {
    +                   System.setProperty("java.security.auth.login.config", 
"");
    +                   return;
    +           }
    +
    +           File f = new File(baseDir);
    +           if(!f.exists() || !f.isDirectory()) {
    +                   LOG.error("Invalid flink base directory {} 
configuration provided", baseDir);
    +                   throw new IllegalConfigurationException("Invalid flink 
base directory configuration provided");
    +           }
    --- End diff --
    
    This check should really be somewhere else. I think you can use 
`ENV_FLINK_CONF_DIR` which is always set. The `FLINK_BASE_DIR_PATH_KEY` should 
be deprecated. It's not used anymore.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to