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:53:32 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 a2fe4d670 -> 660f909a5


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/660f909a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/660f909a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/660f909a

Branch: refs/heads/branch-1
Commit: 660f909a58986151f300ebf6c7fbbea963cb3cf3
Parents: a2fe4d6
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 3 03:53:26 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 3 03:53:26 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/660f909a/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 2f04799..48c00f3 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
@@ -197,7 +197,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()));
@@ -212,6 +212,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;
     }
 
@@ -222,7 +223,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;
       }
     }
@@ -239,7 +240,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();
@@ -283,7 +284,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