Repository: storm Updated Branches: refs/heads/0.10.x-branch 02f4ae96b -> 6a230e5b8
STORM-827: Allow AutoTGT to work with storm-hdfs too. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/cdce04ff Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/cdce04ff Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/cdce04ff Branch: refs/heads/0.10.x-branch Commit: cdce04ff9e7400e715b33029837c685a56e07819 Parents: 02f4ae9 Author: Robert (Bobby) Evans <[email protected]> Authored: Tue May 19 15:42:34 2015 -0500 Committer: P. Taylor Goetz <[email protected]> Committed: Fri May 29 12:08:37 2015 -0400 ---------------------------------------------------------------------- .../org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/cdce04ff/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java ---------------------------------------------------------------------- diff --git a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java index 9e390e9..86e7e3d 100644 --- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java +++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java @@ -17,6 +17,8 @@ */ package org.apache.storm.hdfs.common.security; +import backtype.storm.security.auth.kerberos.AutoTGT; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.UserGroupInformation; @@ -42,7 +44,8 @@ public class HdfsSecurityUtil { public static void login(Map conf, Configuration hdfsConfig) throws IOException { //If AutoHDFS is specified, do not attempt to login using keytabs, only kept for backward compatibility. if(conf.get(TOPOLOGY_AUTO_CREDENTIALS) == null || - !(((List)conf.get(TOPOLOGY_AUTO_CREDENTIALS)).contains(AutoHDFS.class.getName()))) { + (!(((List)conf.get(TOPOLOGY_AUTO_CREDENTIALS)).contains(AutoHDFS.class.getName())) && + !(((List)conf.get(TOPOLOGY_AUTO_CREDENTIALS)).contains(AutoTGT.class.getName())))) { if (UserGroupInformation.isSecurityEnabled()) { LOG.info("Logging in using keytab as AutoHDFS is not specified for " + TOPOLOGY_AUTO_CREDENTIALS); String keytab = (String) conf.get(STORM_KEYTAB_FILE_KEY);
