[FIXED HUDSON-3653] Fixed in 1.305

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@18068 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-05-13 22:15:24 +00:00
1 parent fc13fdab1b
commit ea0ed93558
1 file changed
+5
@@ -2,12 +2,15 @@ package hudson.model;
import hudson.util.StreamTaskListener;
import hudson.util.NullStream;
import hudson.security.ACL;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Level;
import org.acegisecurity.context.SecurityContextHolder;
/**
* {@link PeriodicWork} that takes a long time to run.
*
@@ -46,6 +49,8 @@ public abstract class AsyncPeriodicWork extends PeriodicWork {
StreamTaskListener l = createListener();
try {
SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
execute(l);
} catch (IOException e) {
e.printStackTrace(l.fatalError(e.getMessage()));