public abstract class SU extends Object
Callableas 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.
|Modifier and Type||Method and Description|
Starts a new privilege-escalated environment, execute a closure, and shut it down.
public static hudson.remoting.VirtualChannel start(TaskListener listener, String rootUsername, String rootPassword) throws IOException, InterruptedException
VirtualChannelthat's connected to the privilege-escalated environment.
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
Copyright © 2004–2022. All rights reserved.