ACCUMULO-3874 base64 decode the principal before sending it back

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

Branch: refs/heads/1.7
Commit: d71e5ee4c3b331e9467769d177876b0b2859e978
Parents: acb5d2e
Author: Josh Elser <els...@apache.org>
Authored: Mon Jun 1 15:38:55 2015 -0400
Committer: Josh Elser <els...@apache.org>
Committed: Mon Jun 1 15:38:55 2015 -0400

----------------------------------------------------------------------
 .../server/security/handler/KerberosAuthenticator.java       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d71e5ee4/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java
----------------------------------------------------------------------
diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java
 
b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java
index 4ec4ba4..3ead57f 100644
--- 
a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java
+++ 
b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java
@@ -171,8 +171,12 @@ public class KerberosAuthenticator implements 
Authenticator {
 
   @Override
   public synchronized void dropUser(String user) throws 
AccumuloSecurityException {
-    user = Base64.encodeBase64String(user.getBytes(UTF_8));
-    zkAuthenticator.dropUser(user);
+    final String encodedUser = Base64.encodeBase64String(user.getBytes(UTF_8));
+    try {
+      zkAuthenticator.dropUser(encodedUser);
+    } catch (AccumuloSecurityException e) {
+      throw new AccumuloSecurityException(user, 
e.asThriftException().getCode(), e.getCause());
+    }
   }
 
   @Override

Reply via email to