提交 9b580690 编写于 作者: K kohsuke

builds are now run as the 'SYSTEM' user.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7204 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ba2d2c3c
package hudson.model; package hudson.model;
import hudson.Util; import hudson.Util;
import hudson.security.ACL;
import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.StaplerResponse;
import org.acegisecurity.Authentication;
import org.acegisecurity.context.SecurityContextHolder;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import java.io.IOException; import java.io.IOException;
...@@ -39,6 +42,9 @@ public class Executor extends Thread implements ModelObject { ...@@ -39,6 +42,9 @@ public class Executor extends Thread implements ModelObject {
} }
public void run() { public void run() {
// run as the system user. see ACL.SYSTEM for more discussion about why this is somewhat broken
SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
try { try {
while(true) { while(true) {
if(Hudson.getInstance().isTerminating()) if(Hudson.getInstance().isTerminating())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册