sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2085: Null handling in AuthorizationEngine
Date Mon, 09 Feb 2015 06:20:19 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 cfe273400 -> 1722d740b


SQOOP-2085: Null handling in AuthorizationEngine

(Richard Zhou via Abraham Elmahrek)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/1722d740
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/1722d740
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/1722d740

Branch: refs/heads/sqoop2
Commit: 1722d740ba3bd9802df99296765f5ca155d02973
Parents: cfe2734
Author: Abraham Elmahrek <abe@apache.org>
Authored: Sun Feb 8 22:19:35 2015 -0800
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Sun Feb 8 22:19:35 2015 -0800

----------------------------------------------------------------------
 .../apache/sqoop/security/Authorization/AuthorizationEngine.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/1722d740/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
----------------------------------------------------------------------
diff --git a/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
b/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
index dbf6dd4..24bd6f1 100644
--- a/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
+++ b/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
@@ -178,7 +178,8 @@ public class AuthorizationEngine {
   private static void checkPrivilege(MPrivilege... privileges) {
     AuthorizationHandler handler = AuthorizationManager.getAuthorizationHandler();
     UserGroupInformation user = HttpUserGroupInformation.get();
-    MPrincipal principal = new MPrincipal(user.getUserName(), RoleType.USER.name());
+    String user_name = user == null ? StringUtils.EMPTY : user.getUserName();
+    MPrincipal principal = new MPrincipal(user_name, RoleType.USER.name());
     handler.checkPrivileges(principal, Arrays.asList(privileges));
   }
 }
\ No newline at end of file


Mime
View raw message