svn merge -c 1426515 FIXES: YARN-225. Proxy Link in RM UI thows NPE in Secure mode (Devaraj K via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1426516 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-12-28 14:22:23 +00:00
parent 7bec80179b
commit 4b5a93bc1d
2 changed files with 11 additions and 5 deletions

View File

@ -231,6 +231,9 @@ Release 0.23.6 - UNRELEASED
YARN-280. RM does not reject app submission with invalid tokens
(Daryn Sharp via tgraves)
YARN-225. Proxy Link in RM UI thows NPE in Secure mode
(Devaraj K via bobby)
Release 0.23.5 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -254,7 +254,9 @@ public class WebAppProxyServlet extends HttpServlet {
if(securityEnabled) {
String cookieName = getCheckCookieName(id);
for(Cookie c: req.getCookies()) {
Cookie[] cookies = req.getCookies();
if (cookies != null) {
for (Cookie c : cookies) {
if (cookieName.equals(c.getName())) {
userWasWarned = true;
userApproved = userApproved || Boolean.valueOf(c.getValue());
@ -262,6 +264,7 @@ public class WebAppProxyServlet extends HttpServlet {
}
}
}
}
boolean checkUser = securityEnabled && (!userWasWarned || !userApproved);