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/trunk@1426515 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-12-28 14:21:07 +00:00
parent 0fa9c7a825
commit 4b9f0443cb
2 changed files with 11 additions and 5 deletions

View File

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