/hg/icedtea6: Fix mistake in backport of S8010118
omajid at icedtea.classpath.org
omajid at icedtea.classpath.org
Wed Jul 17 11:04:39 PDT 2013
changeset 5cba6fc13701 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=5cba6fc13701
author: Omair Majid <omajid at redhat.com>
date: Wed Jul 17 11:54:43 2013 -0400
Fix mistake in backport of S8010118
2013-07-17 Omair Majid <omajid at redhat.com>
* patches/openjdk/8010118-caller_sensitive.patch: Fix mistake in
backport.
diffstat:
ChangeLog | 5 +++++
patches/openjdk/8010118-caller_sensitive.patch | 26 ++++++++++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
diffs (79 lines):
diff -r 11f837636a0a -r 5cba6fc13701 ChangeLog
--- a/ChangeLog Thu Jul 11 23:43:09 2013 +0100
+++ b/ChangeLog Wed Jul 17 11:54:43 2013 -0400
@@ -1,3 +1,8 @@
+2013-07-17 Omair Majid <omajid at redhat.com>
+
+ * patches/openjdk/8010118-caller_sensitive.patch: Fix mistake in
+ backport.
+
2013-07-11 Andrew John Hughes <gnu.andrew at redhat.com>
* NEWS:
diff -r 11f837636a0a -r 5cba6fc13701 patches/openjdk/8010118-caller_sensitive.patch
--- a/patches/openjdk/8010118-caller_sensitive.patch Thu Jul 11 23:43:09 2013 +0100
+++ b/patches/openjdk/8010118-caller_sensitive.patch Wed Jul 17 11:54:43 2013 -0400
@@ -1484,17 +1484,17 @@
// Walk through the loaded drivers attempting to locate someone
// who understands the given URL.
-@@ -258,8 +248,7 @@
+@@ -258,8 +248,8 @@
DriverInfo di = (DriverInfo)drivers.elementAt(i);
// If the caller does not have permission to load the driver then
// skip it.
- if ( getCallerClass(callerCL, di.driverClassName ) !=
-- di.driverClass ) {
-+ if ( callerClass != di.driverClass ) {
++ if ( getCallerClass(callerClass, di.driverClassName ) !=
+ di.driverClass ) {
println(" skipping: " + di);
continue;
}
-@@ -322,31 +311,29 @@
+@@ -322,31 +311,30 @@
* @param driver the JDBC Driver to drop
* @exception SQLException if a database access error occurs
*/
@@ -1504,6 +1504,7 @@
- // Gets the classloader of the code that called this method,
- // may be null.
- ClassLoader callerCL = DriverManager.getCallerClassLoader();
++ Class<?> callerClass = Reflection.getCallerClass();
println("DriverManager.deregisterDriver: " + driver);
// Walk through the loaded drivers.
@@ -1524,7 +1525,7 @@
// If the caller does not have permission to load the driver then
// throw a security exception.
- if (getCallerClass(callerCL, di.driverClassName ) != di.driverClass ) {
-+ if (Reflection.getCallerClass() != di.driverClass) {
++ if (getCallerClass(callerClass, di.driverClassName ) != di.driverClass) {
throw new SecurityException();
}
@@ -1551,10 +1552,23 @@
// If the caller does not have permission to load the driver then
// skip it.
- if ( getCallerClass(callerCL, di.driverClassName ) != di.driverClass ) {
-+ if ( callerClass != di.driverClass ) {
++ if ( getCallerClass(callerClass, di.driverClassName) != di.driverClass ) {
println(" skipping: " + di);
continue;
}
+@@ -467,6 +467,12 @@
+
+ //------------------------------------------------------------------------
+
++ private static Class getCallerClass(Class<?> caller,
++ String driverClassName) {
++ ClassLoader callerCL = caller != null ? caller.getClassLoader() : null;
++ return getCallerClass(callerCL, driverClassName);
++ }
++
+ // Returns the class object that would be created if the code calling the
+ // driver manager had loaded the driver class, or null if the class
+ // is inaccessible.
@@ -546,19 +537,20 @@
// Worker method called by the public getConnection() methods.
More information about the distro-pkg-dev
mailing list