Skip to content

Commit

Permalink
Revert "attempt to fix AccessControlException (doesn't work)"
Browse files Browse the repository at this point in the history
This reverts commit 1e57ca2.
  • Loading branch information
jakelandis committed Nov 21, 2024
1 parent 1e57ca2 commit ef51ec9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.apache.hadoop.fs.Options;
import org.apache.hadoop.fs.Options.CreateOpts;
import org.apache.hadoop.fs.Path;
import org.elasticsearch.SpecialPermission;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.common.blobstore.BlobContainer;
import org.elasticsearch.common.blobstore.BlobPath;
Expand All @@ -39,9 +38,6 @@
import java.io.OutputStream;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.NoSuchFileException;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Iterator;
Expand Down Expand Up @@ -266,16 +262,8 @@ public void writeBlobAtomic(OperationPurpose purpose, String blobName, BytesRefe

private void writeToPath(BytesReference bytes, Path blobPath, FileContext fileContext, EnumSet<CreateFlag> createFlags)
throws IOException {
SpecialPermission.check();
try {
AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
try (FSDataOutputStream stream = fileContext.create(blobPath, createFlags, createOpts)) {
bytes.writeTo(stream);
}
return null;
});
} catch (PrivilegedActionException e) {
throw (IOException) e.getCause();
try (FSDataOutputStream stream = fileContext.create(blobPath, createFlags, createOpts)) {
bytes.writeTo(stream);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,4 @@ grant {
// client binds to the address returned from the host name of any principal set up as a service principal
// org.apache.hadoop.ipc.Client.Connection.setupConnection
permission java.net.SocketPermission "localhost:0", "listen,resolve";

permission org.elasticsearch.secure_sm.ThreadPermission, "modifyArbitraryThreadGroup";
};
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,4 @@ grant {
permission java.nio.file.LinkPermission "symbolic";
// needed for keystore tests
permission java.lang.RuntimePermission "accessUserInformation";
permission org.elasticsearch.secure_sm.ThreadPermission, "modifyArbitraryThreadGroup";
};

0 comments on commit ef51ec9

Please sign in to comment.