hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject git commit: HBASE-12164 Check for presence of user Id in SecureBulkLoadEndpoint#secureBulkLoadHFiles() is inaccurate
Date Fri, 03 Oct 2014 03:54:05 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 8dbf7b223 -> a17614d5b


HBASE-12164 Check for presence of user Id in SecureBulkLoadEndpoint#secureBulkLoadHFiles()
is inaccurate


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

Branch: refs/heads/master
Commit: a17614d5b27936c64af47d90408df007b1112d89
Parents: 8dbf7b2
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 3 03:53:58 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 3 03:53:58 2014 +0000

----------------------------------------------------------------------
 .../hbase/security/access/SecureBulkLoadEndpoint.java       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a17614d5/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
index dfd71fc..930d9b3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
@@ -198,7 +198,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
     }
     
     Token userToken = null;
-    if (request.getFsToken().hasIdentifier() && request.getFsToken().hasPassword())
{
+    if (userProvider.isHadoopSecurityEnabled()) {
       userToken = new Token(request.getFsToken().getIdentifier().toByteArray(), request.getFsToken()
               .getPassword().toByteArray(), new Text(request.getFsToken().getKind()), new
Text(
               request.getFsToken().getService()));
@@ -213,6 +213,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
       //for mini cluster testing
       ResponseConverter.setControllerException(controller,
           new DoNotRetryIOException("User token cannot be null"));
+      done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build());
       return;
     }
 
@@ -223,7 +224,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
         bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
       } catch (IOException e) {
         ResponseConverter.setControllerException(controller, e);
-        done.run(null);
+        done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build());
         return;
       }
     }
@@ -240,7 +241,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
           targetfsDelegationToken.acquireDelegationToken(fs);
         } catch (IOException e) {
           ResponseConverter.setControllerException(controller, e);
-          done.run(null);
+          done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build());
           return;
         }
         Token<?> targetFsToken = targetfsDelegationToken.getUserToken();
@@ -284,7 +285,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
         loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
       } catch (IOException e) {
         ResponseConverter.setControllerException(controller, e);
-        done.run(null);
+        done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build());
         return;
       }
     }


Mime
View raw message