All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----app.authkit.envoy.Tool | +----app.authkit.tools.PerformAsRoot
Summary |
public class PerformAsRoot extends app.authkit.envoy.Tool { // Constructors 1 public PerformAsRoot(); // Methods 2 public static void main(String[]); public void perform(String[]); }
PerformAsRoot is a Tool that runs any Task as a privileged Envoy task. It is conceptually similar to the 'sudo' command in Mac OS X, but uses a completely different authorization method, and is a Java program.
Tasks are grouped using ":-" between them. Task-names must be fully qualified class names of a concrete Task with a no-args constructor. Task-args come after the task-name. Shell expressions that expand to pathnames are evaluated before PerformAsRoot is launched, so must be accessible to the current user. If a Task returns a non-zero result from perform(), the Envoy stops executing Tasks and returns a non-zero result.
Output from the privileged Envoy process is simply echoed to stdout. Ditto for stderr output.
PerformAsRoot performs no GUI-based user-interaction other than the system authentication dialog. You could make a Tool similar to PerformAsRoot that prompted with a FileDialog and returned results in an alert. This is left as an exercise for the interested reader.
Constructors |
· PerformAsRoot | Summary | Top |
public PerformAsRoot()
Default constructor
Methods |
· main | Summary | Top |
public static void main(String[] args)
Static entry point when used as a command-line tool.
· perform | Summary | Top |
public void perform(String[] args)
Perform arbitrary Tasks in a privileged Envoy process, echoing all output.
- Overrides:
- perform in class Tool
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7