Repository: hadoop Updated Branches: refs/heads/HDDS-4 3fa6787c5 -> f25b2357c (forced update)
Skip the proxy user check if the ugi has not been initialized. Contributed by Daryn Sharp Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/73e9120a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/73e9120a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/73e9120a Branch: refs/heads/HDDS-4 Commit: 73e9120ad79c73703de21e0084591861813f3279 Parents: f48fec8 Author: Rushabh Shah <shahr...@apache.org> Authored: Mon May 21 12:33:00 2018 -0500 Committer: Rushabh Shah <shahr...@apache.org> Committed: Mon May 21 12:33:00 2018 -0500 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/conf/Configuration.java | 2 +- .../org/apache/hadoop/security/UserGroupInformation.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/73e9120a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java index f1e2a9d..52f20b0 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java @@ -281,7 +281,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, } private static boolean getRestrictParserDefault(Object resource) { - if (resource instanceof String) { + if (resource instanceof String || !UserGroupInformation.isInitialized()) { return false; } UserGroupInformation user; http://git-wip-us.apache.org/repos/asf/hadoop/blob/73e9120a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java index cb132b3..3872810 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java @@ -288,14 +288,18 @@ public class UserGroupInformation { public static final String HADOOP_TOKEN_FILE_LOCATION = "HADOOP_TOKEN_FILE_LOCATION"; + public static boolean isInitialized() { + return conf != null; + } + /** * A method to initialize the fields that depend on a configuration. * Must be called before useKerberos or groups is used. */ private static void ensureInitialized() { - if (conf == null) { + if (!isInitialized()) { synchronized(UserGroupInformation.class) { - if (conf == null) { // someone might have beat us + if (!isInitialized()) { // someone might have beat us initialize(new Configuration(), false); } } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org