Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gitignore
Binary file not shown.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic"
}
Original file line number Diff line number Diff line change
Expand Up @@ -856,16 +856,17 @@ private ClassLoader expandClasspath(ExtendedEmailPublisherContext context, Class
}

boolean useSecurity = Jenkins.get().isUseSecurity();
if (!classpathList.isEmpty()) {
GroovyClassLoader gloader = new GroovyClassLoader(loader);
gloader.setShouldRecompile(true);
for (ClasspathEntry entry : classpathList) {
if (useSecurity) {
ScriptApproval.get().using(entry);
if (!classpathList.isEmpty()) {
try (GroovyClassLoader gloader = new GroovyClassLoader(loader)) {
gloader.setShouldRecompile(true);
for (ClasspathEntry entry : classpathList) {
if (useSecurity) {
ScriptApproval.get().using(entry);
}
gloader.addURL(entry.getURL());
}
gloader.addURL(entry.getURL());
loader = gloader;
}
loader = gloader;
}
if (useSecurity) {
return GroovySandbox.createSecureClassLoader(loader);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/emailext/MailAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public FormValidation doCheckCredentialsId(
if (CredentialsProvider.listCredentials(
StandardUsernamePasswordCredentials.class,
item,
item instanceof Queue.Task t ? Tasks.getAuthenticationOf(t) : ACL.SYSTEM,
item instanceof Queue.Task t ? Tasks.getAuthenticationOf2(t) : ACL.SYSTEM2,
null,
CredentialsMatchers.withId(value))
.isEmpty()) {
Expand Down Expand Up @@ -310,7 +310,7 @@ private void migrateCredentials() {
}
final List<StandardUsernamePasswordCredentials> credentials = CredentialsMatchers.filter(
CredentialsProvider.lookupCredentials(
StandardUsernamePasswordCredentials.class, Jenkins.get(), ACL.SYSTEM, domainRequirement),
StandardUsernamePasswordCredentials.class, Jenkins.get(), ACL.SYSTEM2, domainRequirement),
CredentialsMatchers.withUsername(smtpUsername));
for (final StandardUsernamePasswordCredentials cred : credentials) {
if (smtpPassword.getPlainText().equals(Secret.toString(cred.getPassword()))) {
Expand Down
Loading