From da9d5a3fee6d27c8d6bac956849319f7850d33a5 Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Wed, 25 Apr 2018 22:09:37 -0700 Subject: [PATCH] HADOOP-15411. AuthenticationFilter should use Configuration.getPropsWithPrefix instead of iterator. (Suma Shivaprasad via wangda) Change-Id: Ia19458a43aceb4ffdb1e8eccc519655235d92ba9 (cherry picked from commit 3559d8b1dacf5cf207424de37cb6ba8865d26ffe) --- .../security/AuthenticationFilterInitializer.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/AuthenticationFilterInitializer.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/AuthenticationFilterInitializer.java index ca221f5b3dc..7e6b3a8bf76 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/AuthenticationFilterInitializer.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/AuthenticationFilterInitializer.java @@ -69,14 +69,10 @@ public class AuthenticationFilterInitializer extends FilterInitializer { //setting the cookie path to root '/' so it is used for all resources. filterConfig.put(AuthenticationFilter.COOKIE_PATH, "/"); + Map propsWithPrefix = conf.getPropsWithPrefix(prefix); - for (Map.Entry entry : conf) { - String name = entry.getKey(); - if (name.startsWith(prefix)) { - String value = conf.get(name); - name = name.substring(prefix.length()); - filterConfig.put(name, value); - } + for (Map.Entry entry : propsWithPrefix.entrySet()) { + filterConfig.put(entry.getKey(), entry.getValue()); } //Resolve _HOST into bind address