8344078: Remove security manager dependency in java.nio

Reviewed-by: alanb, rriggs
This commit is contained in:
Brian Burkhalter 2024-11-18 19:17:14 +00:00
parent 2649406323
commit 922b12f30c
67 changed files with 285 additions and 1480 deletions

View file

@ -25,20 +25,12 @@
package sun.nio.ch;
import java.security.AccessController;
import java.security.PrivilegedAction;
/**
* Creates this platform's default SelectorProvider
*/
@SuppressWarnings("removal")
public class DefaultSelectorProvider {
private static final SelectorProviderImpl INSTANCE;
static {
PrivilegedAction<SelectorProviderImpl> pa = KQueueSelectorProvider::new;
INSTANCE = AccessController.doPrivileged(pa);
}
private static final SelectorProviderImpl INSTANCE = new KQueueSelectorProvider();
/**
* Prevent instantiation.

View file

@ -50,9 +50,6 @@ class BsdFileAttributeViews {
return;
}
// permission check
path.checkWrite();
// use a file descriptor if possible to avoid a race due to accessing
// a path more than once as the file at that path could change.
// if path is a symlink, then the open should fail with ELOOP and

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,13 +28,11 @@ package sun.nio.fs;
import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.WatchService;
import java.security.AccessController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import sun.nio.ch.IOStatus;
import sun.security.action.GetPropertyAction;
import static sun.nio.fs.UnixConstants.*;
import static sun.nio.fs.UnixNativeDispatcher.chown;