ctubbsii commented on code in PR #6423:
URL: https://github.com/apache/accumulo/pull/6423#discussion_r3415400808


##########
server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java:
##########
@@ -880,18 +876,20 @@ public TExternalCompactionList 
getCompletedCompactions(TInfo tinfo, TCredentials
 
   @Override
   public void cancel(TInfo tinfo, TCredentials credentials, String 
externalCompactionId)
-      throws TException {
+      throws ThriftSecurityException {
     var runningCompaction = 
RUNNING_CACHE.get(ExternalCompactionId.of(externalCompactionId));
     var extent = KeyExtent.fromThrift(runningCompaction.getJob().getExtent());
     try {
       NamespaceId nsId = getContext().getNamespaceId(extent.tableId());
       if (!security.canCompact(credentials, extent.tableId(), nsId)) {
-        throw new AccumuloSecurityException(credentials.getPrincipal(),
-            SecurityErrorCode.PERMISSION_DENIED).asThriftException();
+        throw new ThriftSecurityException(credentials.getPrincipal(),
+            SecurityErrorCode.PERMISSION_DENIED);
       }
     } catch (TableNotFoundException e) {
-      throw new ThriftTableOperationException(extent.tableId().canonical(), 
null,
-          TableOperation.COMPACT_CANCEL, TableOperationExceptionType.NOTFOUND, 
e.getMessage());
+      // if the table is deleted, there is no way to check user permissions to 
cancel
+      // the system should handle this automatically
+      throw new ThriftSecurityException(credentials.getPrincipal(),
+          SecurityErrorCode.PERMISSION_DENIED);

Review Comment:
   The user never supplied a table for this operation, though. It's entirely 
incidental to the request because there was an error while trying to examine 
the permissions. The security problem exists because the table couldn't be 
found, but it's still a security problem, in that the user's permissions to 
cancel that compaction ID cannot be determined.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to