mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
added a tester code
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17019 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
bd4fccf804
commit
4fe546feeb
2 files changed
+26
-2
No files matched your search
@@ -111,13 +111,17 @@ public abstract class SU {
|
||||
return task.call();
|
||||
|
||||
String javaExe = System.getProperty("java.home") + "/bin/java";
|
||||
String slaveJar = Which.jarFile(Launcher.class).getAbsolutePath();
|
||||
File slaveJar = Which.jarFile(Launcher.class);
|
||||
|
||||
// otherwise first attempt pfexec, as that doesn't require password
|
||||
Channel channel;
|
||||
Process proc=null;
|
||||
|
||||
ArgumentListBuilder args = new ArgumentListBuilder().add(javaExe, "-jar", slaveJar);
|
||||
ArgumentListBuilder args = new ArgumentListBuilder().add(javaExe);
|
||||
if(slaveJar.isFile())
|
||||
args.add("-jar").add(slaveJar);
|
||||
else // in production code this never happens, but during debugging this is convenient
|
||||
args.add("-cp").add(slaveJar).add(hudson.remoting.Launcher.class.getName());
|
||||
|
||||
if(rootPassword==null) {
|
||||
// try sudo, in the hope that the user has the permission to do so without password
|
||||
|
||||
Reference in new issue
Block a user