hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1514439 - /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
Date Thu, 15 Aug 2013 19:07:18 GMT
Author: stack
Date: Thu Aug 15 19:07:17 2013
New Revision: 1514439

URL: http://svn.apache.org/r1514439
Log:
HBASE-9227 RESTServer should handle the loginUser correctly

Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java?rev=1514439&r1=1514438&r2=1514439&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
Thu Aug 15 19:07:17 2013
@@ -101,16 +101,13 @@ public class RESTServer implements Const
       String principalConfig = conf.get(REST_KERBEROS_PRINCIPAL);
       Preconditions.checkArgument(principalConfig != null && !principalConfig.isEmpty(),
         REST_KERBEROS_PRINCIPAL + " should be set if security is enabled");
-      String principalName = SecurityUtil.getServerPrincipal(principalConfig, machineName);
-      UserGroupInformation loginUser =
-        UserGroupInformation.loginUserFromKeytabAndReturnUGI(
-          principalName, keytabFilename);
+      User.login(conf, REST_KEYTAB_FILE, REST_KERBEROS_PRINCIPAL, machineName);
+      realUser = User.getCurrent().getUGI();
       if (conf.get(REST_AUTHENTICATION_TYPE) != null) {
         containerClass = RESTServletContainer.class;
         authFilter = new FilterHolder();
         authFilter.setClassName(AuthFilter.class.getName());
         authFilter.setName("AuthenticationFilter");
-        realUser = loginUser;
       }
     }
 



Mime
View raw message