Skip to content

Return false when java.security.auth.login.config is unreadable #78

@devcsrj

Description

@devcsrj

In the ZkClient#isZkSaslEnabled, the method fails when the file represented by java.security.auth.login.config is unreadable:

        String loginConfigFile = System.getProperty(JAVA_LOGIN_CONFIG_PARAM);
        if (loginConfigFile != null && loginConfigFile.length() > 0) {
            LOG.info("JAAS File name: " + loginConfigFile);
            File configFile = new File(loginConfigFile);
            if (!configFile.canRead()) {
                throw new IllegalArgumentException("File " + loginConfigFile + "cannot be read.");
            }
        ...

Another 3rd-party library I'm using in the classpath, unfortunately, sets the java.security.auth.login.config system property to gss.conf, which causes ZkClient to fail when checking whether Sasl is enabled.

Will it be alright to replace this with a logger warning instead (i.e., return false on cases where the config file is unreadable)? If not, what're your recommendations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions