|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.os.SU
public abstract class SU
Executes Callable
as the super user, by forking a new process and executing the closure in there
if necessary.
A best effort is made to execute the closure as root, but we may still end up executing the closure in the non-root privilege, so the closure should expect that and handle it gracefully.
Still very much experimental. Subject to change. Don't use it.
Method Summary | ||
---|---|---|
static
|
execute(TaskListener listener,
String rootUsername,
String rootPassword,
hudson.remoting.Callable<V,T> closure)
Starts a new priviledge-escalated environment, execute a closure, and shut it down. |
|
static hudson.remoting.VirtualChannel |
start(TaskListener listener,
String rootUsername,
String rootPassword)
Returns a VirtualChannel that's connected to the priviledge-escalated environment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static hudson.remoting.VirtualChannel start(TaskListener listener, String rootUsername, String rootPassword) throws IOException, InterruptedException
VirtualChannel
that's connected to the priviledge-escalated environment.
listener
- What this method is doing (such as what process it's invoking) will be sent here.
LocalChannel
.
Close this channel and the SU environment will be shut down.
IOException
InterruptedException
public static <V,T extends Throwable> V execute(TaskListener listener, String rootUsername, String rootPassword, hudson.remoting.Callable<V,T> closure) throws T extends Throwable, IOException, InterruptedException
T extends Throwable
IOException
InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |