Skip to content

Commit

Permalink
Remove redundant KerberosName#setRules call
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel39 committed Aug 31, 2018
1 parent 7dc4568 commit a36724f
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.facebook.presto.hive.HdfsConfigurationUpdater;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authentication.util.KerberosName;

import javax.security.auth.Subject;

Expand All @@ -38,11 +37,7 @@ public static KerberosHadoopAuthentication createKerberosHadoopAuthentication(Ke
// UserGroupInformation.authenticationMethod static field must be set to KERBEROS
// It is further used in many places in DfsClient
configuration.set("hadoop.security.authentication", "kerberos");
String authToLocalRules = configuration.get("hadoop.security.auth_to_local");
if (authToLocalRules == null) {
// KerberosName#rules static field must be initialized if hadoop.security.auth_to_local is null
KerberosName.setRules("DEFAULT");
}

UserGroupInformation.setConfiguration(configuration);

return new KerberosHadoopAuthentication(kerberosAuthentication);
Expand Down

0 comments on commit a36724f

Please sign in to comment.