-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Create ClassLoaders inside doPrivileged() + Auto-close the WAR file after exploding it #411
Conversation
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.
Should be good though I will need to add a test for the AccessController and WAR resource loading
@@ -338,12 +341,12 @@ public int run() throws Throwable { | |||
} | |||
} | |||
|
|||
public ClassLoader createJenkinsWarClassLoader() throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { |
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 do not recall what led to this exception list
return new ClassLoaderBuilder(new SideClassLoader(getPlatformClassloader())) | ||
.collectJars(new File(warDir,"WEB-INF/lib")) | ||
public ClassLoader createJenkinsWarClassLoader() throws PrivilegedActionException { | ||
return AccessController.doPrivileged((PrivilegedExceptionAction<ClassLoader>) () -> new ClassLoaderBuilder(new SideClassLoader(getPlatformClassloader())) |
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.
Jenkins is unlikely to work on advanced security policies . Should be fine though I will need to add Autotests for the resource loading
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.
This is pointless. See spotbugs/spotbugs#1515
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 tested it locally to verify the workaround for #413, and I confirm it still works well after the patch
Partially addresses #374