You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2011/10/19 19:24:12 UTC
svn commit: r1186357 - in
/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server:
client/ClientServiceHandler.java tabletserver/TabletServer.java
Author: kturner
Date: Wed Oct 19 17:24:12 2011
New Revision: 1186357
URL: http://svn.apache.org/viewvc?rev=1186357&view=rev
Log:
ACCUMULO-10 made bulk import thrift calls require system permission
Modified:
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java?rev=1186357&r1=1186356&r2=1186357&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java Wed Oct 19 17:24:12 2011
@@ -270,7 +270,7 @@ public class ClientServiceHandler implem
throws ThriftSecurityException, ThriftTableOperationException,
TException {
try {
- if (!authenticator.hasTablePermission(credentials, credentials.getUser(), tableId, TablePermission.BULK_IMPORT))
+ if(!authenticator.hasSystemPermission(credentials, credentials.getUser(), SystemPermission.SYSTEM))
throw new AccumuloSecurityException(credentials.getUser(), SecurityErrorCode.PERMISSION_DENIED);
return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() {
public List<String> call() throws Exception {
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1186357&r1=1186356&r2=1186357&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Wed Oct 19 17:24:12 2011
@@ -844,17 +844,16 @@ public class TabletServer extends Abstra
@Override
public List<TKeyExtent> bulkImport(TInfo tinfo, AuthInfo credentials, long tid, Map<TKeyExtent, Map<String, MapFileInfo>> files, boolean setTime)
throws ThriftSecurityException {
- ArrayList<TKeyExtent> failures = new ArrayList<TKeyExtent>();
- for (Entry<TKeyExtent, Map<String, MapFileInfo>> entry : files.entrySet()) {
- try {
- if (!authenticator.hasTablePermission(credentials, credentials.user, new String(entry.getKey().getTable()), TablePermission.BULK_IMPORT))
- throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
- } catch (AccumuloSecurityException e) {
- throw e.asThriftException();
- }
+ try {
+ if (!authenticator.hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM))
+ throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
+ } catch (AccumuloSecurityException e) {
+ throw e.asThriftException();
}
+ ArrayList<TKeyExtent> failures = new ArrayList<TKeyExtent>();
+
for (Entry<TKeyExtent, Map<String, MapFileInfo>> entry : files.entrySet()) {
TKeyExtent tke = entry.getKey();
Map<String, MapFileInfo> fileMap = entry.getValue();