-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8344365: SecurityManager cleanups in java.sql and java.sql.rowset modules #22185
Conversation
👋 Welcome back eirbjo! A progress list of the required criteria for merging this PR into |
@eirbjo This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
I think Brent and/or Lance have been working on this already. If you are taking this, can you remove src/java.sql.rowset/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java from the patch as it introduces a behavioural change that may require further work. |
Happy to yield if Brent/Lance has something cooking. Otherwise, perhaps their time is better spent as reviewers.
Seems like a clean inline, how does this introduce a behavioural change?
|
Class.forName's behavior depends on the caller's defining class loader. I don't know where Brent and/or Lance is on the changes for this module but if you are taking it then I would prefer if the changes to XmlReaderContentHandler were dropped. |
Thanks, makes sense. I have reverted changes in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this Eirik. I made a pass through and I think the changes are reasonable.
I have asked Sean to also make a pass as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
/reviewers 2 reviewer |
@eirbjo this pull request can not be integrated into git checkout sm-cleanup-sql
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
@RogerRiggs |
# Conflicts: # test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java
Hey @RogerRiggs, I needed to merge with master to resolve a conflict after the integration of your PR #22041. Would you mind taking another look at the merge commit 3f1df59 and re-review this PR? While looking at your change in #22041, I noticed you removed CheckCSM runs fine with this method removed from If it was, I'm happy to remove it while I'm visiting this code anyhow, or you could clean it up via some other PR. Thanks :-) |
Yes, please cleanup the leftover mention, in CheckCSMs. of ObjectStreamField.getType(). |
…leftover from JDK-8344034
Thanks, see 0278c59. This leaves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the update.
Leave the test with an empty set of methods for CallerSensistiveAdepter will make it clearer to check for matching test conditions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your mailing list message recommends removal of this test. This test covers more than ensuring that CSMs are final or static; it actually scans all platform classes to ensure CSMs are present wherever they are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll leave the test with the empty set as suggested by Roger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the changes look fine.
I submitted an internal automated test run and it passes cleanly. |
/integrate |
Going to push as commit d85dd77.
Your commit was automatically rebased without conflicts. |
Please review this PR which cleans up SecurityManager-related code in
java.sql
andjava.sql.rowset
modules post JEP-486There are quite a few changes to review, but all relatively straightforward:
DriverManager
SecurityManager::checkPermission
calls in thesetLogWriter
,setLogStream
andderegisterDriver
methodsensureDriversInitialized
is updated to removeAccessController::doPrivileged
when reading a system property and when initializing driversCachedRowSetImpl
AccessController::doPrivileged
when getting aSyncFactory
instancegetObject
is update to remove a call toReflectUtil::checkPackageAccess
CachedRowSetWriter
ReflectUtil::checkPackageAccess
is removed.SerialJavaObject
getFields
is updated to remove call toReflectUtil::checkPackageAccess
.@CallerSensitive
is no longer needed for this method.CheckCSMs.java
is updated to remove references toSerialJavaObject:getFields
SyncFactory
initMapIfNecessary
is updated to remove call toAccessController::doPrivileged
when reading system properties and when reading properties from an input streamgetInstance
is updated to remove calls toReflectUtil::checkPackageAccess
setLogger
method is updated to remove call toSecurityManager::checkPermission
setJNDIContext
methods are updated to remove call toSecurityManager::checkPermission
RowsetProvider
System::getProperty
directlynewFactory
is updated to callSystem::getProperty
directlynewFactory
is updated to not callReflectUtil.checkPackageAccess
getContextClassLoader
is updated to not callAccessController::doPrivileged
getFactoryClass
is updated to not callReflectUtil.checkPackageAccess
getSystemProperty
is removedSQLInputImpl
ReflectUtil::checkPackageAccess
is removedTestPolicy.java
intest/java/sql/testng/util
Ran
test/jdk/java/sql
andtest/jdk/javax/sql
tests locally. GHA results pending.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22185/head:pull/22185
$ git checkout pull/22185
Update a local copy of the PR:
$ git checkout pull/22185
$ git pull https://git.openjdk.org/jdk.git pull/22185/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22185
View PR using the GUI difftool:
$ git pr show -t 22185
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22185.diff
Using Webrev
Link to Webrev Comment